-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththree_modules.yml
26 lines (24 loc) · 939 Bytes
/
three_modules.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
--- # Using three basic ansible modules to implement packages and log the results
- hosts: xx.xx.xxx.xxx
user: ansible
sudo: yes
gather_facts: no
tasks:
- name: date/time stamp when the playbook starts
raw: /usr/bin/date > /home/ansible/playbook_start.log
- name: install the apache web server
yum: pkg=httpd state=latest
- name: start the web service
service: name=httpd state=restarted
- name: verify that the web service is running
command: systemctl status httpd
register: result
- debug: var=result
- name: install client software - telnet
yum: pkg=telnet state=latest
- name: install client software- lynx
yum: pkg=lynx state=latest
- name: log all of the packages installed on the system
raw: yum list installed > /home/ansible/installed.log
- name: date/time stamp when the playbook ends
raw: /usr/bin/date > /home/ansible/playbook_end.log