summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/inventory_docker_swarm
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2019-03-17 11:28:55 +0100
committerJohn R Barker <john@johnrbarker.com>2019-03-17 11:28:55 +0100
commit35b295f6af0fccd6cc35eb9c6a95d8f362800b41 (patch)
treebd173725d29136dd439173e9477aae6966d885fc /test/integration/targets/inventory_docker_swarm
parenttests: vultr_server: adjust plan names, fixes integration test (#53914) (diff)
downloadansible-35b295f6af0fccd6cc35eb9c6a95d8f362800b41.tar.xz
ansible-35b295f6af0fccd6cc35eb9c6a95d8f362800b41.zip
docker_swarm inventory plugin: extend tests (#53913)
* Extend tests. * Update BOTMETA so that docker* inventory tests are associated with .
Diffstat (limited to 'test/integration/targets/inventory_docker_swarm')
-rw-r--r--test/integration/targets/inventory_docker_swarm/inventory_2.docker_swarm.yml5
-rw-r--r--test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_1.yml4
-rw-r--r--test/integration/targets/inventory_docker_swarm/playbooks/test_inventory_2.yml15
-rwxr-xr-xtest/integration/targets/inventory_docker_swarm/runme.sh3
4 files changed, 27 insertions, 0 deletions
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 0000000000..4c9addd51b
--- /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 9dd85fc2b3..1f80bcce94 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 0000000000..97283c2c48
--- /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 3eb775a700..53e1760b05 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