mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
docker_swarm inventory plugin: extend tests (#53913)
* Extend tests. * Update BOTMETA so that docker* inventory tests are associated with .
This commit is contained in:
committed by
John R Barker
parent
f20575e2a8
commit
35b295f6af
@@ -0,0 +1,5 @@
|
||||
---
|
||||
plugin: docker_swarm
|
||||
host: unix://var/run/docker.sock
|
||||
verbose_output: no
|
||||
include_host_uri: yes
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user