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.

102 lines
2.5 KiB

7 years ago
  1. - name: configure icinga2-ido-pgsql (host)
  2. debconf:
  3. name: 'icinga2-ido-pgsql'
  4. question: 'icinga2-ido-pgsql/remote/host'
  5. vtype: 'string'
  6. value: 'localhost'
  7. - name: configure icinga2-ido-pgsql (enable)
  8. debconf:
  9. name: 'icinga2-ido-pgsql'
  10. question: 'icinga2-ido-pgsql/enable'
  11. vtype: 'boolean'
  12. value: true
  13. - name: configure icinga2-ido-pgsql (dbconfig-install)
  14. debconf:
  15. name: 'icinga2-ido-pgsql'
  16. question: 'icinga2-ido-pgsql/dbconfig-install'
  17. vtype: 'boolean'
  18. value: true
  19. - name: configure icinga2-ido-pgsql (dbconfig-reinstall)
  20. debconf:
  21. name: 'icinga2-ido-pgsql'
  22. question: 'icinga2-ido-pgsql/dbconfig-reinstall'
  23. vtype: 'boolean'
  24. value: true
  25. # - name: nasty dpkg-reconfigure
  26. # command: "dpkg-reconfigure --frontend noninteractive icinga2-ido-pgsql"
  27. #
  28. # - name: configure icinga2-ido-pgsql (dbconfig-reinstall)
  29. # debconf:
  30. # name: 'icinga2-ido-pgsql'
  31. # question: 'icinga2-ido-pgsql/dbconfig-reinstall'
  32. # vtype: 'boolean'
  33. # value: false
  34. - include_role:
  35. name: service
  36. vars:
  37. service_name: icinga2
  38. service_packages:
  39. - icinga2-ido-pgsql
  40. - monitoring-plugins
  41. - nagios-plugins-contrib
  42. - icinga2
  43. - icingacli
  44. - php-ldap
  45. - php-pgsql
  46. - php-intl
  47. - php-imagick
  48. - icingaweb2-module-monitoring
  49. - icingaweb2
  50. # TODO: log, add a centralized log server
  51. - rsyslog
  52. - rsync
  53. - name: enable ido-pgsql and command features
  54. command: "icinga2 feature enable ido-pgsql command"
  55. register: icinga2_features
  56. changed_when: "'Enabling' in icinga2_features.stdout"
  57. notify: restart icinga2
  58. - name: copy icingaweb2 configuration
  59. synchronize:
  60. src: icingaweb2
  61. dest: /etc
  62. rsync_opts:
  63. - "--chmod Du=rwx,Dg=rwx,Do=,Fu=rw,Fg=rw,Fo= "
  64. - "--chown root:icingaweb2"
  65. - name: enable icingaweb2 monitoring plugin
  66. file:
  67. src: '/usr/share/icingaweb2/modules/monitoring'
  68. dest: '/etc/icingaweb2/enabledModules/monitoring'
  69. state: link
  70. - name:
  71. command: grep -Po 'password = "\K.*?(?=")' /etc/icinga2/features-available/ido-pgsql.conf
  72. register: icinga2_password
  73. changed_when: false
  74. - name: configure icingaweb2 resources
  75. template:
  76. src: icingaweb2/resources.ini.j2
  77. dest: /etc/icingaweb2/resources.ini
  78. owner: root
  79. group: icingaweb2
  80. mode: 0640
  81. - name: create icinga2 hosts directory
  82. file:
  83. path: /home/git/{{ item }}
  84. state: directory
  85. owner: icinga2
  86. group: icinga2
  87. mode: 0770
  88. with_items:
  89. - /etc/icinga2/conf.d/hosts/