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.

50 lines
1.3 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. with_items: "{{ config_names }}"
  27. - name: enable apache2 configurations
  28. file:
  29. src: "/etc/apache2/sites-available/{{ item }}"
  30. dest: "/etc/apache2/sites-enabled/{{ item }}"
  31. state: link
  32. with_items: "{{ config_names }}"
  33. notify: restart apache2
  34. - block:
  35. - name: enable apache userdir module
  36. apache2_module: state=present name=userdir
  37. notify: restart apache2
  38. - name: create public_html in /etc/skel
  39. file:
  40. path: /etc/skel/public_html
  41. state: directory
  42. mode: 660
  43. when: user_dir | bool