Skip to content

Instantly share code, notes, and snippets.

@jpic
Created December 3, 2017 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpic/d4e530c0d37008635592ffa8c1f54844 to your computer and use it in GitHub Desktop.
Save jpic/d4e530c0d37008635592ffa8c1f54844 to your computer and use it in GitHub Desktop.
ansible docker zabbix dockbix, not maintained, pasted here for posterity
---
- 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'] }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment