-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml_playbook.yml
44 lines (38 loc) · 921 Bytes
/
html_playbook.yml
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
- name: Deploy simple HTML page
hosts: webservers
become: yes
tasks:
- name: Install Nginx
apt:
name: nginx
state: present
- name: Copy index.html to webserver
copy:
src: index.html
dest: /data/semaphore/index.html
- name: Start Nginx
service:
name: nginx
state: started
# Tasks to manage groups
- name: Ensure the 'developers' group exists
group:
name: developers
state: present
- name: Ensure the 'ops' group exists
group:
name: ops
state: present
# Tasks to manage users
- name: Ensure the user 'alice' exists
user:
name: alice
groups: developers
state: present
create_home: yes
- name: Ensure the user 'bob' exists
user:
name: bob
groups: ops
state: present
create_home: yes