From ec8e965ac2d4033d9f16ca7c6bb05a796d967443 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de>
Date: Mon, 11 Mar 2024 14:44:39 +0100
Subject: [PATCH] style: satisfy linter

---
 .ansible-lint                 | 2 ++
 handlers/main.yml             | 1 +
 meta/main.yml                 | 5 ++++-
 site.yml                      | 4 ++--
 tasks/configure_ssh_keys.yml  | 2 +-
 tasks/create_users_groups.yml | 2 +-
 6 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/.ansible-lint b/.ansible-lint
index f18a647..586894d 100644
--- a/.ansible-lint
+++ b/.ansible-lint
@@ -37,6 +37,8 @@ use_default_rules: true
 skip_list:
   - skip_this_tag
   - git-latest
+  - package-latest
+  - name[casing]
 
 # Any rule that has the 'opt-in' tag will not be loaded unless its 'id' is
 # mentioned in the enable_list:
diff --git a/handlers/main.yml b/handlers/main.yml
index 5dc8e1e..1868ad0 100644
--- a/handlers/main.yml
+++ b/handlers/main.yml
@@ -17,6 +17,7 @@
 - name: save iptables rules
   ansible.builtin.command: "netfilter-persistent save"
   listen: "save iptables rules"
+  changed_when: false
 
 - name: restart sshd
   ansible.builtin.systemd:
diff --git a/meta/main.yml b/meta/main.yml
index 09e290e..cc7fb62 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -3,6 +3,8 @@ galaxy_info:
   author: Jörg Sachse (<Joerg.Sachse@slub-dresden.de>)
   company: SLUB Dresden
   description: role to install reporting server for the SLUBarchiv digital preservation repository
+  role_name: "ansible_lza_reporting"
+  namespace: "slub"
   galaxy_tags: []
     # List tags for your role here, one per line. A tag is a keyword that describes and categorizes the role. Users find roles by searching for tags. Be sure to remove the '[]' above, if you
     # add tags to this list.
@@ -14,7 +16,7 @@ galaxy_info:
   license: GPLv3
     # Some suggested licenses: - BSD
     # (default) - MIT - GPLv2 - GPLv3 - Apache - CC-BY
-  min_ansible_version: "2.5"
+  min_ansible_version: "2.10"
     # If this a Container Enabled role, provide the minimum Ansible Container version. min_ansible_container_version: Optionally specify the branch Galaxy will use when accessing the GitHub repo
     # for this role. During role install, if no tags are available, Galaxy will use this branch. During import Galaxy will access files on this branch. If Travis integration is configured, only
     # notifications for this branch will be accepted. Otherwise, in all cases, the repo's default branch (usually master) will be used. github_branch:
@@ -28,4 +30,5 @@ galaxy_info:
       versions:
         - "buster"
         - "bullseye"
+        - "bookworm"
 dependencies: []
diff --git a/site.yml b/site.yml
index de89a0d..18e0d96 100644
--- a/site.yml
+++ b/site.yml
@@ -3,9 +3,9 @@
   pre_tasks:
     - name: Verify that the installed version of Ansible meets this playbook's version requirements.
       assert:
-        that: "ansible_version.full is version_compare('2.8', '>=')"
+        that: "ansible_version.full is version_compare('2.10', '>=')"
         msg: >
-          "You must update Ansible to at least 2.8 to use this playbook."
+          "You must update Ansible to at least 2.10 to use this playbook."
   # Collect facts from remote system? Possible values: true, false
   gather_facts: true
   # Gather only certain subsects of facts. Ansible supports network, hardware, virtual, facter, ohai as subset.
diff --git a/tasks/configure_ssh_keys.yml b/tasks/configure_ssh_keys.yml
index 024fdfe..aeb2d64 100644
--- a/tasks/configure_ssh_keys.yml
+++ b/tasks/configure_ssh_keys.yml
@@ -1,7 +1,7 @@
 ---
 # für User "zih" (benötigt für Zugriff auf SFTP-Server)
 - name: SSH-Keys für Public-Key Authentication einspielen (ZIH)
-  ansible.builtin.authorized_key:
+  ansible.posix.authorized_key:
     user: "{{ item.user }}"
     comment: "{{ item.comment }}"
     key: "{{ item.key }}"
diff --git a/tasks/create_users_groups.yml b/tasks/create_users_groups.yml
index 51c5857..a421a8c 100644
--- a/tasks/create_users_groups.yml
+++ b/tasks/create_users_groups.yml
@@ -29,7 +29,7 @@
 - name: create users
   ansible.builtin.user:
     comment: "{{ item.value.comment | default(omit) }}"
-    create_home: "{{ item.value.create_home | default ('yes') }}"
+    create_home: "{{ item.value.create_home | default(true) }}"
     generate_ssh_key: "{{ item.value.generate_ssh_key | default(omit) }}"
     group: "{{ item.key | default(omit) }}"
     groups: "{{ item.value.groups | default(omit) }}"
-- 
GitLab