Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: all
- become: true
- become_method: sudo
- become_user: root
- tasks:
- - name: Create zabbix network
- docker_network:
- name: zabbix
- - name: Create zabbix-mariadb container
- docker_container:
- name: zabbix-mariadb
- image: monitoringartist/zabbix-db-mariadb
- restart_policy: always
- networks:
- - name: zabbix
- volumes:
- - /data/zabbix/mysql:/var/lib/mysql
- - /data/zabbix/backups:/backups
- - /etc/localtime:/etc/localtime:ro
- env:
- MARIADB_PASS: '{{ zabbix_mariadb_password }}'
- MARIADB_USER: zabbix
- - name: Create dockbix container
- register: dockbix_container
- docker_container:
- name: dockbix
- hostname: dockbix
- image: monitoringartist/dockbix-xxl:3.4.2
- restart_policy: unless-stopped
- exposed_ports: ['80', '10051']
- networks:
- - name: zabbix
- volumes:
- - /etc/localtime:/etc/localtime:ro
- env:
- ZS_DBHost: zabbix-mariadb
- ZS_DBUser: zabbix
- ZS_DBPassword: '{{ zabbix_mariadb_password }}'
- XXL_zapix: 'true'
- XXL_grapher: 'true'
- PHP_TZ: Europe/Paris
- LETSENCRYPT_EMAIL: '{{ letsencrypt_email }}'
- LETSENCRYPT_HOST: '{{ zabbix_dns }}'
- VIRTUAL_HOST: '{{ zabbix_dns }}'
- - name: Create dockbix-agent container
- docker_container:
- name: dockbix-agent
- image: monitoringartist/dockbix-agent-xxl-limited:3.4-3
- restart_policy: unless-stopped
- network_mode: host
- volumes:
- - /etc/localtime:/etc/localtime:ro
- - /:/rootfs
- - /var/run:/var/run
- env:
- ZA_Server: "{{ dockbix_container['ansible_facts']['docker_container']['NetworkSettings']['IPAddress'] }}"
- ZA_ServerActive: "{{ dockbix_container['ansible_facts']['docker_container']['NetworkSettings']['IPAddress'] }}"
Add Comment
Please, Sign In to add comment