From 2c138c9149af28380cc3684852bedc64ed6ad05f Mon Sep 17 00:00:00 2001 From: Romain Pelisse Date: Wed, 14 Feb 2024 15:46:19 +0100 Subject: [PATCH] Retrieve HERA_USERNAME to set ssh username --- roles/eris_hera_create/defaults/main.yml | 1 + roles/eris_hera_create/tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/eris_hera_create/defaults/main.yml b/roles/eris_hera_create/defaults/main.yml index 18cf6e9..df8805d 100644 --- a/roles/eris_hera_create/defaults/main.yml +++ b/roles/eris_hera_create/defaults/main.yml @@ -2,6 +2,7 @@ hera_home: "{{ lookup('env', 'HERA_HOME') }}" hera_debug: "{{ lookup('env', 'HERA_DEBUG') | default(False) }}" podman_image: "{{ lookup('ansible.builtin.env', 'HERA_MOLECULE_SLAVE_IMAGE') | default('podman_image', 'localhost/molecule-slave-9') }}" +hera_ssh_username: "{{ lookup('ansible.builtin.env', 'HERA_USERNAME') | default('jenkins', 'jenkins') }}" hera_molecule_slave_sshd_port: "{{ lookup('env', 'BUILD_MOLECULE_SLAVE_SSHD_PORT') | default('undefined') }}" workdir: "{{ lookup('env', 'WORKDIR') }}" job_name: "{{ lookup('env', 'JOB_NAME') | default('ansible') }}-slave" diff --git a/roles/eris_hera_create/tasks/main.yml b/roles/eris_hera_create/tasks/main.yml index 7bbe9e5..bfe5ca3 100644 --- a/roles/eris_hera_create/tasks/main.yml +++ b/roles/eris_hera_create/tasks/main.yml @@ -63,7 +63,7 @@ - name: "Set hera_created_instances" ansible.builtin.set_fact: hera_created_instances: - - { address: 'olympus', user: 'root', port: "{{ hera_molecule_slave_sshd_port }}", identity_file: '/var/jenkins_home/.ssh/id_rsa' } + - { address: 'olympus', user: "{{ hera_ssh_username }}", port: "{{ hera_molecule_slave_sshd_port }}", identity_file: '/var/jenkins_home/.ssh/id_rsa' } - name: "Display hera run stdout" ansible.builtin.debug: