From a7c98b40f47db71dbf21a5f2257588ae19b8e223 Mon Sep 17 00:00:00 2001 From: Archana Singh Date: Mon, 29 Jul 2024 17:32:20 +0530 Subject: [PATCH 1/6] Add the openstack user variable in development_environment role --- tests/roles/development_environment/defaults/main.yaml | 1 + tests/roles/development_environment/tasks/main.yaml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/roles/development_environment/defaults/main.yaml b/tests/roles/development_environment/defaults/main.yaml index 3775bce01..c616deadc 100644 --- a/tests/roles/development_environment/defaults/main.yaml +++ b/tests/roles/development_environment/defaults/main.yaml @@ -3,3 +3,4 @@ prelaunch_test_instance_script: pre_launch.bash edpm_privatekey_path: ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa run_pre_adoption_validation: true os_cloud_name: standalone +os_user: root diff --git a/tests/roles/development_environment/tasks/main.yaml b/tests/roles/development_environment/tasks/main.yaml index f293f5dff..610ae3852 100644 --- a/tests/roles/development_environment/tasks/main.yaml +++ b/tests/roles/development_environment/tasks/main.yaml @@ -33,10 +33,11 @@ EDPM_PRIVATEKEY_PATH: "{{ edpm_privatekey_path }}" OS_CLOUD_IP: "{{ standalone_ip | default(edpm_node_ip) }}" OS_CLOUD_NAME: "{{ os_cloud_name }}" + OS_USER: "{{ os_user }}" ansible.builtin.shell: cmd: | {{ shell_header }} - alias openstack="ssh -i {{ edpm_privatekey_path }} root@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" + alias openstack="ssh -i {{ edpm_privatekey_path }} ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" ${BASH_ALIASES[openstack]} token issue -f value -c id register: before_adoption_token From 1fefdfc41f2b361d0af89e4ec2114d2abb380c0e Mon Sep 17 00:00:00 2001 From: Archana Singh Date: Mon, 29 Jul 2024 18:16:13 +0530 Subject: [PATCH 2/6] Use controller1_ssh variable for accessing the controller node --- tests/roles/development_environment/tasks/main.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/roles/development_environment/tasks/main.yaml b/tests/roles/development_environment/tasks/main.yaml index 610ae3852..b089ce317 100644 --- a/tests/roles/development_environment/tasks/main.yaml +++ b/tests/roles/development_environment/tasks/main.yaml @@ -30,14 +30,12 @@ no_log: "{{ use_no_log }}" environment: INSTALL_YAMLS_PATH: "{{ install_yamls_path }}" - EDPM_PRIVATEKEY_PATH: "{{ edpm_privatekey_path }}" - OS_CLOUD_IP: "{{ standalone_ip | default(edpm_node_ip) }}" + CONTROLLER1_SSH="{{ controller1_ssh }}" OS_CLOUD_NAME: "{{ os_cloud_name }}" - OS_USER: "{{ os_user }}" ansible.builtin.shell: cmd: | {{ shell_header }} - alias openstack="ssh -i {{ edpm_privatekey_path }} ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" + alias openstack="${CONTROLLER1_SSH} OS_CLOUD=${OS_CLOUD_NAME} openstack" ${BASH_ALIASES[openstack]} token issue -f value -c id register: before_adoption_token From c8c6687fca7ef98b79bc6bcdac42a58a36d9d873 Mon Sep 17 00:00:00 2001 From: Archana Singh Date: Mon, 29 Jul 2024 18:18:45 +0530 Subject: [PATCH 3/6] Remove os_user from defaults file --- tests/roles/development_environment/defaults/main.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/roles/development_environment/defaults/main.yaml b/tests/roles/development_environment/defaults/main.yaml index c616deadc..3775bce01 100644 --- a/tests/roles/development_environment/defaults/main.yaml +++ b/tests/roles/development_environment/defaults/main.yaml @@ -3,4 +3,3 @@ prelaunch_test_instance_script: pre_launch.bash edpm_privatekey_path: ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa run_pre_adoption_validation: true os_cloud_name: standalone -os_user: root From 611517a21534c966ee4132a2ddb994f2e8494fd5 Mon Sep 17 00:00:00 2001 From: Archana Singh Date: Mon, 29 Jul 2024 19:32:59 +0530 Subject: [PATCH 4/6] Fix controller1_ssh variable --- tests/roles/development_environment/tasks/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/roles/development_environment/tasks/main.yaml b/tests/roles/development_environment/tasks/main.yaml index b089ce317..c14f7d0c0 100644 --- a/tests/roles/development_environment/tasks/main.yaml +++ b/tests/roles/development_environment/tasks/main.yaml @@ -30,7 +30,7 @@ no_log: "{{ use_no_log }}" environment: INSTALL_YAMLS_PATH: "{{ install_yamls_path }}" - CONTROLLER1_SSH="{{ controller1_ssh }}" + CONTROLLER1_SSH: "{{ controller1_ssh }}" OS_CLOUD_NAME: "{{ os_cloud_name }}" ansible.builtin.shell: cmd: | From 35487653b64dd5d3b4c81d897c23457f7b1be2df Mon Sep 17 00:00:00 2001 From: Archana Singh Date: Tue, 30 Jul 2024 15:07:34 +0530 Subject: [PATCH 5/6] Edit the ssh command to fit multinode source cloud deployment --- .../roles/development_environment/defaults/main.yaml | 1 + tests/roles/development_environment/tasks/main.yaml | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/roles/development_environment/defaults/main.yaml b/tests/roles/development_environment/defaults/main.yaml index 3775bce01..c616deadc 100644 --- a/tests/roles/development_environment/defaults/main.yaml +++ b/tests/roles/development_environment/defaults/main.yaml @@ -3,3 +3,4 @@ prelaunch_test_instance_script: pre_launch.bash edpm_privatekey_path: ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa run_pre_adoption_validation: true os_cloud_name: standalone +os_user: root diff --git a/tests/roles/development_environment/tasks/main.yaml b/tests/roles/development_environment/tasks/main.yaml index c14f7d0c0..d74c19021 100644 --- a/tests/roles/development_environment/tasks/main.yaml +++ b/tests/roles/development_environment/tasks/main.yaml @@ -6,10 +6,11 @@ EDPM_PRIVATEKEY_PATH: "{{ edpm_privatekey_path }}" OS_CLOUD_IP: "{{ standalone_ip | default(edpm_node_ip) }}" OS_CLOUD_NAME: "{{ os_cloud_name }}" + OS_USER: "{{ os_user }}" ansible.builtin.shell: cmd: | {{ shell_header }} - alias openstack="ssh -i {{ edpm_privatekey_path }} root@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" + alias openstack="ssh -i {{ edpm_privatekey_path }} ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" {{ lookup('ansible.builtin.file', prelaunch_test_instance_script) }} - name: creates Barbican secret @@ -20,22 +21,25 @@ EDPM_PRIVATEKEY_PATH: "{{ edpm_privatekey_path }}" OS_CLOUD_IP: "{{ standalone_ip | default(edpm_node_ip) }}" OS_CLOUD_NAME: "{{ os_cloud_name }}" + OS_USER: "{{ os_user }}" ansible.builtin.shell: cmd: | {{ shell_header }} - alias openstack="ssh -i {{ edpm_privatekey_path }} root@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" + alias openstack="ssh -i {{ edpm_privatekey_path }} ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" ${BASH_ALIASES[openstack]} secret store --name testSecret --payload 'TestPayload' - name: saves a fernet token no_log: "{{ use_no_log }}" environment: INSTALL_YAMLS_PATH: "{{ install_yamls_path }}" - CONTROLLER1_SSH: "{{ controller1_ssh }}" + EDPM_PRIVATEKEY_PATH: "{{ edpm_privatekey_path }}" + OS_CLOUD_IP: "{{ standalone_ip | default(edpm_node_ip) }}" OS_CLOUD_NAME: "{{ os_cloud_name }}" + OS_USER: "{{ os_user }}" ansible.builtin.shell: cmd: | {{ shell_header }} - alias openstack="${CONTROLLER1_SSH} OS_CLOUD=${OS_CLOUD_NAME} openstack" + alias openstack="ssh -i {{ edpm_privatekey_path }} ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" ${BASH_ALIASES[openstack]} token issue -f value -c id register: before_adoption_token From 1ceeb13fc25dfa6607fcd459eacf9120a0623b1b Mon Sep 17 00:00:00 2001 From: Archana Singh Date: Thu, 1 Aug 2024 13:20:20 +0530 Subject: [PATCH 6/6] Disable strict ssh key checking during ssh to source osp --- tests/roles/development_environment/tasks/main.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/roles/development_environment/tasks/main.yaml b/tests/roles/development_environment/tasks/main.yaml index d74c19021..71ce4a35e 100644 --- a/tests/roles/development_environment/tasks/main.yaml +++ b/tests/roles/development_environment/tasks/main.yaml @@ -10,7 +10,7 @@ ansible.builtin.shell: cmd: | {{ shell_header }} - alias openstack="ssh -i {{ edpm_privatekey_path }} ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" + alias openstack="ssh -i {{ edpm_privatekey_path }} -o StrictHostKeyChecking=no ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" {{ lookup('ansible.builtin.file', prelaunch_test_instance_script) }} - name: creates Barbican secret @@ -25,7 +25,7 @@ ansible.builtin.shell: cmd: | {{ shell_header }} - alias openstack="ssh -i {{ edpm_privatekey_path }} ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" + alias openstack="ssh -i {{ edpm_privatekey_path }} -o StrictHostKeyChecking=no ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" ${BASH_ALIASES[openstack]} secret store --name testSecret --payload 'TestPayload' - name: saves a fernet token @@ -39,7 +39,7 @@ ansible.builtin.shell: cmd: | {{ shell_header }} - alias openstack="ssh -i {{ edpm_privatekey_path }} ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" + alias openstack="ssh -i {{ edpm_privatekey_path }} -o StrictHostKeyChecking=no ${OS_USER}@${OS_CLOUD_IP} OS_CLOUD=${OS_CLOUD_NAME} openstack" ${BASH_ALIASES[openstack]} token issue -f value -c id register: before_adoption_token