-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaybook9.yaml
55 lines (48 loc) · 1.15 KB
/
playbook9.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- hosts: srv1
user: vagrant
become: yes
become_method: sudo
vars:
- username: ejhakun
tasks:
- name: "Install software requirements {{ item }}"
apt: pkg={{ item }}
state=present
update_cache=true
with_items:
- git
- curl
- htop
- vim
- wget
- sudo
- unzip
- zsh
- name: Create Sudo Group
group:
name: sudo
state: present
- name: Create new user
user:
name={{ username }}
groups="sudo"
state=present
shell=/bin/bash
password=$6$jcbOPExek4DZt/.p$9B2Gp7v7qfN90ZwTM/ZfhLzQQ/1oDCQFbejxCGnZOV56Y3VXeq4/n9c42n6vY2gSpf0.YWA/Df1zr6v8HmIjI.
home=/home/{{ username }}/
- name: Create mandatory directory inside home
file:
path=/home/{{ username }}/{{ item }}
state=directory
owner={{ username }}
group={{ username }}
mode=0700
with_items:
- src
- bin
- backup
- tmp
- logs
- report
- lib