mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Update secrets description and add test with secret opts (#363)
* Update secrets description and add test with secret opts * Make pep happy
This commit is contained in:
parent
42dc5be784
commit
d185616a72
2 changed files with 19 additions and 5 deletions
|
|
@ -674,7 +674,9 @@ options:
|
|||
type: bool
|
||||
secrets:
|
||||
description:
|
||||
- Add the named secrets into the container at /run/secrets.
|
||||
- Add the named secrets into the container.
|
||||
The format is C(secret[,opt=opt...]), see
|
||||
L(documentation,https://docs.podman.io/en/latest/markdown/podman-run.1.html#secret-secret-opt-opt) for more details.
|
||||
type: list
|
||||
elements: str
|
||||
security_opt:
|
||||
|
|
|
|||
|
|
@ -42,15 +42,27 @@
|
|||
rm: true
|
||||
register: container
|
||||
|
||||
- name: Output secret data
|
||||
debug:
|
||||
msg: '{{ container.stdout }}'
|
||||
|
||||
- name: Check secret data
|
||||
assert:
|
||||
that:
|
||||
- container.stdout == "super secret content"
|
||||
|
||||
- name: Create container that uses secret with options
|
||||
containers.podman.podman_container:
|
||||
name: showmysecret
|
||||
image: alpine:3.7
|
||||
secrets:
|
||||
- mysecret,type=env,target=SECRET
|
||||
command: ['/bin/sh', '-c', 'echo $SECRET']
|
||||
detach: false
|
||||
rm: true
|
||||
register: container
|
||||
|
||||
- name: Check secret data
|
||||
assert:
|
||||
that:
|
||||
- container.stdout == "super secret content\n"
|
||||
|
||||
- name: Remove secret
|
||||
containers.podman.podman_secret:
|
||||
state: absent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue