Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cat playbooks.yml
- ---
- - hosts: SQL
- become: true
- become_method: sudo
- pre_tasks:
- - name: install nescessary package
- yum:
- name: "{{ item }}"
- state: installed
- with_items:
- - policycoreutils-python
- vars:
- mysql_version: "10.1.28"
- mysql_databases:
- - name: "icinga2"
- encoding: "utf8"
- collation: "utf8_general_ci"
- - name: "icingaweb2"
- encoding': "utf8"
- collation: "utf8_general_ci"
- mysql_users:
- - name: icinga2
- host: '%'
- password: icinga2dbpasswd
- priv: "icinga2.*:ALL"
- - name: icingaweb2
- host: '%'
- password: icingaweb2dbpasswd
- priv: "icingaweb2.*:ALL"
- roles:
- - ansible-role-mariadb-maat
- - hosts: Master
- gather_facts: yes
- become: true
- become_method: sudo
- vars:
- icinga2_master_node: True
- repos:
- - name: epel
- url: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm"
- gpg_key: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}"
- - name: "remi"
- url: "http://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm"
- gpg_key: "http://rpms.remirepo.net/RPM-GPG-KEY-remi"
- - name: "ICINGA-release"
- 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"
- gpg_key: "https://packages.icinga.org/icinga.key"
- php_executable: php70
- php_version: 70
- php_opcache_enable: 0
- php_packages_extra:
- - php-mysqlnd
- - php-pecl-apcu
- - php-pecl-zendopcache
- php_enable_php_fpm: true
- nginx_vhosts:
- - listen: 80
- server_name: icinga2.localdomain
- root: /usr/share/icingaweb2/public
- index: index.php
- access_log: /var/log/nginx/icingaweb2.log
- error_log: /var/log/nginx/icingaweb2.err
- state: present
- template: "{{ nginx_vhost_template }}"
- filename: icingaweb2.conf
- extra_parameters: |
- location ~ ^/icingaweb2/index\.php(.*)$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME /usr/share/icingaweb2/public/index.php;
- fastcgi_param ICINGAWEB_CONFIGDIR /etc/icingaweb2;
- fastcgi_param REMOTE_USER $remote_user;
- }
- location ~ ^/icingaweb2(.+)? {
- alias /usr/share/icingaweb2/public;
- index index.php;
- try_files $1 $uri $uri/ /icingaweb2/index.php$is_args$args;
- }
- icinga2_icingaweb2: true
- icinga2_icingaweb2_httpd_service: nginx
- icinga2_database:
- name: icinga2
- user: icinga2
- password: icinga2dbpasswd
- host: 172.16.0.152
- icinga2_icingaweb2_database:
- name: icingaweb2
- user: icingaweb2
- password: icingaweb2dbpasswd
- host: 172.16.0.152
- roles:
- - ansible-role-repository-adder-maat
- - ansible-role-nginx-maat
- - role: ansible-role-php-maat
- when:
- - icinga2_icingaweb2
- - ((not icinga2_master_node and not icinga2_satellite and not icinga2_client ) or ( icinga2_master_node and not icinga2_satellite and not icinga2_client ) )
- - ansible-role-icinga2-maat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement