| | |
| | | --- |
| | | - name: Simple play for class DO407 |
| | | hosts: server |
| | | become: yes |
| | | hosts: localhost |
| | | gather_facts: false |
| | | tasks: |
| | | - name: ping host |
| | |
| | | copy: |
| | | dest: /etc/motd |
| | | content: "Welcome to our server!\n\n" |
| | | - name: ensure postfix is installed |
| | | package: |
| | | - package: |
| | | name: postfix |
| | | state: installed |
| | | name: ensure postfix is installed |
| | | - name: ensure that postfix is stopped |
| | | service: |
| | | name: postfix |
| | |
| | | - debug: |
| | | msg: "{{ ansible_facts['fqdn'] }}" |
| | | - name: Next play |
| | | hosts: servera |
| | | hosts: localhost |
| | | tasks: |
| | | - name: adjust /etc/motd |
| | | copy: |