From b9fc6a9e8bfb329623140e439d2bc396d2d9d592 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Fri, 24 Jul 2026 15:01:05 +0200 Subject: [PATCH] ansible lint fixes --- ansible/playbooks/bootstrap.yaml | 44 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/ansible/playbooks/bootstrap.yaml b/ansible/playbooks/bootstrap.yaml index 706ab17..41471e8 100644 --- a/ansible/playbooks/bootstrap.yaml +++ b/ansible/playbooks/bootstrap.yaml @@ -1,35 +1,36 @@ -- hosts: all - become: yes - #debugger: on_failed +--- +- name: Bootstrap node + hosts: all + become: true tasks: - name: Add the ansible group - group: + ansible.builtin.group: name: ansible - gid: 1100 + gid: "1100" state: present - name: Add the ansible user as a system user - user: + ansible.builtin.user: name: ansible - uid: 1100 + uid: "1100" group: ansible - # Directly generate hash + # Directly generate hash # https://www.lisenet.com/2019/ansible-generate-crypted-passwords-for-the-user-module/ password: "{{ ansible_crypted_password | password_hash('sha512') }}" shell: /bin/bash # Uncomment to prevent password reset update_password: on_create - system: yes + system: true home: /home/ansible state: present - name: Set ansible user as sudoer - copy: + ansible.builtin.copy: content: "ansible ALL = (ALL) NOPASSWD:ALL" dest: /etc/sudoers.d/ansible owner: root group: root - mode: 0440 + mode: "0440" - name: Init cache directory @@ -49,22 +50,21 @@ mode: u=rwx,g=rw,o=r -# Inserts public keys of allowed externals users to log in as ansible +# Inserts public keys of allowed externals users to log in as ansible # e.g. fabio - name: Create the .ssh directory - file: - path: /home/ansible/.ssh + ansible.builtin.file: + path: /home/ansible/.ssh owner: ansible group: ansible - mode: 0700 + mode: "0700" state: directory - name: Add the mandatory ssh keys to the ansible user - template: - src: templates/ansible_auth_keys.j2 - dest: /home/ansible/.ssh/authorized_keys - owner: ansible - group: ansible - mode: 0600 - + ansible.builtin.template: + src: templates/ansible_auth_keys.j2 + dest: /home/ansible/.ssh/authorized_keys + owner: ansible + group: ansible + mode: "0600"