apache2.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. - name: Install apache2 packages
  2. action: ${ansible_pkg_mgr} pkg=apache2 state=installed update_cache=yes
  3. when_boolean: ${with_apache2}
  4. - name: Install apache2 basic security configuration
  5. action: template src=apache2/conf.d/security.j2 dest=/etc/apache2/conf.d/security owner=root group=root mode=0644
  6. notify:
  7. - Reload apache2
  8. when_boolean: ${with_apache2}
  9. - name: Install mod_php5 packages for apache2
  10. action: ${ansible_pkg_mgr} pkg=libapache2-mod-php5 state=installed update_cache=yes
  11. when_boolean: ${with_apache2} and ${with_apache2_modphp5}
  12. - name: Create basic authentication file for admin (apache2)
  13. action: template src=apache2/auth_admin.j2 dest=/etc/apache2/auth_admin owner=root group=www-data mode=0640
  14. when_boolean: ${with_apache2}
  15. - name: Install PHPMyAdmin virtual host for apache2 (sites-available)
  16. action: template src=apache2/pma_vhost.j2 dest=/etc/apache2/sites-available/pma owner=root group=root mode=0644
  17. notify:
  18. - Reload apache2
  19. when_boolean: ${with_phpmyadmin} and ${with_apache2}
  20. - name: Install PHPMyAdmin virtual host for apache2 (sites-enabled)
  21. action: file src=/etc/apache2/sites-available/pma path=/etc/apache2/sites-enabled/pma state=link
  22. notify:
  23. - Reload apache2
  24. when_boolean: ${with_phpmyadmin} and ${with_apache2}
  25. - name: Install PHP system checks virtual host for apache2 (sites-available)
  26. action: template src=apache2/sys_vhost.j2 dest=/etc/apache2/sites-available/sys owner=root group=root mode=0644
  27. notify:
  28. - Reload apache2
  29. when_boolean: ${with_php} and ${with_apache2}
  30. - name: Install PHP system checks virtual host for apache2 (sites-enabled)
  31. action: file src=/etc/apache2/sites-available/sys path=/etc/apache2/sites-enabled/sys state=link
  32. notify:
  33. - Reload apache2
  34. when_boolean: ${with_php} and ${with_apache2}
  35. - name: Ensure apache2 is running
  36. action: service name=apache2 state=started
  37. when_boolean: ${with_apache2}