9d2982549d
* 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 number
34 lines
924 B
YAML
34 lines
924 B
YAML
- 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
|