Guest User

Untitled

a guest
Dec 5th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. ---
  2.  
  3. - hosts: all
  4.  
  5. become: true
  6. become_method: sudo
  7. become_user: root
  8.  
  9. tasks:
  10. - name: Create zabbix network
  11. docker_network:
  12. name: zabbix
  13.  
  14. - name: Create zabbix-mariadb container
  15. docker_container:
  16. name: zabbix-mariadb
  17. image: monitoringartist/zabbix-db-mariadb
  18. restart_policy: always
  19. networks:
  20. - name: zabbix
  21. volumes:
  22. - /data/zabbix/mysql:/var/lib/mysql
  23. - /data/zabbix/backups:/backups
  24. - /etc/localtime:/etc/localtime:ro
  25. env:
  26. MARIADB_PASS: '{{ zabbix_mariadb_password }}'
  27. MARIADB_USER: zabbix
  28.  
  29. - name: Create dockbix container
  30. register: dockbix_container
  31. docker_container:
  32. name: dockbix
  33. hostname: dockbix
  34. image: monitoringartist/dockbix-xxl:3.4.2
  35. restart_policy: unless-stopped
  36. exposed_ports: ['80', '10051']
  37. networks:
  38. - name: zabbix
  39. volumes:
  40. - /etc/localtime:/etc/localtime:ro
  41. env:
  42. ZS_DBHost: zabbix-mariadb
  43. ZS_DBUser: zabbix
  44. ZS_DBPassword: '{{ zabbix_mariadb_password }}'
  45. XXL_zapix: 'true'
  46. XXL_grapher: 'true'
  47. PHP_TZ: Europe/Paris
  48. LETSENCRYPT_EMAIL: '{{ letsencrypt_email }}'
  49. LETSENCRYPT_HOST: '{{ zabbix_dns }}'
  50. VIRTUAL_HOST: '{{ zabbix_dns }}'
  51.  
  52. - name: Create dockbix-agent container
  53. docker_container:
  54. name: dockbix-agent
  55. image: monitoringartist/dockbix-agent-xxl-limited:3.4-3
  56. restart_policy: unless-stopped
  57. network_mode: host
  58. volumes:
  59. - /etc/localtime:/etc/localtime:ro
  60. - /:/rootfs
  61. - /var/run:/var/run
  62. env:
  63. ZA_Server: "{{ dockbix_container['ansible_facts']['docker_container']['NetworkSettings']['IPAddress'] }}"
  64. ZA_ServerActive: "{{ dockbix_container['ansible_facts']['docker_container']['NetworkSettings']['IPAddress'] }}"
Add Comment
Please, Sign In to add comment