From 5e6b7ab7ba399df36a0b0349d4c547d1dd4dd01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavi=20Lle=C3=B3=20Tom=C3=A1s?= Date: Thu, 17 Oct 2024 16:38:52 +0200 Subject: [PATCH] Refs #8025: Role debian-base. Change vn_no_witness for vn_fisrt_time --- roles/debian-base/defaults/main.yaml | 2 +- roles/debian-base/tasks/root.yml | 2 +- roles/debian-base/tasks/ssh.yml | 2 +- roles/debian-base/tasks/witness.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/debian-base/defaults/main.yaml b/roles/debian-base/defaults/main.yaml index e20ded9..82bcf2a 100644 --- a/roles/debian-base/defaults/main.yaml +++ b/roles/debian-base/defaults/main.yaml @@ -1,4 +1,4 @@ -vn_no_witness: false +vn_first_time: false default_user: user fail2ban: email: "{{ sysadmin_mail }}" diff --git a/roles/debian-base/tasks/root.yml b/roles/debian-base/tasks/root.yml index 96d504c..a1d4449 100644 --- a/roles/debian-base/tasks/root.yml +++ b/roles/debian-base/tasks/root.yml @@ -1,5 +1,5 @@ - name: Generate root password - when: vn_no_witness + when: vn_first_time block: - name: Search root password into Passbolt set_fact: diff --git a/roles/debian-base/tasks/ssh.yml b/roles/debian-base/tasks/ssh.yml index 33a3a34..943c79e 100644 --- a/roles/debian-base/tasks/ssh.yml +++ b/roles/debian-base/tasks/ssh.yml @@ -3,7 +3,7 @@ path: "/etc/ssh/ssh_host_{{ item.type }}_key" type: "{{ item.type }}" force: yes - when: vn_no_witness + when: vn_first_time loop: - { type: 'rsa' } - { type: 'ecdsa' } diff --git a/roles/debian-base/tasks/witness.yml b/roles/debian-base/tasks/witness.yml index ebeaddf..b5e5dae 100644 --- a/roles/debian-base/tasks/witness.yml +++ b/roles/debian-base/tasks/witness.yml @@ -4,9 +4,9 @@ register: keys_generated_marker - name: Generate variable if not exists set_fact: - vn_no_witness: "{{ not keys_generated_marker.stat.exists }}" + vn_first_time: "{{ not keys_generated_marker.stat.exists }}" - name: Create marker file to indicate vn happends file: path: /etc/vn.witness state: touch - when: vn_no_witness + when: vn_first_time