No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

blog.yml 1.2KB

1234567891011121314151617181920212223242526272829303132
  1. - name: Create directories for HTML documents
  2. file: state=directory path={{ item }} group=www-data owner={{ main_user_name }}
  3. with_items: "{{ virtual_domains | json_query('[*].doc_root') | unique }}"
  4. - name: Create directory for well-known configs
  5. file: state=directory path=/var/www/well-known group=www-data owner=www-data
  6. - name: Create the Apache well-known config
  7. template:
  8. src=etc_apache2_conf-available_well-known.j2
  9. dest=/etc/apache2/conf-available/well-known.conf
  10. owner=root
  11. group=root
  12. notify: restart apache
  13. - name: Enable the Apache well-known config
  14. command: a2enconf well-known.conf creates=/etc/apache2/conf-enabled/well-known.conf.conf
  15. notify: restart apache
  16. - name: Create the Apache blog sites config files
  17. template:
  18. src=etc_apache2_sites-available_blog.j2
  19. dest=/etc/apache2/sites-available/{{ item.name }}.conf
  20. owner=root
  21. group=root
  22. notify: restart apache
  23. with_items: "{{ virtual_domains }}"
  24. - name: Enable Apache blog sites (creates new sites-enabled symlinks)
  25. command: a2ensite {{ item }}.conf creates=/etc/apache2/sites-enabled/{{ item }}.conf
  26. notify: restart apache
  27. with_items: "{{ virtual_domains | json_query('[*].name') }}"