1
0
Fork 0
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:
Aliaksandr Mianzhynski 2022-01-06 19:08:09 +03:00 committed by GitHub
parent 42dc5be784
commit d185616a72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 5 deletions

View file

@ -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:

View file

@ -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