Skip to content

Commit

Permalink
Create the network before building the docker images
Browse files Browse the repository at this point in the history
Fix #193
  • Loading branch information
ehartmann committed Nov 8, 2022
1 parent 5b26cc6 commit ab96280
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit ab96280

Please sign in to comment.