Fix ansible-lint violations across host playbooks
Declare community.general so ansible-lint, which only installs
collections named in requirements.yml, can resolve the xml module.
Assisted-by: Claude Opus 4.8 via Claude Code
diff --git a/legacy-of-lunatic-kingdom/main.yml b/legacy-of-lunatic-kingdom/main.yml
index de6aa7d..c7abf92 100644
--- a/legacy-of-lunatic-kingdom/main.yml
+++ b/legacy-of-lunatic-kingdom/main.yml
@@ -4,7 +4,7 @@
tasks:
- name: Install basic packages
- apt:
+ ansible.builtin.apt:
pkg:
- git
- net-tools # ifconfig
@@ -15,16 +15,17 @@
update_cache: true
- name: Include /mnt in node-exporter
- lineinfile:
+ ansible.builtin.lineinfile:
path: /etc/default/prometheus-node-exporter
regexp: '^ARGS='
line: 'ARGS="--collector.filesystem.mount-points-exclude=^/(dev|proc|run|sys|media|var/lib/docker/.+|var/lib/containers/storage/.+)($|/)"'
- create: yes
+ create: true
+ mode: '0644'
notify: Restart node exporter
handlers:
- name: Restart node exporter
- systemd:
+ ansible.builtin.systemd:
name: prometheus-node-exporter
state: restarted
@@ -35,7 +36,7 @@
tasks:
- name: Disable SSH password logins
- lineinfile:
+ ansible.builtin.lineinfile:
path: /etc/ssh/sshd_config
regexp: '^(#\s*)?{{ item }} '
line: "{{ item }} no"
@@ -46,7 +47,7 @@
notify: Restart sshd
- name: Allow sudo without password
- lineinfile:
+ ansible.builtin.lineinfile:
path: /etc/sudoers
regexp: '^%sudo'
line: '%sudo ALL=(ALL:ALL) NOPASSWD:ALL'
@@ -54,7 +55,7 @@
handlers:
- name: Restart sshd
- systemd:
+ ansible.builtin.systemd:
name: sshd
state: restarted
diff --git a/playbooks/docker.yml b/playbooks/docker.yml
index 206ab99..7cbc9ac 100644
--- a/playbooks/docker.yml
+++ b/playbooks/docker.yml
@@ -30,7 +30,9 @@
register: dpkg_arch
changed_when: false
- # echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+ # echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
+ # https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
+ # | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
- name: Add Docker repository
ansible.builtin.apt_repository:
repo: >-
diff --git a/playbooks/syncthing.yml b/playbooks/syncthing.yml
index b0dba46..a592fa0 100644
--- a/playbooks/syncthing.yml
+++ b/playbooks/syncthing.yml
@@ -26,7 +26,9 @@
dest: /etc/apt/keyrings/syncthing-archive-keyring.gpg
mode: '0644'
- # echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable-v2" | sudo tee /etc/apt/sources.list.d/syncthing.list
+ # echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] \
+ # https://apt.syncthing.net/ syncthing stable-v2" \
+ # | sudo tee /etc/apt/sources.list.d/syncthing.list
- name: Add Syncthing repository
ansible.builtin.apt_repository:
repo: deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable-v2
@@ -74,7 +76,7 @@
value: "{{ item.value }}"
attribute: "{{ item.attribute | default(omit) }}"
backup: true
- notify: restart syncthing
+ notify: Restart syncthing
loop:
- { key: "gui/address", value: "0.0.0.0:8384" }
- { key: "gui/user", value: "{{ syncthing.user }}" }
@@ -84,7 +86,7 @@
- { key: "defaults/folder/minDiskFree", attribute: "unit", value: "%" }
handlers:
- - name: restart syncthing
+ - name: Restart syncthing
ansible.builtin.systemd:
name: syncthing@syncthing.service
state: restarted
diff --git a/playbooks/tailscale.yml b/playbooks/tailscale.yml
index d4b83e9..9f786d7 100644
--- a/playbooks/tailscale.yml
+++ b/playbooks/tailscale.yml
@@ -21,7 +21,9 @@
# curl -fsSL https://pkgs.tailscale.com/stable/debian/bookworm.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
- name: Add Tailscale repository
ansible.builtin.apt_repository:
- repo: deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg] https://pkgs.tailscale.com/stable/debian {{ ansible_facts["distribution_release"] }} main
+ repo: >-
+ deb [signed-by=/usr/share/keyrings/tailscale-archive-keyring.gpg]
+ https://pkgs.tailscale.com/stable/debian {{ ansible_facts["distribution_release"] }} main
filename: tailscale
state: present
diff --git a/requirements.yml b/requirements.yml
index 0a39656..310417d 100644
--- a/requirements.yml
+++ b/requirements.yml
@@ -1,2 +1,3 @@
collections:
+ - name: community.general
- name: community.sops