feat(ci): comply with linter

This commit is contained in:
Simon Cornet 2025-03-31 18:24:43 +02:00
commit 80292a63a9
12 changed files with 23 additions and 45 deletions

View file

@ -2,6 +2,7 @@
# apt cleanup # apt cleanup
- name: "apt cleanup" - name: "apt cleanup"
tags: "apt-cleanup"
block: block:
# clean apt cache # clean apt cache
@ -18,5 +19,3 @@
changed_when: false changed_when: false
failed_when: false failed_when: false
when: 'type == "vm"' when: 'type == "vm"'
tags: "apt-cleanup"

View file

@ -2,6 +2,7 @@
# apt config # apt config
- name: "apt config" - name: "apt config"
tags: ["apt"]
block: block:
# configure apt auto update # configure apt auto update
@ -22,6 +23,3 @@
group: "root" group: "root"
mode: "0644" mode: "0644"
when: 'ansible_os_family == "Debian"' when: 'ansible_os_family == "Debian"'
tags:
- "apt"

View file

@ -2,6 +2,7 @@
# apt packages # apt packages
- name: "apt packages" - name: "apt packages"
tags: ["apt"]
block: block:
# install packages # install packages
@ -25,6 +26,3 @@
loop: "{{ apt_default_packages_delete }}" loop: "{{ apt_default_packages_delete }}"
loop_control: loop_control:
loop_var: "apt_default_delete" loop_var: "apt_default_delete"
tags:
- "apt"

View file

@ -2,6 +2,7 @@
# manage apt sources # manage apt sources
- name: "manage apt sources" - name: "manage apt sources"
tags: ["apt"]
block: block:
# configure apt sources # configure apt sources
@ -38,6 +39,3 @@
when: when:
- 'ansible_distribution == "Ubuntu"' - 'ansible_distribution == "Ubuntu"'
- 'ansible_distribution_major_version >= "24"' - 'ansible_distribution_major_version >= "24"'
tags:
- "apt"

View file

@ -2,6 +2,7 @@
# basic firewall rules # basic firewall rules
- name: "basic firewall rules" - name: "basic firewall rules"
tags: ["firewall"]
block: block:
# basic firewall rules # basic firewall rules
@ -24,6 +25,3 @@
with_nested: with_nested:
- "{{ __rule['source_nets'] }}" - "{{ __rule['source_nets'] }}"
- "{{ __rule['destination_nets'] }}" - "{{ __rule['destination_nets'] }}"
tags:
- "firewall"

View file

@ -2,17 +2,6 @@
# import ossupport and load variables # import ossupport and load variables
- name: "import ossupport and load variables" - name: "import ossupport and load variables"
block:
# check os support
- name: "check for os support"
ansible.builtin.import_tasks: "ossupport.yaml"
# load os variables
- name: "include os specific vars"
ansible.builtin.include_vars: "{{ ansible_os_family }}.yaml"
when: "os_support"
tags: tags:
- "apt" - "apt"
- "apt-cleanup" - "apt-cleanup"
@ -34,6 +23,17 @@
- "syslog" - "syslog"
- "timezone" - "timezone"
- "usermanagement" - "usermanagement"
block:
# check os support
- name: "check for os support"
ansible.builtin.import_tasks: "ossupport.yaml"
# load os variables
- name: "include os specific vars"
ansible.builtin.include_vars: "{{ ansible_os_family }}.yaml"
when: "os_support"
# set hostname # set hostname
- name: "set hostname" - name: "set hostname"

View file

@ -1,6 +1,7 @@
--- ---
- name: "manage motd" - name: "manage motd"
tags: ["motd"]
block: block:
# find old motd files # find old motd files
@ -36,6 +37,3 @@
group: "root" group: "root"
mode: "0755" mode: "0755"
when: 'ansible_os_family == "Debian"' when: 'ansible_os_family == "Debian"'
tags:
- "motd"

View file

@ -1,6 +1,7 @@
--- ---
- name: "manage ntp" - name: "manage ntp"
tags: ["ntp"]
block: block:
# install chrony # install chrony
@ -20,6 +21,3 @@
mode: "0644" mode: "0644"
when: 'ansible_os_family == "Debian"' when: 'ansible_os_family == "Debian"'
notify: "restart chrony" notify: "restart chrony"
tags:
- "ntp"

View file

@ -2,8 +2,8 @@
# manage snapd # manage snapd
- name: "manage snapd" - name: "manage snapd"
tags: ["snap"]
block: block:
# set defaults # set defaults
- name: "set facts" - name: "set facts"
ansible.builtin.set_fact: ansible.builtin.set_fact:
@ -32,6 +32,3 @@
state: "started" state: "started"
enabled: true enabled: true
when: "__snapd_service" when: "__snapd_service"
tags:
- "snap"

View file

@ -2,6 +2,7 @@
# manage swap # manage swap
- name: "manage swap" - name: "manage swap"
tags: ["swap"]
block: block:
# enable or disable swap # enable or disable swap
@ -76,6 +77,3 @@
dump: "0" dump: "0"
state: "absent" state: "absent"
when: "not __swap" when: "not __swap"
tags:
- "swap"

View file

@ -2,6 +2,7 @@
# manage syslog # manage syslog
- name: "manage syslog" - name: "manage syslog"
tags: ["syslog"]
block: block:
# configure rsyslogd - debian # configure rsyslogd - debian
@ -47,6 +48,3 @@
mode: "0644" mode: "0644"
when: 'ansible_os_family == "Debian"' when: 'ansible_os_family == "Debian"'
notify: "restart rsyslog" notify: "restart rsyslog"
tags:
- "syslog"

View file

@ -2,6 +2,7 @@
# manage users # manage users
- name: "manage users" - name: "manage users"
tags: ["usermanagement"]
block: block:
# manage facts # manage facts
@ -69,6 +70,3 @@
path: "/etc/sudoers.d/{{ __user['username'] }}" path: "/etc/sudoers.d/{{ __user['username'] }}"
when: when:
- "not sudo_file" - "not sudo_file"
tags:
- "usermanagement"