Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. ## Vars
  2. APACHE_PREFIX: apache-home
  3. APACHE_VAR:
  4. - SUFFIX: apache1
  5. APACHE_VHOSTS:
  6. - {SERVERNAME: "apache1.example.com, NAME: "apache1" }
  7. - {SERVERNAME: "apache2.example.com, NAME: "apache2" }
  8. - SUFFIX: apache3
  9. APACHE_VHOSTS:
  10. - {SERVERNAME: "apache3.example.com, NAME: "apache3" }
  11. - {SERVERNAME: "apache4.example.com, NAME: "apache4" }
  12.  
  13. ## Task
  14. - name: "configure apache from template files"
  15. tags:
  16. - configure
  17. template:
  18. src: "files/apache/{{ item.0 }}.j2"
  19. dest: "/public/server/apps/{{ APACHE_PREFIX }}-{{ item.1.SUFFIX }}/{{ item.0 }}"
  20. backup: yes
  21. with_nested:
  22. - [ 'conf/httpd.conf', 'conf/extra/httpd-autoindex.conf', 'conf/extra/httpd-default.conf', 'conf/extra/httpd-ssl.conf', 'conf/extra/httpd-vhosts.conf' ]
  23. - '{{ APACHE_VAR }}'
  24.  
  25. ## Template
  26.  
  27. {% for VAR in APACHE_VAR.0.APACHE_VHOSTS %}
  28. ServerRoot "/public/server/apps/ap-home-{{ VAR.0.HOME }}"
  29. {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement