Change to FQCN with ansible-lint fixer (#553)

* Change to FQCN with ansible-lint fixer

Since ansible-base 2.10 (later ansible-core), FQCN is the new way to go.

Updated .ansible-lint with a production profile and removed fqcn in skip_list.
Updated .yamllint with rules needed.

Ran ansible-lint --fix=all, then manually applied some minor changes.

* Changed octal value in molecule/ipv6/prepare.yml
This commit is contained in:
Richard Holmboe
2024-08-13 05:59:59 +02:00
committed by GitHub
parent 635f0b21b3
commit b077a49e1f
49 changed files with 317 additions and 317 deletions

View File

@@ -1,46 +1,45 @@
---
- name: Check for container files that exist on this host
stat:
path: "/etc/pve/lxc/{{ item }}.conf"
ansible.builtin.stat:
path: /etc/pve/lxc/{{ item }}.conf
loop: "{{ proxmox_lxc_ct_ids }}"
register: stat_results
- name: Filter out files that do not exist
set_fact:
proxmox_lxc_filtered_files:
'{{ stat_results.results | rejectattr("stat.exists", "false") | map(attribute="stat.path") }}'
ansible.builtin.set_fact:
proxmox_lxc_filtered_files: '{{ stat_results.results | rejectattr("stat.exists", "false") | map(attribute="stat.path") }}' # noqa yaml[line-length]
- name: Remove LXC apparmor profile
lineinfile:
ansible.builtin.lineinfile:
dest: "{{ item }}"
regexp: "^lxc.apparmor.profile"
regexp: ^lxc.apparmor.profile
line: "lxc.apparmor.profile: unconfined"
state: absent
loop: "{{ proxmox_lxc_filtered_files }}"
notify: reboot containers
- name: Remove lxc cgroups
lineinfile:
ansible.builtin.lineinfile:
dest: "{{ item }}"
regexp: "^lxc.cgroup.devices.allow"
regexp: ^lxc.cgroup.devices.allow
line: "lxc.cgroup.devices.allow: a"
state: absent
loop: "{{ proxmox_lxc_filtered_files }}"
notify: reboot containers
- name: Remove lxc cap drop
lineinfile:
ansible.builtin.lineinfile:
dest: "{{ item }}"
regexp: "^lxc.cap.drop"
regexp: ^lxc.cap.drop
line: "lxc.cap.drop: "
state: absent
loop: "{{ proxmox_lxc_filtered_files }}"
notify: reboot containers
- name: Remove lxc mounts
lineinfile:
ansible.builtin.lineinfile:
dest: "{{ item }}"
regexp: "^lxc.mount.auto"
regexp: ^lxc.mount.auto
line: 'lxc.mount.auto: "proc:rw sys:rw"'
state: absent
loop: "{{ proxmox_lxc_filtered_files }}"