-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaybook01.yml
More file actions
56 lines (47 loc) · 1.09 KB
/
playbook01.yml
File metadata and controls
56 lines (47 loc) · 1.09 KB
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
---
# Learning about Playbooks
- name: bootstrapping and new user creation
hosts: raiders # our group in our inventory
gather_facts: no
vars:
newuser1: marian
newuser2: belloq
newuser3: willie
newuser4: elsa
tasks:
# use the raw module
- name: update apt with latest repo info
raw: "apt update -y"
become: yes
- name: install py3 and pip3 with ansible raw
raw: "apt install -y python3-pip"
become: yes
- name: create new group
group:
name: indymovies
state: present
become: yes
- name: Add newuser1 to target hosts
user:
name: "{{ newuser1 }}"
state: present
group: indymovies
become: yes
- name: Add newuser2 to target hosts
user:
name: "{{ newuser2 }}"
state: present
group: indymovies
become: yes
- name: add newuser3 to target hosts
user:
name: "{{ newuser3 }}"
state: present
group: indymovies
become: yes
- name: add newuser4 to target hosts
user:
name: "{{ newuser4 }}"
state: present
group: indymovies
become: yes