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.

46 lines
1.2 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 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. - name: enable nginx configurations
  36. file:
  37. src: "/etc/nginx/sites-available/{{ item }}.conf"
  38. dest: "/etc/nginx/sites-enabled/{{ item }}.conf"
  39. state: link
  40. with_items: "{{ config_names }}"
  41. notify: restart nginx