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.

51 lines
1.3 KiB

8 years ago
8 years ago
  1. ---
  2. - include_role:
  3. name: service
  4. # static: yes # see static include issue: https://github.com/ansible/ansible/issues/13485
  5. vars:
  6. service_name: apache2
  7. service_packages:
  8. - apache2
  9. - name: disable apache2 default configuration
  10. file: path=/etc/apache2/sites-enabled/000-default.conf state=absent
  11. notify: restart apache2
  12. - name: install apache2 libapache2-mod-php5
  13. apt:
  14. name: "{{ item }}"
  15. state: present
  16. update_cache: yes
  17. cache_valid_time: 3600
  18. with_items:
  19. - libapache2-mod-php5
  20. when: php | bool
  21. notify:
  22. - restart apache2
  23. - name: add apache2 configurations
  24. template:
  25. src: ../../{{ parent_role_path }}/templates/{{ item }}.apache2.j2
  26. dest: /etc/apache2/sites-available/{{ item }}
  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. notify: restart apache2
  35. - block:
  36. - name: enable apache userdir module
  37. apache2_module: state=present name=userdir
  38. notify: restart apache2
  39. - name: create public_html in /etc/skel
  40. file:
  41. path: /etc/skel/public_html
  42. state: directory
  43. mode: 660
  44. when: user_dir | bool