This ansible role deploy (and remove) ssh keys files for users in their home folder.
It just copy keys files from a local files folder.
This source folder must be secured, in my case the folder is unsecure, but the controler is secured and very restricted.
Platform | Versions |
---|---|
Debian | all |
EL | all |
Fedora | all |
Ubuntu | all |
Ansible >= 2.13
None.
ansible-galaxy install dginhoux.user_ssh_keys
git clone https://github.com/dginhoux/ansible_role.user_ssh_keys dginhoux.user_ssh_keys
- name: Playbook
hosts: all
tasks:
- name: Start role dginhoux.user_ssh_keys
ansible.builtin.include_role:
name: dginhoux.user_ssh_keys
Default variables defined in defaults/main.yml
user_ssh_keys_list:
- name: sample
keys_folder: /home/sample/.ssh
keys_files:
- name: id_rsa
state: present
src_location: "files/sample"
user_ssh_keys_list_host: []
user_ssh_keys_list_group: []
NOTE : Theses 3 lists user_ssh_keys_list
, user_ssh_keys_list_group
and user_ssh_keys_list_host
are merged.
You can use the _host
and _group
lists to specify per host and/or per group content.
Those variables files are located in vars/*.yml
are used to handle OS differences.
One of theses is loaded dynamically during role runtime using the include_vars
module and set OS specifics variable's.
NOT USED BY THIS ROLE
Dany GINHOUX - https://github.com/dginhoux
MIT