chore: cleanup tag mess
All checks were successful
ci/woodpecker/push/linting Pipeline was successful

Tag only in main.yaml, tasks inherit them.
This commit is contained in:
Simon Cornet 2026-05-20 09:40:02 +02:00
commit 210fbd68f4
26 changed files with 14 additions and 33 deletions

View file

@ -2,7 +2,6 @@
# apt cleanup # apt cleanup
- name: "apt cleanup" - name: "apt cleanup"
tags: "apt-cleanup"
block: block:
# clean apt cache # clean apt cache

View file

@ -2,7 +2,6 @@
# apt config # apt config
- name: "apt config" - name: "apt config"
tags: "apt"
block: block:
# configure apt auto update # configure apt auto update

View file

@ -2,7 +2,6 @@
# apt packages # apt packages
- name: "apt packages" - name: "apt packages"
tags: "apt"
block: block:
# install packages # install packages

View file

@ -2,7 +2,6 @@
# manage apt sources # manage apt sources
- name: "manage apt sources" - name: "manage apt sources"
tags: "apt"
block: block:
# configure legacy apt sources # configure legacy apt sources

View file

@ -2,7 +2,6 @@
# apt update # apt update
- name: "apt update" - name: "apt update"
tags: "apt-update"
when: 'ansible_facts["os_family"] == "Debian"' when: 'ansible_facts["os_family"] == "Debian"'
block: block:

View file

@ -11,7 +11,6 @@
when: when:
- "ansible_facts['os_family'] == 'Debian'" - "ansible_facts['os_family'] == 'Debian'"
- "ansible_facts['virtualization_type'] == 'lxc'" - "ansible_facts['virtualization_type'] == 'lxc'"
tags: "cron"
# configure cron # configure cron
- name: "cron - config - alpine" - name: "cron - config - alpine"
@ -22,4 +21,3 @@
group: "root" group: "root"
mode: "0600" mode: "0600"
when: 'ansible_facts["os_family"] == "Alpine"' when: 'ansible_facts["os_family"] == "Alpine"'
tags: "cron"

View file

@ -9,4 +9,3 @@
group: "root" group: "root"
mode: "0644" mode: "0644"
when: 'ansible_facts["distribution"] == "Ubuntu"' when: 'ansible_facts["distribution"] == "Ubuntu"'
tags: "environment-file"

View file

@ -2,7 +2,6 @@
# generic settings # generic settings
- name: "firewall - set default policy and enable logging" - name: "firewall - set default policy and enable logging"
tags: "firewall"
block: block:
# set vars # set vars

View file

@ -5,7 +5,6 @@
ansible.builtin.hostname: ansible.builtin.hostname:
name: "{{ set_hostname | default(inventory_hostname_short) }}" name: "{{ set_hostname | default(inventory_hostname_short) }}"
use: "{{ hostname_use_method }}" use: "{{ hostname_use_method }}"
tags: "hostname"
# manage /etc/hosts # manage /etc/hosts
- name: "manage /etc/hosts file for hostname" - name: "manage /etc/hosts file for hostname"
@ -14,6 +13,4 @@
regexp: '^{{ ansible_facts["default_ipv4"].address }}\s+.*{{ inventory_hostname_short }}.*$' regexp: '^{{ ansible_facts["default_ipv4"].address }}\s+.*{{ inventory_hostname_short }}.*$'
line: "{{ ansible_facts['default_ipv4'].address }} {{ inventory_hostname }} {{ inventory_hostname_short }}" line: "{{ ansible_facts['default_ipv4'].address }} {{ inventory_hostname }} {{ inventory_hostname_short }}"
backup: true backup: true
tags: tags: "hostfile"
- "hostfile"
- "hostname"

View file

@ -10,4 +10,3 @@
mode: "0644" mode: "0644"
when: 'ansible_facts["distribution"] == "Ubuntu"' when: 'ansible_facts["distribution"] == "Ubuntu"'
notify: "restart journald" notify: "restart journald"
tags: "journald"

View file

@ -8,4 +8,3 @@
cache_valid_time: 3600 cache_valid_time: 3600
when: 'ansible_facts["os_family"] == "Debian"' when: 'ansible_facts["os_family"] == "Debian"'
notify: "restart lldpd" notify: "restart lldpd"
tags: "lldp"

View file

@ -5,4 +5,3 @@
community.general.locale_gen: community.general.locale_gen:
name: "en_US.UTF-8" name: "en_US.UTF-8"
state: "present" state: "present"
tags: "locale"

View file

@ -7,4 +7,3 @@
state: "absent" state: "absent"
purge: true purge: true
when: 'ansible_facts["os_family"] == "Debian"' when: 'ansible_facts["os_family"] == "Debian"'
tags: "lxd"

View file

@ -105,13 +105,17 @@
# service # service
- name: "service" - name: "service"
ansible.builtin.include_tasks: "service.yaml" ansible.builtin.include_tasks:
file: "service.yaml"
apply:
tags: "service"
loop: "{{ service }}" loop: "{{ service }}"
loop_control: loop_control:
loop_var: "__service" loop_var: "__service"
when: when:
- "service is defined" - "service is defined"
- "ansible_facts['os_family'] == 'Debian'" - "ansible_facts['os_family'] == 'Debian'"
tags: "service"
# flush handler # flush handler
- name: "flush handlers" - name: "flush handlers"
@ -162,7 +166,10 @@
# systemctl # systemctl
- name: "sysctl - set systemctl" - name: "sysctl - set systemctl"
ansible.builtin.include_tasks: "systemctl.yaml" ansible.builtin.include_tasks:
file: "systemctl.yaml"
apply:
tags: "systemctl"
loop: "{{ systemctl }}" loop: "{{ systemctl }}"
loop_control: loop_control:
loop_var: "__systemctl" loop_var: "__systemctl"
@ -210,7 +217,10 @@
# user # user
- name: "user - create users" - name: "user - create users"
ansible.builtin.include_tasks: "user.yaml" ansible.builtin.include_tasks:
file: "user.yaml"
apply:
tags: "usermanagement"
loop: "{{ users }}" loop: "{{ users }}"
loop_control: loop_control:
loop_var: "__user" loop_var: "__user"

View file

@ -1,7 +1,6 @@
--- ---
- name: "manage motd" - name: "manage motd"
tags: "motd"
block: block:
# cleanup old motd debian # cleanup old motd debian

View file

@ -1,7 +1,6 @@
--- ---
- name: "manage ntp" - name: "manage ntp"
tags: "ntp"
block: block:
# install alpine # install alpine

View file

@ -2,7 +2,6 @@
# manage snapd # manage snapd
- name: "manage snapd" - name: "manage snapd"
tags: "snap"
block: block:
# set defaults # set defaults

View file

@ -9,4 +9,3 @@
loop: "{{ snap_package }}" loop: "{{ snap_package }}"
loop_control: loop_control:
loop_var: "__snap_package" loop_var: "__snap_package"
tags: "snap"

View file

@ -10,7 +10,6 @@
mode: "0644" mode: "0644"
notify: "restart ssh" notify: "restart ssh"
when: 'ansible_facts["os_family"] == "Debian"' when: 'ansible_facts["os_family"] == "Debian"'
tags: "sshd"
# configure sshd # configure sshd
- name: "config - sshd" - name: "config - sshd"
@ -22,4 +21,3 @@
mode: "0644" mode: "0644"
notify: "restart ssh alpine" notify: "restart ssh alpine"
when: 'ansible_facts["os_family"] == "Alpine"' when: 'ansible_facts["os_family"] == "Alpine"'
tags: "sshd"

View file

@ -2,7 +2,6 @@
# manage swap # manage swap
- name: "manage swap" - name: "manage swap"
tags: "swap"
block: block:
# enable or disable swap # enable or disable swap

View file

@ -9,4 +9,3 @@
loop: "{{ sysctl }}" loop: "{{ sysctl }}"
loop_control: loop_control:
loop_var: "__sysctl" loop_var: "__sysctl"
tags: "sysctl"

View file

@ -2,7 +2,6 @@
# manage syslog # manage syslog
- name: "manage syslog" - name: "manage syslog"
tags: "syslog"
block: block:
# configure syslog - alpine # configure syslog - alpine

View file

@ -7,4 +7,3 @@
state: "present" state: "present"
cache_valid_time: 3600 cache_valid_time: 3600
when: 'ansible_facts["os_family"] == "Debian"' when: 'ansible_facts["os_family"] == "Debian"'
tags: "syslog"

View file

@ -10,4 +10,3 @@
mode: "0644" mode: "0644"
when: 'ansible_facts["os_family"] == "Debian"' when: 'ansible_facts["os_family"] == "Debian"'
notify: "daemon-reload fstrim.timer" notify: "daemon-reload fstrim.timer"
tags: "systemctl"

View file

@ -6,4 +6,3 @@
path: "/etc/cron.daily/popularity-contest" path: "/etc/cron.daily/popularity-contest"
state: "absent" state: "absent"
when: 'ansible_facts["distribution"] == "Ubuntu"' when: 'ansible_facts["distribution"] == "Ubuntu"'
tags: "telemetry"

View file

@ -4,4 +4,3 @@
- name: "timezone - set {{ timezone }}" - name: "timezone - set {{ timezone }}"
community.general.timezone: community.general.timezone:
name: "{{ timezone }}" name: "{{ timezone }}"
tags: "timezone"