homeserver/roles/mgrote.apt_manage_packages/tasks/main.yml

34 lines
832 B
YAML
Raw Normal View History

---
2020-08-18 11:57:53 +02:00
- name: install common-packages
become: yes
ansible.builtin.package:
name: "{{ apt_packages_common }}"
2020-08-18 11:57:53 +02:00
state: present
- name: install extra-packages
become: yes
ansible.builtin.package:
name: "{{ apt_packages_extra }}"
state: present
when: apt_packages_extra is defined
2020-08-18 11:57:53 +02:00
- name: install vm-packages
become: yes
ansible.builtin.package:
name: "{{ apt_packages_vm }}"
2020-08-18 11:57:53 +02:00
state: present
when: ansible_virtualization_role == 'guest'
- name: install physical-packages
become: yes
ansible.builtin.package:
name: "{{ apt_packages_physical }}"
2020-08-18 11:57:53 +02:00
state: present
when: ansible_virtualization_role != 'guest'
- name: remove packages
become: yes
ansible.builtin.package:
name: "{{ apt_packages_absent }}"
state: absent