initial commit
This commit is contained in:
commit
800836b2d9
23 changed files with 609 additions and 0 deletions
20
roles/create-user/tasks/main.yml
Normal file
20
roles/create-user/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
|
||||
- include_tasks: deb.yml
|
||||
when: ansible_distribution in ["Debian", "Ubuntu"]
|
||||
|
||||
- include_tasks: el.yml
|
||||
when: ansible_distribution in ["CentOS", "Red Hat Enterprise Linux", "Fedora"]
|
||||
|
||||
- name: print generated password for {{ username }} on each host
|
||||
debug: var=pwgen
|
||||
when: user_created is changed
|
||||
|
||||
- name: copy current pubkeys to ~{{ username }}/.ssh/authorized_keys
|
||||
authorized_key:
|
||||
user: "{{ username }}"
|
||||
state: present
|
||||
key: "{{ item }}"
|
||||
with_items:
|
||||
- "{{ lookup('file','~/.ssh/id_ed25519.pub') }}"
|
||||
- "{{ lookup('file','~/.ssh/id_rsa.pub') }}"
|
Loading…
Add table
Add a link
Reference in a new issue