summaryrefslogtreecommitdiff
path: root/test/integration/targets/yum
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2018-11-02 02:20:29 +1000
committeransibot <ansibot@users.noreply.github.com>2018-11-01 12:20:29 -0400
commitf0535bac8087e659e599ffd72ac9853ea3823bd4 (patch)
tree3edc507ff753e816411a97e631692cccc6dd82fb /test/integration/targets/yum
parentcfe7c9606c6fd628388aecc32127737d35c60877 (diff)
downloadansible-f0535bac8087e659e599ffd72ac9853ea3823bd4.tar.gz
dnf yum: fix tests running on Fedora 29 (#47910)
* dnf yum: fix tests running on Fedora 29 * wrap in always block
Diffstat (limited to 'test/integration/targets/yum')
-rw-r--r--test/integration/targets/yum/files/yum.conf5
-rw-r--r--test/integration/targets/yum/tasks/yum.yml31
2 files changed, 28 insertions, 8 deletions
diff --git a/test/integration/targets/yum/files/yum.conf b/test/integration/targets/yum/files/yum.conf
new file mode 100644
index 0000000000..5a5fca608d
--- /dev/null
+++ b/test/integration/targets/yum/files/yum.conf
@@ -0,0 +1,5 @@
+[main]
+gpgcheck=1
+installonly_limit=3
+clean_requirements_on_remove=True
+tsflags=nodocs
diff --git a/test/integration/targets/yum/tasks/yum.yml b/test/integration/targets/yum/tasks/yum.yml
index 6dc29cc73f..1e99af9b19 100644
--- a/test/integration/targets/yum/tasks/yum.yml
+++ b/test/integration/targets/yum/tasks/yum.yml
@@ -120,15 +120,30 @@
that:
- "yum_result is successful"
-- name: install sos with state latest in check mode with config file param
- yum: name=sos state=latest conf_file=/etc/yum.conf
- check_mode: true
- register: yum_result
-- name: verify install sos with state latest in check mode with config file param
- assert:
- that:
+- name: copy yum.conf file in case it is missing
+ copy:
+ src: yum.conf
+ dest: /etc/yum.conf
+ force: False
+ register: yum_conf_copy
+
+- block:
+ - name: install sos with state latest in check mode with config file param
+ yum: name=sos state=latest conf_file=/etc/yum.conf
+ check_mode: true
+ register: yum_result
+ - name: verify install sos with state latest in check mode with config file param
+ assert:
+ that:
- "yum_result is changed"
+ always:
+ - name: remove tmp yum.conf file if we created it
+ file:
+ path: /etc/yum.conf
+ state: absent
+ when: yum_conf_copy is changed
+
- name: install sos with state latest in check mode
yum: name=sos state=latest
check_mode: true
@@ -742,4 +757,4 @@
# Fedora < 26 has a bug in dnf where package excludes in dnf.conf aren't
# actually honored and those releases are EOL'd so we have no expectation they
# will ever be fixed
- when: not ((ansible_distribution == "Fedora") and (ansible_distribution_major_version|int < 26)) \ No newline at end of file
+ when: not ((ansible_distribution == "Fedora") and (ansible_distribution_major_version|int < 26))