mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-19 05:22:36 +00:00
Use multiple YAML documents for inventory plugin examples. (#1023)
This commit is contained in:
parent
4aed658919
commit
29ff1241ce
@ -110,19 +110,23 @@ options:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
---
|
||||||
# Minimal example using local Docker daemon
|
# Minimal example using local Docker daemon
|
||||||
plugin: community.docker.docker_containers
|
plugin: community.docker.docker_containers
|
||||||
docker_host: unix:///var/run/docker.sock
|
docker_host: unix:///var/run/docker.sock
|
||||||
|
|
||||||
|
---
|
||||||
# Minimal example using remote Docker daemon
|
# Minimal example using remote Docker daemon
|
||||||
plugin: community.docker.docker_containers
|
plugin: community.docker.docker_containers
|
||||||
docker_host: tcp://my-docker-host:2375
|
docker_host: tcp://my-docker-host:2375
|
||||||
|
|
||||||
|
---
|
||||||
# Example using remote Docker daemon with unverified TLS
|
# Example using remote Docker daemon with unverified TLS
|
||||||
plugin: community.docker.docker_containers
|
plugin: community.docker.docker_containers
|
||||||
docker_host: tcp://my-docker-host:2376
|
docker_host: tcp://my-docker-host:2376
|
||||||
tls: true
|
tls: true
|
||||||
|
|
||||||
|
---
|
||||||
# Example using remote Docker daemon with verified TLS and client certificate verification
|
# Example using remote Docker daemon with verified TLS and client certificate verification
|
||||||
plugin: community.docker.docker_containers
|
plugin: community.docker.docker_containers
|
||||||
docker_host: tcp://my-docker-host:2376
|
docker_host: tcp://my-docker-host:2376
|
||||||
@ -131,6 +135,7 @@ ca_path: /somewhere/ca.pem
|
|||||||
client_key: /somewhere/key.pem
|
client_key: /somewhere/key.pem
|
||||||
client_cert: /somewhere/cert.pem
|
client_cert: /somewhere/cert.pem
|
||||||
|
|
||||||
|
---
|
||||||
# Example using constructed features to create groups
|
# Example using constructed features to create groups
|
||||||
plugin: community.docker.docker_containers
|
plugin: community.docker.docker_containers
|
||||||
docker_host: tcp://my-docker-host:2375
|
docker_host: tcp://my-docker-host:2375
|
||||||
@ -143,6 +148,7 @@ keyed_groups:
|
|||||||
- prefix: os
|
- prefix: os
|
||||||
key: docker_platform
|
key: docker_platform
|
||||||
|
|
||||||
|
---
|
||||||
# Example using SSH connection with an explicit fallback for when port 22 has not been
|
# Example using SSH connection with an explicit fallback for when port 22 has not been
|
||||||
# exported: use container name as ansible_ssh_host and 22 as ansible_ssh_port
|
# exported: use container name as ansible_ssh_host and 22 as ansible_ssh_port
|
||||||
plugin: community.docker.docker_containers
|
plugin: community.docker.docker_containers
|
||||||
@ -151,6 +157,7 @@ compose:
|
|||||||
ansible_ssh_host: ansible_ssh_host | default(docker_name[1:], true)
|
ansible_ssh_host: ansible_ssh_host | default(docker_name[1:], true)
|
||||||
ansible_ssh_port: ansible_ssh_port | default(22, true)
|
ansible_ssh_port: ansible_ssh_port | default(22, true)
|
||||||
|
|
||||||
|
---
|
||||||
# Only consider containers which have a label 'foo', or whose name starts with 'a'
|
# Only consider containers which have a label 'foo', or whose name starts with 'a'
|
||||||
plugin: community.docker.docker_containers
|
plugin: community.docker.docker_containers
|
||||||
filters:
|
filters:
|
||||||
|
|||||||
@ -61,9 +61,11 @@ options:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
---
|
||||||
# Minimal example
|
# Minimal example
|
||||||
plugin: community.docker.docker_machine
|
plugin: community.docker.docker_machine
|
||||||
|
|
||||||
|
---
|
||||||
# Example using constructed features to create a group per Docker Machine driver
|
# Example using constructed features to create a group per Docker Machine driver
|
||||||
# (https://docs.docker.com/machine/drivers/), for example:
|
# (https://docs.docker.com/machine/drivers/), for example:
|
||||||
# $ docker-machine create --driver digitalocean ... mymachine
|
# $ docker-machine create --driver digitalocean ... mymachine
|
||||||
@ -76,18 +78,23 @@ plugin: community.docker.docker_machine
|
|||||||
# ]
|
# ]
|
||||||
# ...
|
# ...
|
||||||
# }
|
# }
|
||||||
|
plugin: community.docker.docker_machine
|
||||||
strict: false
|
strict: false
|
||||||
keyed_groups:
|
keyed_groups:
|
||||||
- separator: ''
|
- separator: ''
|
||||||
key: docker_machine_node_attributes.DriverName
|
key: docker_machine_node_attributes.DriverName
|
||||||
|
|
||||||
|
---
|
||||||
# Example grouping hosts by Digital Machine tag
|
# Example grouping hosts by Digital Machine tag
|
||||||
|
plugin: community.docker.docker_machine
|
||||||
strict: false
|
strict: false
|
||||||
keyed_groups:
|
keyed_groups:
|
||||||
- prefix: tag
|
- prefix: tag
|
||||||
key: 'dm_tags'
|
key: 'dm_tags'
|
||||||
|
|
||||||
|
---
|
||||||
# Example using compose to override the default SSH behaviour of asking the user to accept the remote host key
|
# Example using compose to override the default SSH behaviour of asking the user to accept the remote host key
|
||||||
|
plugin: community.docker.docker_machine
|
||||||
compose:
|
compose:
|
||||||
ansible_ssh_common_args: '"-o StrictHostKeyChecking=accept-new"'
|
ansible_ssh_common_args: '"-o StrictHostKeyChecking=accept-new"'
|
||||||
'''
|
'''
|
||||||
|
|||||||
@ -107,19 +107,23 @@ options:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
---
|
||||||
# Minimal example using local docker
|
# Minimal example using local docker
|
||||||
plugin: community.docker.docker_swarm
|
plugin: community.docker.docker_swarm
|
||||||
docker_host: unix:///var/run/docker.sock
|
docker_host: unix:///var/run/docker.sock
|
||||||
|
|
||||||
|
---
|
||||||
# Minimal example using remote docker
|
# Minimal example using remote docker
|
||||||
plugin: community.docker.docker_swarm
|
plugin: community.docker.docker_swarm
|
||||||
docker_host: tcp://my-docker-host:2375
|
docker_host: tcp://my-docker-host:2375
|
||||||
|
|
||||||
|
---
|
||||||
# Example using remote docker with unverified TLS
|
# Example using remote docker with unverified TLS
|
||||||
plugin: community.docker.docker_swarm
|
plugin: community.docker.docker_swarm
|
||||||
docker_host: tcp://my-docker-host:2376
|
docker_host: tcp://my-docker-host:2376
|
||||||
tls: true
|
tls: true
|
||||||
|
|
||||||
|
---
|
||||||
# Example using remote docker with verified TLS and client certificate verification
|
# Example using remote docker with verified TLS and client certificate verification
|
||||||
plugin: community.docker.docker_swarm
|
plugin: community.docker.docker_swarm
|
||||||
docker_host: tcp://my-docker-host:2376
|
docker_host: tcp://my-docker-host:2376
|
||||||
@ -128,6 +132,7 @@ ca_path: /somewhere/ca.pem
|
|||||||
client_key: /somewhere/key.pem
|
client_key: /somewhere/key.pem
|
||||||
client_cert: /somewhere/cert.pem
|
client_cert: /somewhere/cert.pem
|
||||||
|
|
||||||
|
---
|
||||||
# Example using constructed features to create groups and set ansible_host
|
# Example using constructed features to create groups and set ansible_host
|
||||||
plugin: community.docker.docker_swarm
|
plugin: community.docker.docker_swarm
|
||||||
docker_host: tcp://my-docker-host:2375
|
docker_host: tcp://my-docker-host:2375
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
.azure-pipelines/scripts/publish-codecov.py replace-urlopen
|
.azure-pipelines/scripts/publish-codecov.py replace-urlopen
|
||||||
|
plugins/inventory/docker_containers.py yamllint:unparsable-with-libyaml
|
||||||
|
plugins/inventory/docker_machine.py yamllint:unparsable-with-libyaml
|
||||||
|
plugins/inventory/docker_swarm.py yamllint:unparsable-with-libyaml
|
||||||
plugins/modules/docker_container_copy_into.py validate-modules:undocumented-parameter # _max_file_size_for_diff is used by the action plugin
|
plugins/modules/docker_container_copy_into.py validate-modules:undocumented-parameter # _max_file_size_for_diff is used by the action plugin
|
||||||
plugins/modules/docker_image_build.py validate-modules:invalid-documentation
|
plugins/modules/docker_image_build.py validate-modules:invalid-documentation
|
||||||
|
|||||||
@ -1,2 +1,5 @@
|
|||||||
|
plugins/inventory/docker_containers.py yamllint:unparsable-with-libyaml
|
||||||
|
plugins/inventory/docker_machine.py yamllint:unparsable-with-libyaml
|
||||||
|
plugins/inventory/docker_swarm.py yamllint:unparsable-with-libyaml
|
||||||
plugins/modules/docker_container_copy_into.py validate-modules:undocumented-parameter # _max_file_size_for_diff is used by the action plugin
|
plugins/modules/docker_container_copy_into.py validate-modules:undocumented-parameter # _max_file_size_for_diff is used by the action plugin
|
||||||
plugins/modules/docker_image_build.py validate-modules:invalid-documentation
|
plugins/modules/docker_image_build.py validate-modules:invalid-documentation
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user