ansible-roles/roles/common/tasks/ansible.yml

27 lines
925 B
YAML
Raw Normal View History

2021-12-13 23:00:23 +01:00
---
- name: Deploy SSH keys for the ansible account
authorized_key:
user: ansible
key: "{{ system_ansible_ssh_keys | join(\"\n\") }}"
key_options: "{{ system_ansible_ssh_keys_options | join(',') }}"
exclusive: True
when:
- system_ansible_ssh_keys is defined
- system_ansible_ssh_keys | length > 0
- system_ansible_src_ip is not defined or system_ansible_src_ip | length < 1
2022-01-12 10:14:43 +01:00
tags: system,ssh
2021-12-13 23:00:23 +01:00
- name: Deploy SSH keys for the ansible account (with source IP restriction)
authorized_key:
user: ansible
key: "{{ system_ansible_ssh_keys | join(\"\n\") }}"
key_options: "from=\"{{ system_ansible_src_ip | join(',') }}\",{{ system_ansible_ssh_keys_options | join(',') }}"
exclusive: True
when:
- system_ansible_ssh_keys is defined
- system_ansible_ssh_keys | length > 0
- system_ansible_src_ip is defined
- system_ansible_src_ip | length > 0
2022-01-12 10:14:43 +01:00
tags: system,ssh