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