Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Create the network before building the docker images #194

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/molecule_docker/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@
- not item.pre_build_image | default(false)
register: docker_images

- name: Create docker network(s)
ansible.builtin.include_tasks: tasks/create_network.yml
with_items: "{{ molecule_yml.platforms | molecule_get_docker_networks(molecule_labels) }}"
loop_control:
label: "{{ item.name }}"
no_log: false

- name: Build an Ansible compatible image (new) # noqa: no-handler
when:
- platforms.changed or docker_images.results | map(attribute='images') | select('equalto', []) | list | count >= 0
Expand Down Expand Up @@ -111,13 +118,6 @@
retries: 3
delay: 30

- name: Create docker network(s)
ansible.builtin.include_tasks: tasks/create_network.yml
with_items: "{{ molecule_yml.platforms | molecule_get_docker_networks(molecule_labels) }}"
loop_control:
label: "{{ item.name }}"
no_log: false

- name: Determine the CMD directives
ansible.builtin.set_fact:
command_directives_dict: >-
Expand Down