diff --git a/.github/BOTMETA.yml b/.github/BOTMETA.yml index cc9db43edf9..ed15c1e004e 100644 --- a/.github/BOTMETA.yml +++ b/.github/BOTMETA.yml @@ -1115,7 +1115,7 @@ files: # plugins/inventory $plugins/inventory/__init__.py: support: core - $plugins/inventory/docker_swarm.py: *docker + $plugins/inventory/docker: *docker $plugins/inventory/gcp_compute.py: maintainers: $team_google supershipit: $team_google @@ -1327,6 +1327,10 @@ files: test/integration/targets/gcp: maintainers: $team_google supershipit: $team_google + test/integration/targets/inventory_docker: *docker + test/integration/targets/inventory_docker_swarm: + <<: *docker + maintainers: $team_docker morph027 test/integration/targets/meraki: *meraki test/integration/targets/mso: *aci test/integration/targets/mysql: *mysql diff --git a/test/integration/targets/inventory_docker_swarm/inventory_2.docker_swarm.yml b/test/integration/targets/inventory_docker_swarm/inventory_2.docker_swarm.yml new file mode 100644 index 00000000000..4c9addd51bf --- /dev/null +++ b/test/integration/targets/inventory_docker_swarm/inventory_2.docker_swarm.yml @@ -0,0 +1,5 @@ +--- +plugin: docker_swarm +host: unix://var/run/docker.sock +verbose_output: no +include_host_uri: yes diff --git a/test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_1.yml b/test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_1.yml index 9dd85fc2b3b..1f80bcce941 100644 --- a/test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_1.yml +++ b/test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_1.yml @@ -29,6 +29,10 @@ debug: var: ansible_host + - name: Make sure docker_swarm_node_attributes is available + assert: + that: + - docker_swarm_node_attributes is not undefined - name: Print docker_swarm_node_attributes per host debug: var: docker_swarm_node_attributes diff --git a/test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_2.yml b/test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_2.yml new file mode 100644 index 00000000000..97283c2c48a --- /dev/null +++ b/test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_2.yml @@ -0,0 +1,15 @@ +--- +- hosts: all + connection: local # otherwise Ansible will complain that it cannot connect via ssh to 127.0.0.1:22 + tasks: + - name: Make sure docker_swarm_node_attributes is not available + assert: + that: + - docker_swarm_node_attributes is undefined + - name: Make sure ansible_host_uri is available + assert: + that: + - ansible_host_uri is defined + - name: Print ansible_host_uri + debug: + var: ansible_host_uri diff --git a/test/integration/targets/inventory_docker_swarm/runme.sh b/test/integration/targets/inventory_docker_swarm/runme.sh index 3eb775a700c..53e1760b054 100755 --- a/test/integration/targets/inventory_docker_swarm/runme.sh +++ b/test/integration/targets/inventory_docker_swarm/runme.sh @@ -18,3 +18,6 @@ ansible-playbook playbooks/swarm_setup.yml echo "Test docker_swarm inventory 1" ansible-playbook -i inventory_1.docker_swarm.yml playbooks/test_inventory_1.yml + +echo "Test docker_swarm inventory 2" +ansible-playbook -i inventory_2.docker_swarm.yml playbooks/test_inventory_2.yml