docker_swarm inventory plugin: extend tests (#53913)

* Extend tests.

* Update BOTMETA so that docker* inventory tests are associated with .
This commit is contained in:
Felix Fontein
2019-03-17 11:28:55 +01:00
committed by John R Barker
parent f20575e2a8
commit 35b295f6af
5 changed files with 32 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
plugin: docker_swarm
host: unix://var/run/docker.sock
verbose_output: no
include_host_uri: yes

View File

@@ -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

View File

@@ -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

View File

@@ -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