users task is no longer needed
This is now a role
This commit is contained in:
parent
176881738a
commit
17e34063d1
1 changed files with 0 additions and 48 deletions
|
@ -1,48 +0,0 @@
|
||||||
---
|
|
||||||
- name: Add users | create users, shell, home dirs
|
|
||||||
user:
|
|
||||||
name: "{{ item }}"
|
|
||||||
shell: /bin/bash
|
|
||||||
createhome: yes
|
|
||||||
comment: 'created with ansible'
|
|
||||||
password_lock: true
|
|
||||||
append: true
|
|
||||||
with_items:
|
|
||||||
- "{{ admin_users }}"
|
|
||||||
|
|
||||||
- name: Create .ssh user directories
|
|
||||||
file:
|
|
||||||
path: "{{ '/home/' + item + '/.ssh' }}"
|
|
||||||
state: directory
|
|
||||||
mode: "0700"
|
|
||||||
owner: "{{ item }}"
|
|
||||||
group: "{{ item }}"
|
|
||||||
with_items:
|
|
||||||
- "{{ admin_users }}"
|
|
||||||
|
|
||||||
- name: Set authorized keys for users
|
|
||||||
copy:
|
|
||||||
src: "{{'users/' + item + '_authorized_keys'}}"
|
|
||||||
remote_src: no
|
|
||||||
dest: "{{ '/home/' + item + '/.ssh/authorized_keys' }}"
|
|
||||||
mode: "0600"
|
|
||||||
owner: "{{ item }}"
|
|
||||||
group: "{{ item }}"
|
|
||||||
with_items:
|
|
||||||
- "{{ admin_users }}"
|
|
||||||
|
|
||||||
- name: Place users in sudo group
|
|
||||||
user:
|
|
||||||
name: "{{ item }}"
|
|
||||||
groups: sudo
|
|
||||||
append: yes
|
|
||||||
with_items:
|
|
||||||
- "{{ admin_users }}"
|
|
||||||
|
|
||||||
- name: Configure group sudo for sudoers without password
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/sudoers
|
|
||||||
state: present
|
|
||||||
regexp: '^%sudo\s'
|
|
||||||
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
|
|
||||||
validate: /usr/sbin/visudo -cf %s
|
|
Loading…
Reference in a new issue