File tree Expand file tree Collapse file tree 1 file changed +23
-20
lines changed Expand file tree Collapse file tree 1 file changed +23
-20
lines changed Original file line number Diff line number Diff line change 1
- ---
2
- - hosts : all
1
+ - name : install nginx
2
+ hosts : all
3
3
become : yes
4
4
tasks :
5
- - name : ensure nginx is at the latest version
6
- apt :
7
- name : nginx
8
- state : latest
9
- - name : copy the content of the web site
10
- shell : echo "hi there, Ansible is Cool" > "/var/www/html/index.html"
11
- - name : start nginx
12
- service :
13
- name : nginx
14
- state : restarted
15
- # - name: stop nginx
16
- # service:
17
- # name: nginx
18
- # state: stopped
19
- # - name: ensure nginx is not installed
20
- # apt:
21
- # name: nginx
22
- # state: absent
5
+ - name : run apt-get update
6
+ apt :
7
+ update_cache : yes
8
+ - name : install nginx
9
+ apt :
10
+ name : nginx
11
+ state : present
12
+ - name : start service
13
+ systemd :
14
+ name : nginx
15
+ state : restarted
16
+ # - name: stop nginx
17
+ # systemd:
18
+ # name: nginx
19
+ # state: stopped
20
+ # - name: uninstall nginx
21
+ # apt:
22
+ # name: nginx
23
+ # state: absent
24
+ # purge: true
25
+ # autoremove: true
You can’t perform that action at this time.
0 commit comments