W3cubDocs

/Ansible

containers.podman.podman_secret – Manage podman secrets

Note

This plugin is part of the containers.podman collection (version 1.8.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install containers.podman.

To use it in a playbook, specify: containers.podman.podman_secret.

New in version 1.7.0: of containers.podman

Synopsis

  • Manage podman secrets

Requirements

The below requirements are needed on the host that executes this module.

  • podman

Parameters

Parameter Choices/Defaults Comments
data
string
The value of the secret. Required when state is present.
executable
string
Default:
"podman"
Path to podman executable if it is not in the $PATH on the machine running podman
force
boolean
    Choices:
  • no
  • yes
Use it when state is present to remove and recreate an existing secret.
name
string / required
The name of the secret.
state
string
    Choices:
  • absent
  • present
Whether to create or remove the named secret.

Examples

- name: Create secret
  containers.podman.podman_secret:
    state: present
    name: mysecret
    data: "my super secret content"

- name: Create container that uses the secret
  containers.podman.podman_container:
    name: showmysecret
    image: docker.io/alpine:3.14
    secrets:
      - mysecret
    detach: false
    command: cat /run/secrets/mysecret
    register: container

- name: Output secret data
  debug:
    msg: '{{ container.stdout }}'

- name: Remove secret
  containers.podman.podman_secret:
    state: absent
    name: mysecret

Authors

  • Aliaksandr Mianzhynski (@amenzhinsky)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/containers/podman/podman_secret_module.html