1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_collection_users.git synced 2024-08-16 10:29:50 +02:00

only set ssh keys if explicitly wanted

This commit is contained in:
L3D 2024-02-13 23:28:41 +01:00
parent 1d54bbcb09
commit e1cdffd631
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
2 changed files with 5 additions and 2 deletions

View file

@ -2,6 +2,7 @@
# Create ansible user
l3d_users_user__create_ansible: true
l3d_users_user__ansible_user_state: 'present'
l3d_users_user__set_ansible_ssh_keys: false
l3d_users_user__ansible_ssh_keys: "{{ lookup('url', 'https://github.com/do1jlr.keys', split_lines=False) }}"
# run simple versionscheck
submodules_versioncheck: false

View file

@ -20,10 +20,12 @@
ansible.posix.authorized_key:
user: 'ansible'
state: "{{ l3d_users_user__ansible_user_state | ternary('present', 'absent') }}"
key: "{{ lookup('url', 'https://github.com/do1jlr.keys', split_lines=False) }}"
key: "{{ l3d_users_user__ansible_ssh_keys }}"
exclusive: true
when: l3d_users_user__set_ansible_ssh_keys | bool
- name: Add admin keys to user ansible
become: true
ansible.builtin.debug:
msg: "tbd."
when: l3d_users_user__set_ansible_ssh_keys