Skip to content

Commit

Permalink
sshconfig: allow extra SSH config (#604)
Browse files Browse the repository at this point in the history
Part of osism/issues#918

Signed-off-by: Christian Berendt <berendt@osism.tech>
  • Loading branch information
berendt authored Mar 15, 2024
1 parent 8cd0715 commit e69002c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/sshconfig/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ sshconfig_order: 20
sshconfig_port: 22
sshconfig_private_key_file: /opt/ansible/secrets/id_rsa.operator
sshconfig_user: "{{ operator_user }}"
sshconfig_extra: ""
11 changes: 11 additions & 0 deletions roles/sshconfig/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
when: item != "localhost" and item != "127.0.0.1"
loop: "{{ groups[sshconfig_groupname] }}"

- name: Add extra config
ansible.builtin.copy:
content: |
####################
# extra config
{{ sshconfig_extra }}
dest: "{{ sshconfig_destination.stdout }}/.ssh/config.d/999-extra"
mode: 0600
when: sshconfig_extra | length > 0

- name: Assemble ssh config
ansible.builtin.assemble:
src: "{{ sshconfig_destination.stdout }}/.ssh/config.d"
Expand Down

0 comments on commit e69002c

Please sign in to comment.