mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-26 15:55:56 +02:00
Update to 2021-12-13 23:00
This commit is contained in:
26
roles/common/tasks/ansible.yml
Normal file
26
roles/common/tasks/ansible.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
|
||||
- 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
|
||||
tags: system
|
||||
|
||||
- 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
|
||||
tags: system
|
@@ -17,6 +17,7 @@
|
||||
- ansible_os_family == 'RedHat'
|
||||
- include_tasks: mail.yml
|
||||
- include_tasks: system.yml
|
||||
- include_tasks: ansible.yml
|
||||
- include_tasks: hardware.yml
|
||||
when: ansible_virtualization_role == 'host'
|
||||
- include_tasks: guest.yml
|
||||
|
Reference in New Issue
Block a user