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.

48 lines
1.2 KiB

8 years ago
8 years ago
8 years ago
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: nginx
  6. service_packages:
  7. - nginx
  8. - name: disable nginx default configuration
  9. file: path=/etc/nginx/sites-enabled/default state=absent
  10. notify: restart nginx
  11. - name: install php5-fpm
  12. apt:
  13. name: "{{ item }}"
  14. state: present
  15. update_cache: yes
  16. cache_valid_time: 3600
  17. with_items:
  18. - php5-fpm
  19. when: php | bool
  20. notify:
  21. - restart nginx
  22. - name: upload nginx proxy configuration
  23. template:
  24. src: proxy_nginx.j2
  25. dest: "/etc/nginx/sites-available/{{ config_name }}"
  26. when: is_proxy | bool
  27. notify:
  28. - enable nginx configuration
  29. - restart nginx
  30. - name: add nginx configurations
  31. template:
  32. src: "roles/{{ parent_role_path }}/templates/{{ item }}.conf.nginx.j2"
  33. dest: /etc/nginx/sites-available/{{ item }}.conf
  34. with_items: "{{ config_names }}"
  35. when: config_names is defined
  36. - name: enable nginx configurations
  37. file:
  38. src: "/etc/nginx/sites-available/{{ item }}.conf"
  39. dest: "/etc/nginx/sites-enabled/{{ item }}.conf"
  40. state: link
  41. with_items: "{{ config_names }}"
  42. when: config_names is defined
  43. notify: restart nginx