Skip to content
Snippets Groups Projects
Commit d379fb78 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Merge branch 'feat-ssh-host-key-role' into 'feat-hpc-factory'

Feat- Add role for managing SSH host keys

See merge request !129
parents c1f7ffd6 ca6753c0
No related branches found
No related tags found
2 merge requests!129Feat- Add role for managing SSH host keys,!117This MR merges the feat-hpc-factory branch, which was focused on building and deploying proxy images for the COD cluster.
Pipeline #12139 passed with stage
in 1 minute and 54 seconds
......@@ -7,3 +7,4 @@
- { name: 'nfs_mounts', tags: 'nfs_mounts' }
- { name: 'ldap_config', tags: 'ldap_config' }
- { name: 'slurm_client', tags: 'slurm_client', when: enable_slurm_client }
- { name: 'ssh_host_keys', tags: 'ssh_host_keys' }
......@@ -33,3 +33,11 @@
- /gpfs4
- /gpfs5
#SSH Host Keys
S3_ENDPOINT: ""
SSH_HOST_KEYS_S3_BUCKET: ""
SSH_HOST_KEYS_S3_OBJECT: ""
# AWS credentials
LTS_ACCESS_KEY: ""
LTS_SECRET_KEY: ""
---
- name: Ensure destination directory exists only if not present
file:
path: /tmp/ssh_keys
state: directory
mode: '0755'
args:
creates: /tmp/ssh_keys
- name: Download SSH host keys tar.gz from S3
aws_s3:
mode: get
s3_url: "{{ S3_ENDPOINT }}"
bucket: "{{ SSH_HOST_KEYS_S3_BUCKET }}"
object: "{{ SSH_HOST_KEYS_S3_OBJECT }}"
dest: "/tmp/ssh_keys/{{ SSH_HOST_KEYS_S3_OBJECT }}"
aws_access_key: "{{ LTS_ACCESS_KEY }}"
aws_secret_key: "{{ LTS_SECRET_KEY }}"
vars:
ansible_python_interpreter: /usr/bin/python3
- name: Unpack SSH host keys to /etc/ssh
unarchive:
src: "/tmp/ssh_keys/{{ SSH_HOST_KEYS_S3_OBJECT }}"
dest: "/etc/ssh"
remote_src: yes
become: true
- name: Restart SSH service
ansible.builtin.service:
name: sshd
state: restarted
become: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment