remove globals.yaml, move vars to role defaults
This commit is contained in:
parent
fad0a40eff
commit
f07a44a73c
7 changed files with 17 additions and 21 deletions
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
|
||||
- name: creating user {{ username }} in sudo group (Debian/Ubuntu)
|
||||
- name: creating user {{ create_username }} in sudo group (Debian/Ubuntu)
|
||||
user:
|
||||
name: "{{ username }}"
|
||||
password: "{{ pwgen | password_hash('sha512') }}"
|
||||
name: "{{ create_username }}"
|
||||
password: "{{ create_pwgen | password_hash('sha512') }}"
|
||||
state: present
|
||||
shell: /bin/bash
|
||||
groups: sudo
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
|
||||
- name: creating user {{ username }} in wheel group (RHEL/CentOS/Fedora)
|
||||
- name: creating user {{ create_username }} in wheel group (RHEL/CentOS/Fedora)
|
||||
user:
|
||||
name: "{{ username }}"
|
||||
password: "{{ pwgen | password_hash('sha512') }}"
|
||||
name: "{{ create_username }}"
|
||||
password: "{{ create_pwgen | password_hash('sha512') }}"
|
||||
state: present
|
||||
shell: /bin/bash
|
||||
groups: wheel
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
- include_tasks: el.yml
|
||||
when: ansible_distribution in ["CentOS", "Red Hat Enterprise Linux", "RedHat", "Fedora"]
|
||||
|
||||
- name: print generated password for {{ username }} on each host
|
||||
debug: var=pwgen
|
||||
- name: print generated password for {{ create_username }} on each host
|
||||
debug: var=create_pwgen
|
||||
when: user_created is changed
|
||||
|
||||
- name: copy current pubkeys to ~{{ username }}/.ssh/authorized_keys
|
||||
- name: copy current pubkeys to ~{{ create_username }}/.ssh/authorized_keys
|
||||
authorized_key:
|
||||
user: "{{ username }}"
|
||||
user: "{{ create_username }}"
|
||||
state: present
|
||||
key: "{{ item }}"
|
||||
with_items:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue