-
Is it possible to do connections between different docker instances? e.g: platforms:
- name: pg-master
image: ubuntu:18.04
provision: True
- name: pg-replica
image: ubuntu:18.04
provision: True I need the If it's not supported, any clue on which part should I look when I want to raise a PR? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 3 replies
-
This is really needed for many use-cases. One example is testing Active Directory Setup Roles. |
Beta Was this translation helpful? Give feedback.
-
I've just wrestled with this same problem, and after some pointers from the folks over at IRC found the solution in this platforms:
- name: ${MOLECULE_SCENARIO_NAME}-pdns
image: pdns-alpine:4.2.3
docker_networks:
- name: ${MOLECULE_SCENARIO_NAME}
publish_all_ports: true
env:
PDNS_LOG_LEVEL: "5"
PDNS_WEBSERVER_ALLOWED_FROM: 0.0.0.0/0
pre_build_image: yes
override_command: no
- name: ${MOLECULE_SCENARIO_NAME}-runner
image: python:3.9-alpine-requests
docker_networks:
- name: ${MOLECULE_SCENARIO_NAME}
pre_build_image: true
command: sleep infinity and then I can do things like
and - name: Converge
hosts: localhost
gather_facts: no
tasks:
- name: "Create test zone for a records"
community.docker.docker_container_exec:
container: "{{ groups['all'][0] }}" Basically since the containers are in a custom docker network they can do service discovery based on container names, etc.... |
Beta Was this translation helpful? Give feedback.
-
Be aware though that for some of the CI tests I want to do, I also want the CI container to be a part of the same network for various validations, and to support this use case I've opened #70 such that we can have molecule place the containers in existing networks where we can access the test containers from the molecule container in the same fashion, without molecule attempting to delete the network during destroy step |
Beta Was this translation helpful? Give feedback.
I've just wrestled with this same problem, and after some pointers from the folks over at IRC found the solution in this
and then I can do things like
nslookup -type=a myhost.testzone {{ groups['all'…