Move generation of ssh keys from role prerequisites to role users - let handle the user module this

This commit is contained in:
Tobias Hachmer 2018-09-17 13:45:55 +02:00 committed by Julian Labus
parent 69a12e0696
commit ea726b9777
No known key found for this signature in database
GPG key ID: 8AF209F2C6B3572A
3 changed files with 4 additions and 5 deletions

View file

@ -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

View file

@ -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 }}"

View file

@ -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: