From f82c4666c9a8729c12c262d32d7afc363149da1a Mon Sep 17 00:00:00 2001 From: Douglas Mendizabal Date: Thu, 15 May 2025 11:40:39 -0400 Subject: [PATCH] Add hsmusers group before client installation This patch moves the creation of the hsmusers group so that it happens before the Luna client software is installed. This will ensure that the installer re-uses the GID we want instead of choosing an arbitrary value. Change-Id: I7652c12aceb39a07e57ceb975d5f2b8e38f780b8 --- tasks/main.yaml | 12 ++++++++++++ tasks/register_client.yaml | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tasks/main.yaml b/tasks/main.yaml index c541faa..a180e4b 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -5,6 +5,18 @@ state: directory mode: '755' +- name: Create hsmusers group + ansible.builtin.group: + name: hsmusers + gid: "{{ lunasa_group_id }}" + +- name: Create hsmusers user + ansible.builtin.user: + name: hsmusers + uid: "{{ lunasa_user_id }}" + group: "{{ lunasa_group_id }}" + create_home: false + - name: Download Lunasa client tarball ansible.builtin.get_url: url: "{{ lunasa_client_tarball_location }}" diff --git a/tasks/register_client.yaml b/tasks/register_client.yaml index 7b00f85..bc62f96 100644 --- a/tasks/register_client.yaml +++ b/tasks/register_client.yaml @@ -3,18 +3,6 @@ ansible.builtin.debug: msg: "Registering client: {{ client_name }} [host: {{ client_host }}, CN: {{ client_cert_cn }}] with HSM: {{ hsm_hostname }}" -- name: Create hsmusers group - ansible.builtin.group: - name: hsmusers - gid: "{{ lunasa_group_id }}" - -- name: Create hsmusers user - ansible.builtin.user: - name: hsmusers - uid: "{{ lunasa_user_id }}" - group: "{{ lunasa_group_id }}" - create_home: false - - name: Get the hsm server cert from the hsm_server ansible.builtin.shell: > sshpass -p '{{ hsm_admin_password }}'