Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2017
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. cat playbooks.yml
  2. ---
  3. - hosts: SQL
  4. become: true
  5. become_method: sudo
  6. pre_tasks:
  7. - name: install nescessary package
  8. yum:
  9. name: "{{ item }}"
  10. state: installed
  11. with_items:
  12. - policycoreutils-python
  13. vars:
  14. mysql_version: "10.1.28"
  15. mysql_databases:
  16. - name: "icinga2"
  17. encoding: "utf8"
  18. collation: "utf8_general_ci"
  19. - name: "icingaweb2"
  20. encoding': "utf8"
  21. collation: "utf8_general_ci"
  22. mysql_users:
  23. - name: icinga2
  24. host: '%'
  25. password: icinga2dbpasswd
  26. priv: "icinga2.*:ALL"
  27. - name: icingaweb2
  28. host: '%'
  29. password: icingaweb2dbpasswd
  30. priv: "icingaweb2.*:ALL"
  31. roles:
  32. - ansible-role-mariadb-maat
  33.  
  34. - hosts: Master
  35. gather_facts: yes
  36. become: true
  37. become_method: sudo
  38. vars:
  39. icinga2_master_node: True
  40. repos:
  41. - name: epel
  42. url: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
  43. gpg_key: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}"
  44. - name: "remi"
  45. url: "http://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm"
  46. gpg_key: "http://rpms.remirepo.net/RPM-GPG-KEY-remi"
  47. - name: "ICINGA-release"
  48. url: "https://packages.icinga.com/epel/{{ ansible_distribution_major_version }}/release/noarch/icinga-rpm-release-{{ ansible_distribution_major_version }}-1.el{{ ansible_distribution_major_version }}.centos.noarch.rpm"
  49. gpg_key: "https://packages.icinga.org/icinga.key"
  50. php_executable: php70
  51. php_version: 70
  52. php_opcache_enable: 0
  53. php_packages_extra:
  54. - php-mysqlnd
  55. - php-pecl-apcu
  56. - php-pecl-zendopcache
  57. php_enable_php_fpm: true
  58. nginx_vhosts:
  59. - listen: 80
  60. server_name: icinga2.localdomain
  61. root: /usr/share/icingaweb2/public
  62. index: index.php
  63. access_log: /var/log/nginx/icingaweb2.log
  64. error_log: /var/log/nginx/icingaweb2.err
  65. state: present
  66. template: "{{ nginx_vhost_template }}"
  67. filename: icingaweb2.conf
  68. extra_parameters: |
  69. location ~ ^/icingaweb2/index\.php(.*)$ {
  70. fastcgi_pass 127.0.0.1:9000;
  71. fastcgi_index index.php;
  72. include fastcgi_params;
  73. fastcgi_param SCRIPT_FILENAME /usr/share/icingaweb2/public/index.php;
  74. fastcgi_param ICINGAWEB_CONFIGDIR /etc/icingaweb2;
  75. fastcgi_param REMOTE_USER $remote_user;
  76. }
  77.  
  78. location ~ ^/icingaweb2(.+)? {
  79. alias /usr/share/icingaweb2/public;
  80. index index.php;
  81. try_files $1 $uri $uri/ /icingaweb2/index.php$is_args$args;
  82. }
  83. icinga2_icingaweb2: true
  84. icinga2_icingaweb2_httpd_service: nginx
  85. icinga2_database:
  86. name: icinga2
  87. user: icinga2
  88. password: icinga2dbpasswd
  89. host: 172.16.0.152
  90. icinga2_icingaweb2_database:
  91. name: icingaweb2
  92. user: icingaweb2
  93. password: icingaweb2dbpasswd
  94. host: 172.16.0.152
  95. roles:
  96. - ansible-role-repository-adder-maat
  97. - ansible-role-nginx-maat
  98. - role: ansible-role-php-maat
  99. when:
  100. - icinga2_icingaweb2
  101. - ((not icinga2_master_node and not icinga2_satellite and not icinga2_client ) or ( icinga2_master_node and not icinga2_satellite and not icinga2_client ) )
  102. - ansible-role-icinga2-maat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement