Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Vars
- APACHE_PREFIX: apache-home
- APACHE_VAR:
- - SUFFIX: apache1
- APACHE_VHOSTS:
- - {SERVERNAME: "apache1.example.com, NAME: "apache1" }
- - {SERVERNAME: "apache2.example.com, NAME: "apache2" }
- - SUFFIX: apache3
- APACHE_VHOSTS:
- - {SERVERNAME: "apache3.example.com, NAME: "apache3" }
- - {SERVERNAME: "apache4.example.com, NAME: "apache4" }
- ## Task
- - name: "configure apache from template files"
- tags:
- - configure
- template:
- src: "files/apache/{{ item.0 }}.j2"
- dest: "/public/server/apps/{{ APACHE_PREFIX }}-{{ item.1.SUFFIX }}/{{ item.0 }}"
- backup: yes
- with_nested:
- - [ 'conf/httpd.conf', 'conf/extra/httpd-autoindex.conf', 'conf/extra/httpd-default.conf', 'conf/extra/httpd-ssl.conf', 'conf/extra/httpd-vhosts.conf' ]
- - '{{ APACHE_VAR }}'
- ## Template
- {% for VAR in APACHE_VAR.0.APACHE_VHOSTS %}
- ServerRoot "/public/server/apps/ap-home-{{ VAR.0.HOME }}"
- {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement