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:
@@ -33,7 +33,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 secret
|
||||
docker_secret:
|
||||
@@ -76,6 +76,24 @@
|
||||
that:
|
||||
- not output.changed
|
||||
|
||||
- name: Write secret into file
|
||||
copy:
|
||||
dest: "{{ remote_tmp_dir }}/data"
|
||||
content: |-
|
||||
opensesame!
|
||||
|
||||
- name: Create secret again (from file)
|
||||
docker_secret:
|
||||
name: db_password
|
||||
data_src: "{{ remote_tmp_dir }}/data"
|
||||
state: present
|
||||
register: output
|
||||
|
||||
- name: assert create secret is idempotent
|
||||
assert:
|
||||
that:
|
||||
- not output.changed
|
||||
|
||||
- name: Create secret again (base64)
|
||||
docker_secret:
|
||||
name: db_password
|
||||
|
||||
Reference in New Issue
Block a user