-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
--- | ||
# defaults file for base | ||
base_user: test | ||
base_group: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDdYP1gM8Pk60KPzfMg6lwY9l+uZfs88Rd6bsAPKTgK/TSGiOjFd69zvhW5bqaRGE7nyNhGD/boFB2XMQvil++13nq5ZL1xC2xZVYFfu5HSTtU9+jU0SZWvcbZ9Z/MHAP9WfWm+//w3qB+nJJhuxs2w+mweFKNBptFKEibOXhgDeHJn1xZwKTf61GZn4LDEbw7dIkjzNLLT2nYXJbMYgnVGmXv065jrYPSy+KVmHX+RIljDzOW6gK8uIL8AylXlxlKp2klzxVvLiCSlWGM8Zu3v6B6crEqeZkm5C6PagMoUo0qr/eN6fK2GVGR5dD09ptMDVHjz0aQfvZi9vMLAWQyt avd@lenovo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,36 @@ | ||
--- | ||
|
||
- name: Ensure test dir | ||
file: | ||
path: /tmp/test | ||
state: directory | ||
- name: Make sure we have a 'wheel' group | ||
group: | ||
name: wheel | ||
state: present | ||
|
||
- name: Allow 'wheel' group to have passwordless sudo | ||
lineinfile: | ||
dest: /etc/sudoers | ||
state: present | ||
regexp: '^%wheel' | ||
line: '%wheel ALL=(ALL) NOPASSWD: ALL' | ||
validate: 'visudo -cf %s' | ||
|
||
- name: Ensure base group | ||
group: | ||
name: "{{ base_group }}" | ||
state: present | ||
|
||
- name: Ensure base user | ||
user: | ||
name: "{{ base_user }}" | ||
group: "{{ base_group }}" | ||
groups: wheel | ||
append: yes | ||
state: present | ||
|
||
- name: Set authorized key took from file | ||
authorized_key: | ||
user: "{{ base_user }}" | ||
state: present | ||
key: "{{ lookup('file', '{{ item }}') }}" | ||
with_fileglob: | ||
- "files/*.pub" | ||
|