Add slave SSH keys 92/10892/2
authorsankar palanivel <sankar.palanivel@est.tech>
Tue, 19 Oct 2021 10:44:47 +0000 (11:44 +0100)
committerSankar Palanivel <sankar.palanivel@est.tech>
Tue, 19 Oct 2021 10:47:30 +0000 (10:47 +0000)
In this change,
 - Add Jenkins slave's SSH public key into jumphost user's authorized_keys
   file, as this is required to enable users to perform addition/removal
   of into their Openvpn deployments.

Change-Id: I8e152b989109785cd948d9394f113bf26acb210e

infra/configure_admin_user_access/playbooks/roles/configure-admin-user-access/tasks/configure-jumphost.yaml
infra/configure_admin_user_access/playbooks/roles/configure-admin-user-access/vars/main.yaml

index 625520354cdc9ab564c6a19a66dc44cc6901f342..c21516f7c7593abf513922f7825c0e7574952534 100644 (file)
 - name: Append ssh public key to authorized_keys on target nodes
   lineinfile:
     path: "{{ admin_user_ssh_dir }}/authorized_keys"
-    line: "{{ lookup('file', '{{ nolabs_user_public_key }}') }}"
+    line: "{{ item }}"
     create: true
     state: present
     owner: "{{ admin_user }}"
     group: "{{ admin_user }}"
     mode: 0600
+  with_items:
+    - "{{ lookup('file', '{{ nolabs_user_public_key }}') }}"
+    - "{{ lookup('file', '{{ slave_user_public_key }}') }}"
 
 - name: Create SSH keypair for '{{ admin_user }}'
   openssh_keypair:
index 7292c814006b00e6865f6cfac250eb5875f44cab..8237ca8ede2d5a5317e6663538f1130f8306fe7b 100644 (file)
@@ -25,4 +25,5 @@ admin_user_ssh_dir: "/home/{{ admin_user }}/.ssh"
 admin_user_private_key: "/home/{{ admin_user }}/.ssh/id_rsa"
 admin_user_public_key: "/home/{{ admin_user }}/.ssh/id_rsa.pub"
 admin_user_jumphost_public_key: "/tmp/{{ admin_user }}_id_rsa.pub"
-nolabs_user_public_key: "/tmp/nolabs/id_rsa.pub"
\ No newline at end of file
+nolabs_user_public_key: "/tmp/nolabs/id_rsa.pub"
+slave_user_public_key: "/home/jenkins/.ssh/d_rsa.pub"
\ No newline at end of file