Michael Grote
7a24089031
Reviewed-on: #584 Co-authored-by: Michael Grote <michael.grote@posteo.de> Co-committed-by: Michael Grote <michael.grote@posteo.de>
24 lines
838 B
YAML
24 lines
838 B
YAML
---
|
|
- name: set apparmor profile
|
|
become: true
|
|
ansible.builtin.lineinfile:
|
|
path: "/etc/pve/lxc/{{ item.vmid }}.conf"
|
|
line: "lxc.apparmor.profile: {{ item.apparmor_profile }}"
|
|
state: present
|
|
register: restart
|
|
|
|
# schreibe vm id in die Liste "reboot"
|
|
- name: set reboot list # noqa no-handler var-naming[pattern]
|
|
become: true
|
|
ansible.builtin.set_fact:
|
|
ansible.builtin.reboot:
|
|
- "{{ item.vmid }}"
|
|
when: restart.changed
|
|
|
|
# Füge die leere Liste "lists_merged" aus den defaults, mit der Liste "reboot" zusammen. Nur wenn auch etwas geändert wurde, daher "when:..."
|
|
- name: merge reboot lists # noqa no-handler
|
|
become: true
|
|
ansible.builtin.set_fact:
|
|
lists_merged: "{{ lists_merged + reboot }}"
|
|
when: restart.changed
|
|
# https://blog.crisp.se/2016/10/20/maxwenzin/how-to-append-to-lists-in-ansible
|