mirror of https://github.com/ansible/ansible.git
Factoids and push variables via setup are now available to be templated in command args
as well as template files. PLUS, variables are now expressed in playbooks without having to know about the setup task, which means playbooks are simpler to read now.pull/3/head
parent
e0b1ad790c
commit
8d57ceecf1
@ -1,15 +1,18 @@
|
|||||||
---
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
user: root
|
user: root
|
||||||
|
vars:
|
||||||
|
http_port: 80
|
||||||
|
max_clients: 200
|
||||||
tasks:
|
tasks:
|
||||||
- include: base.yml
|
- include: base.yml
|
||||||
- name: configure template & module variables for future template calls
|
- name: write the apache config file using vars set above
|
||||||
action: setup http_port=80 max_clients=200
|
|
||||||
- name: write the apache config file
|
|
||||||
action: template src=/srv/httpd.j2 dest=/etc/httpd.conf
|
action: template src=/srv/httpd.j2 dest=/etc/httpd.conf
|
||||||
notify:
|
notify:
|
||||||
- restart apache
|
- restart apache
|
||||||
- name: ensure apache is running
|
- name: ensure apache is running
|
||||||
action: service name=httpd state=started
|
action: service name=httpd state=started
|
||||||
|
- name: pointless test action
|
||||||
|
action: command /bin/echo {{ http_port }}
|
||||||
handlers:
|
handlers:
|
||||||
- include: handlers.yml
|
- include: handlers.yml
|
||||||
|
|||||||
Loading…
Reference in New Issue