Last active
August 29, 2022 13:31
-
-
Save shantanoo-desai/13dd1c5609bbe32142ef073d29f53a75 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
chronograf: | |
image: chronograf:{{ services.chronograf.version }} | |
container_name: chronograf | |
{% if 'influxdb' in services %} | |
depends_on: | |
- influxdb | |
{% endif %} | |
environment: | |
- BASE_PATH=/chronograf | |
{% if 'influxdb' in services %} | |
- INFLUXDB_URL=http://influxdb:8086 | |
{% endif %} | |
hostname: chronograf | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.chronograf-router=chronograf-router@file" | |
- "traefik.http.routers.chronograf-router.service=chronograf@file" | |
security_opt: | |
- "no-new-privileges:true" | |
volumes: | |
- chronograf:/var/lib/chronograf | |
- /etc/timezone:/etc/timezone:ro | |
- /etc/localtime:/etc/localtime:ro | |
volumes: | |
chronograf: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
influxdb: | |
container_name: influxdb | |
image: influxdb:{{ services.influxdb.version }} | |
environment: | |
- INFLUXDB_HTTP_AUTH_ENABLED=true | |
- INFLUXDB_REPORTING_DISABLED=true | |
- INFLUXDB_DATA_QUERY_LOG_ENABLED=false | |
- INFLUXDB_HTTP_LOG_ENABLED=false | |
- INFLUXDB_CONTINUOUS_QUERIES_LOG_ENABLED=false | |
hostname: populo-influxdb | |
security_opt: | |
- "no-new-privileges:true" | |
volumes: | |
- influxdb:/var/lib/influxdb | |
- /etc/timezone:/etc/timezone:ro | |
- /etc/localtime:/etc/localtime:ro | |
volumes: | |
influxdb: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TASK [pacedge : Copy Services Compose Files] ********************************************************************************************************************************************************* | |
ok: [localhost] => (item=chronograf) | |
ok: [localhost] => (item=influxdb) | |
TASK [pacedge : Docker Compose with multiple Compose Files (v2)] ************************************************************************************************************************************* | |
ok: [localhost] => (item=influxdb) | |
failed: [localhost] (item=chronograf) => {"ansible_loop_var": "item", "changed": false, "item": "chronograf", "msg": "Configuration error - Service 'chronograf' depends on service 'influxdb' which is undefined."} | |
PLAY RECAP ******************************************************************************************************************************************************************************************* | |
localhost : ok=4 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- host: all | |
tasks: | |
- name: Copy Services Compose Files | |
template: | |
src: "services/docker-compose.{{ item }}.yml.j2" | |
dest: "/home/test/influxstack/docker-compose.{{ item }}.yml" | |
with_items: | |
- "{{ services.keys() }}" | |
- name: Docker Compose with multiple Compose Files (v2) | |
community.docker.docker_compose: | |
project_name: influxstack | |
project_src: /home/test/influxstack | |
files: | |
- "docker-compose.{{ item }}.yml" | |
state: present | |
with_items: | |
- "{{ services.keys() | sort(reverse=True) }}" # Try bringing influxdb up first since chronograf depends on it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resources
files
][2][1]: https://stackoverflow.com/questions/62452039/how-to-run-docker-compose-commands-with-ansible
[2]: https://docs.ansible.com/ansible/latest/collections/community/docker/docker_compose_module.html#parameter-files