Move generation of ssh keys from role prerequisites to role users - let handle the user module this
This commit is contained in:
parent
69a12e0696
commit
ea726b9777
3 changed files with 4 additions and 5 deletions
|
@ -18,8 +18,3 @@
|
||||||
- name: Test root access for admin account
|
- name: Test root access for admin account
|
||||||
command: "true"
|
command: "true"
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
|
||||||
- name: Generate SSH keys
|
|
||||||
shell: "ssh-keygen -b 4096 -t rsa -f /home/admin/.ssh/id_rsa -q -N '' -C '{{ inventory_hostname_short }}'"
|
|
||||||
args:
|
|
||||||
creates: /home/admin/.ssh/id_rsa
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
comment: "{{ item.comment }}"
|
comment: "{{ item.comment }}"
|
||||||
shell: "{{ item.shell }}"
|
shell: "{{ item.shell }}"
|
||||||
home: "{{ item.home }}"
|
home: "{{ item.home }}"
|
||||||
|
generate_ssh_key: "{{ item.generate_ssh_key }}"
|
||||||
|
ssh_key_bits: "{{ item.ssh_key_bits }}"
|
||||||
state: "{{ item.state }}"
|
state: "{{ item.state }}"
|
||||||
loop: "{{ system_users }}"
|
loop: "{{ system_users }}"
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ system_users:
|
||||||
home: "/home/admin"
|
home: "/home/admin"
|
||||||
state: "present"
|
state: "present"
|
||||||
ssh_keys: "{{ ssh_keys_admin_team }}"
|
ssh_keys: "{{ ssh_keys_admin_team }}"
|
||||||
|
generate_ssh_key: "yes"
|
||||||
|
ssh_key_bits: 4096
|
||||||
|
|
||||||
admin_users:
|
admin_users:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue