Playbooks to a new Lilik
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.

39 lines
1.0 KiB

8 years ago
8 years ago
  1. ---
  2. - include: service.yaml
  3. # static: yes # see static include issue: https://github.com/ansible/ansible/issues/13485
  4. vars:
  5. service_name: apache2
  6. service_packages:
  7. - apache2
  8. - name: disable apache2 default configuration
  9. file: path=/etc/apache2/sites-enabled/000-default.conf state=absent
  10. notify: restart apache2
  11. - name: install apache2 libapache2-mod-php5
  12. apt:
  13. name: "{{ item }}"
  14. state: present
  15. update_cache: yes
  16. cache_valid_time: 3600
  17. with_items:
  18. - libapache2-mod-php5
  19. when: php | bool
  20. notify:
  21. - restart apache2
  22. - name: add apache2 configurations
  23. template:
  24. src: ../../{{ parent_role_path }}/templates/{{ item }}.apache2.j2
  25. dest: /etc/apache2/sites-available/{{ item }}
  26. when: config_names is defined
  27. with_items: "{{ config_names }}"
  28. - name: enable apache2 configurations
  29. file:
  30. src: "/etc/apache2/sites-available/{{ item }}"
  31. dest: "/etc/apache2/sites-enabled/{{ item }}"
  32. state: link
  33. with_items: "{{ config_names }}"
  34. when: config_names is defined
  35. notify: restart apache2