containers.podman.podman_system_connection_info module – Gather info about podman system connections

Note

This module is part of the containers.podman collection (version 1.18.0).

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. You need further requirements to be able to use this module, see Requirements for details.

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

New in containers.podman 1.18.0

Synopsis

  • Gather info about podman system connections with podman system connection list command.

Requirements

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

  • Podman installed on host

Parameters

Parameter

Comments

executable

string

Path to podman executable if it is not in the $PATH on the machine running podman

Default: "podman"

name

string

Name of the connection to gather info about

If not provided, info about all connections will be returned

Examples

- name: Gather info about all connections
  containers.podman.podman_system_connection_info:

- name: Gather info about specific connection
  containers.podman.podman_system_connection_info:
    name: production

- name: Get connection info and register result
  containers.podman.podman_system_connection_info:
    name: staging
  register: staging_connection

- name: Display connection URI
  debug:
    msg: "Staging connection URI: {{ staging_connection.connections[0].URI }}"
  when: staging_connection.connections | length > 0

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

connections

list / elements=string

Facts from all or specified connections

Returned: always

Sample: [{"Default": true, "Identity": "/home/user/.ssh/id_rsa", "Name": "production", "ReadWrite": true, "URI": "ssh://root@server.example.com:22/run/user/0/podman/podman.sock"}, {"Default": false, "Identity": "", "Name": "local", "ReadWrite": false, "URI": "unix:///run/user/1000/podman/podman.sock"}, {"Default": false, "Identity": "/home/user/.ssh/dev_rsa", "Name": "development", "ReadWrite": true, "URI": "ssh://dev@dev.example.com:22/run/user/1000/podman/podman.sock"}]

Authors

  • Sagi Shnaidman (@sshnaidm)