diff options
author | Stephen <tsadams@gmail.com> | 2017-10-04 04:25:13 -0400 |
---|---|---|
committer | Martin Krizek <martin.krizek@gmail.com> | 2017-10-04 10:25:13 +0200 |
commit | 9c6ad3d07642cfbd0a4ee0d889da62f8eccd21fb (patch) | |
tree | 1c53442796776a88e6c52bf0169499a3fa1cc450 /test/integration/targets/yum | |
parent | 1378861fe75fcae2d0ad7b880e70999112d20609 (diff) | |
download | ansible-9c6ad3d07642cfbd0a4ee0d889da62f8eccd21fb.tar.gz |
Add update_only parameter for yum module (#22206)
* Add update_only parameter for yum module
When using latest, `update_only: yes` will ensure that only existing
packages are updated and no additional packages are installed.
* Update yum.py
Update version added for `update_only` parameter to 2.5
* add unit tests for update_only flag in yum module
Diffstat (limited to 'test/integration/targets/yum')
-rw-r--r-- | test/integration/targets/yum/tasks/yum.yml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/integration/targets/yum/tasks/yum.yml b/test/integration/targets/yum/tasks/yum.yml index 180a4696c7..e486eeb63c 100644 --- a/test/integration/targets/yum/tasks/yum.yml +++ b/test/integration/targets/yum/tasks/yum.yml @@ -427,3 +427,32 @@ that: - "'changed' in yum_result" - "'msg' in yum_result" + +- name: use latest to install httpd + yum: + name: httpd + state: latest + register: yum_result + +- name: verify httpd was installed + assert: + that: + - "'changed' in yum_result" + +- name: uninstall httpd + yum: + name: httpd + state: removed + +- name: update httpd only if it exists + yum: + name: httpd + state: latest + update_only: yes + register: yum_result + +- name: verify httpd not installed + assert: + that: + - "not yum_result.changed" + - "'Packages providing httpd not installed due to update_only specified' in yum_result.results" |