apache2.yml 1.0 KB

1234567891011121314151617181920212223242526
  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=apache2 state=installed update_cache=yes
  11. when_boolean: ${with_apache2} and ${with_apache2_modphp5}
  12. - name: Install php5 basic security configuration
  13. action: template dest=/etc/php5/apache2/conf.d/security-local.ini owner=root group=root mode=0644
  14. first_available_file:
  15. - apache2/php5/security-local.${ansible_hostname}.ini.j2
  16. - apache2/php5/security-local.ini.j2
  17. notify:
  18. - Reload apache2
  19. when_boolean: ${with_apache2} and ${with_apache2_modphp5}
  20. - name: Ensure apache2 is running
  21. action: service name=apache2 state=started
  22. when_boolean: ${with_apache2}