additional course material RH294
Olaf Bohlen
2020-08-20 1de6236f80a879ca110981fe0e5c0c05c521225b
commit | author | age
97d9af 1 ---
SU 2 - name: Introduce roles
3   hosts: server
4   become: true
5   pre_tasks:
6     - name: pre_tasks run here
7       debug:
8         msg: 'this runs before the roles'
9   roles:
10     - prep_server
1de623 11   tasks:
OB 12     - name: prepare sample html content
13       copy:
14         dest: /var/www/htdocs/index.html
15         content: "foobar"
16       notify: "set permissions"
97d9af 17   post_tasks:
SU 18     - name: post_tasks run here
19       debug:
20         msg: 'this runs after the roles'
21     - name: retrieve content from port 80
22       uri:
23         url: "http://localhost:80/index.html"
24         return_content: yes
25       when: port == 'http'
1de623 26   handlers:
OB 27     - name: set permissions
28       file:
29         dest: /var/www/htdocs/index.html
30         mode: 644