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.

55 lines
1.5 KiB

  1. ---
  2. - name: 'create riot-web folder'
  3. file:
  4. path: '/srv/riot-web'
  5. state: 'directory'
  6. mode: '0755'
  7. owner: 'www-data'
  8. group: 'www-data'
  9. tags:
  10. - 'packages'
  11. - name: 'download riot-web'
  12. unarchive:
  13. src: "https://github.com/vector-im/element-web/releases/download/\
  14. {{ riot_web_version }}/element-{{ riot_web_version }}.tar.gz"
  15. dest: '/srv/riot-web'
  16. remote_src: true
  17. owner: 'www-data'
  18. group: 'www-data'
  19. tags:
  20. - 'packages'
  21. - name: 'configure nginx location'
  22. template:
  23. src: 'riot.conf'
  24. dest: '/etc/nginx/locations/{{ riot_web_nginx_fqdn }}/riot.conf'
  25. notify:
  26. - 'reload nginx'
  27. - name: 'configure riot web'
  28. template:
  29. src: 'config.json.j2'
  30. dest: '/srv/riot-web/riot-{{ riot_web_version }}/config.json'
  31. - name: 'MONITORING | add HTTP service'
  32. block:
  33. - name: 'MONITORING | add service to monitoring entry'
  34. set_fact:
  35. monitoring_entry: >
  36. {{ monitoring_entry | default({}) | combine({
  37. 'address': ansible_host,
  38. 'vhosts_uri': { riot_web_nginx_fqdn: {'/': '<title>Riot</title>'} },
  39. }, recursive=true) }}
  40. - name: 'MONITORING | update monitoring facts'
  41. set_fact:
  42. monitoring_facts: >
  43. {{ hostvars[monitoring_host]['monitoring_facts']
  44. | default({})
  45. | combine({host_fqdn: monitoring_entry}) }}
  46. delegate_facts: true
  47. delegate_to: '{{ monitoring_host }}'
  48. tags:
  49. - 'monitoring'
  50. ...