mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
docker_config and docker_secret: add data_src option (#203)
* Add data_src options to docker_config and docker_secret. * Add examples. * Fix test. * Another fix.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- setup_docker
|
||||
- setup_remote_tmp_dir
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
assert:
|
||||
that:
|
||||
- 'output.failed'
|
||||
- 'output.msg == "state is present but all of the following are missing: data"'
|
||||
- 'output.msg == "state is present but any of the following are missing: data, data_src"'
|
||||
|
||||
- name: Create config
|
||||
docker_config:
|
||||
@@ -80,6 +80,24 @@
|
||||
that:
|
||||
- not output.changed
|
||||
|
||||
- name: Write config into file
|
||||
copy:
|
||||
dest: "{{ remote_tmp_dir }}/data"
|
||||
content: |-
|
||||
opensesame!
|
||||
|
||||
- name: Create config again (from file)
|
||||
docker_config:
|
||||
name: db_password
|
||||
data_src: "{{ remote_tmp_dir }}/data"
|
||||
state: present
|
||||
register: output
|
||||
|
||||
- name: assert create config is idempotent
|
||||
assert:
|
||||
that:
|
||||
- not output.changed
|
||||
|
||||
- name: Create config again (base64)
|
||||
docker_config:
|
||||
name: db_password
|
||||
|
||||
Reference in New Issue
Block a user