changed defaults to be non-breaking, removed allow_downgrade for now
This commit is contained in:
parent
699c0ca584
commit
a3a3d5675b
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
# defaults file for manage_apt_packages
|
# defaults file for manage_apt_packages
|
||||||
manage_apt_packages_list:
|
manage_apt_packages_list:
|
||||||
- name: nginx
|
- name: vim
|
||||||
version: latest
|
version: latest
|
||||||
state: absent
|
state: present
|
||||||
|
@ -9,8 +9,6 @@ def test_hosts_file(host):
|
|||||||
assert etc_hosts.group == "root"
|
assert etc_hosts.group == "root"
|
||||||
|
|
||||||
def test_packages_not_installed(host):
|
def test_packages_not_installed(host):
|
||||||
"""Validate nginx and apache2 are not installed"""
|
"""Validate vim is installed"""
|
||||||
apt_package_nginx = host.package("nginx")
|
apt_package_vim = host.package("vim")
|
||||||
apt_package_apache2 = host.package("apache2")
|
assert apt_package_vim.is_installed
|
||||||
assert not apt_package_nginx.is_installed
|
|
||||||
assert not apt_package_apache2.is_installed
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ item.name }}{% if item.version not in [None, '', 'latest'] %}={{ item.version }}{% endif %}"
|
name: "{{ item.name }}{% if item.version not in [None, '', 'latest'] %}={{ item.version }}{% endif %}"
|
||||||
state: "{{ item.state }}"
|
state: "{{ item.state }}"
|
||||||
allow_downgrade:
|
|
||||||
loop: "{{ manage_apt_packages_list }}"
|
loop: "{{ manage_apt_packages_list }}"
|
||||||
when: manage_apt_packages_list is defined
|
when: manage_apt_packages_list is defined
|
||||||
and manage_apt_packages_list not in [None, '']
|
and manage_apt_packages_list not in [None, '']
|
||||||
|
Loading…
Reference in New Issue
Block a user