mirror of https://github.com/ansible/ansible.git
dnf: Add nobest option (#70318)
* dnf: Add nobest option * dnf: Fix indent, add nobest specifically to dnf not yum * Add changelog for dnf: add nobest option * dnf: Add nobest to yumdnf module argument_spec * dnf: remove nobest from module paramaters in yumdnf.py * dnf: Add test for nobest option * dnf: Cleanup packages in nobest test at last * dnf: Cleanup manually added repos in nobest test at last * dnf: Remove dnf-plugins-core as well in nobest test * dnf: Change nobest release version to 2.11 * Change changelog number according to change in PR number * Change changelog number according to change in PR numberpull/70930/head
parent
205eda335f
commit
9d2982549d
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
minor_changes:
|
||||||
|
- dnf - Add nobest option (https://github.com/ansible/ansible/issues/69983)
|
@ -0,0 +1,34 @@
|
|||||||
|
- name: Install dnf-plugins-core in order to use dnf config-manager
|
||||||
|
dnf:
|
||||||
|
name: dnf-plugins-core
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Add docker-ce repo (Only RedHat & CentOS)
|
||||||
|
shell: dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
|
||||||
|
when: (ansible_distribution in ['RedHat', 'CentOS'])
|
||||||
|
|
||||||
|
- name: Add docker-ce repo (Only Fedora)
|
||||||
|
shell: dnf config-manager --add-repo=https://download.docker.com/linux/fedora/docker-ce.repo
|
||||||
|
when: (ansible_distribution in ['Fedora'])
|
||||||
|
|
||||||
|
- name: Install docker using nobest option
|
||||||
|
dnf:
|
||||||
|
name: docker-ce
|
||||||
|
state: present
|
||||||
|
nobest: true
|
||||||
|
register: dnf_result
|
||||||
|
|
||||||
|
- name: Verify installation of docker-ce
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- not dnf_result is failed
|
||||||
|
|
||||||
|
- name: Cleanup packages
|
||||||
|
dnf:
|
||||||
|
name: docker-ce, dnf-plugins-core
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Cleanup manually added repos
|
||||||
|
file:
|
||||||
|
name: "/etc/yum.repos.d/docker-ce.repo"
|
||||||
|
state: absent
|
Loading…
Reference in New Issue