part 1 completed
This commit is contained in:
15
playbooks/handler_playbook.yml
Normal file
15
playbooks/handler_playbook.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
- hosts: labservers
|
||||
become: yes
|
||||
handlers:
|
||||
- name: restart apache
|
||||
service: name="httpd" state="restarted"
|
||||
listen: "restart web"
|
||||
tasks:
|
||||
- name: change config
|
||||
replace:
|
||||
path: /etc/httpd/conf/httpd.conf
|
||||
regexp: '^DocumentRoot.*$'
|
||||
replace: 'DocumentRoot "/opt/www"'
|
||||
backup: yes
|
||||
notify: "restart web"
|
||||
13
playbooks/register_playbook.yml
Normal file
13
playbooks/register_playbook.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- hosts: labservers
|
||||
tasks:
|
||||
- name: create file
|
||||
file:
|
||||
path: /tmp/newfile
|
||||
state: touch
|
||||
register: output
|
||||
- debug: msg="Register output is {{output}}"
|
||||
- name: edit file
|
||||
lineinfile:
|
||||
path: /tmp/newfile
|
||||
line: "{{output.uid}}"
|
||||
Reference in New Issue
Block a user