Skip to content

Commit

Permalink
don't always require community.docker
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Sep 5, 2024
1 parent 28b1090 commit c9eed1f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
1 change: 0 additions & 1 deletion tests/test_playbooks/inventory_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
postgres_host: "postgres"
postgres_port: 5432
collections:
- community.docker
- theforeman.foreman
tasks:
- name: test inventory
Expand Down
1 change: 0 additions & 1 deletion tests/test_playbooks/inventory_plugin_ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
postgres_host: "postgresansible"
postgres_port: 5433
collections:
- community.docker
- theforeman.foreman
tasks:
- name: test inventory
Expand Down
8 changes: 1 addition & 7 deletions tests/test_playbooks/tasks/inventory_plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
include_tasks: inventory_plugin_tests.yml
always:
- name: remove containers
docker_container:
name: "{{ item }}"
state: absent
loop:
- "{{ foreman_host }}"
- "{{ foreman_host }}dynflow"
- "{{ postgres_host }}"
include_tasks: inventory_plugin_teardown_container.yml
when:
- inventory_use_container | bool
10 changes: 5 additions & 5 deletions tests/test_playbooks/tasks/inventory_plugin_setup_container.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
- name: fetch PostgreSQL container
docker_image:
community.docker.docker_image:
name: docker.io/library/postgres:{{ postgres_version }}
source: pull

- name: fetch Foreman container
docker_image:
community.docker.docker_image:
name: "{{ foreman_container }}:{{ foreman_version }}"
source: pull

- name: start PostgreSQL container
docker_container:
community.docker.docker_container:
name: "{{ postgres_host }}"
image: docker.io/library/postgres:{{ postgres_version }}
env:
Expand All @@ -22,7 +22,7 @@
- "0.0.0.0:{{ postgres_port }}:5432"

- name: start Foreman container
docker_container:
community.docker.docker_container:
name: "{{ foreman_host }}"
image: "{{ foreman_container }}:{{ foreman_version }}"
command: bash -c "bundle exec bin/rails db:create db:migrate && bundle exec bin/rails db:seed && bundle exec bin/rails server -b 0.0.0.0"
Expand All @@ -46,7 +46,7 @@
delay: 10

- name: start dynflow container
docker_container:
community.docker.docker_container:
name: "{{ foreman_host }}dynflow"
image: "{{ foreman_container }}:{{ foreman_version }}"
command: bash -c "bundle exec rake dynflow:executor"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: remove containers
community.docker.docker_container:
name: "{{ item }}"
state: absent
loop:
- "{{ foreman_host }}"
- "{{ foreman_host }}dynflow"
- "{{ postgres_host }}"

0 comments on commit c9eed1f

Please sign in to comment.