podman
: Manage containers, pods, volumes, and images with podman without a docker daemon
podman::install
: Install podman packagespodman::options
: edit container options in /etc/containerspodman::service
: Manage the podman.socket service
podman::container
: manage podman container and register as a systemd servicepodman::image
: pull or remove container imagespodman::network
: Create a podman network with defined flagspodman::pod
: Create a podman pod with defined flagspodman::quadlet
: manage podman quadletspodman::rootless
: Enable a given user to run rootless podman containers as a systemd user service.podman::secret
: Manage a podman secret. Create and remove secrets, it cannot replace.podman::subgid
: Define an entry in the/etc/subgid
file.podman::subuid
: Manage entries in/etc/subuid
podman::volume
: Create a podman volume with defined flags
Manage containers, pods, volumes, and images with podman without a docker daemon
include podman
podman::subid:
jenkins:
subuid: 2000000
count: 65535
podman::volumes:
jenkins:
user: jenkins
podman::containers:
jenkins:
user: jenkins
image: 'docker.io/jenkins/jenkins:lts'
flags:
label:
- purpose=test
publish:
- '8080:8080'
- '50000:50000'
volume: 'jenkins:/var/jenkins_home'
service_flags:
timeout: '60'
require:
- Podman::Volume[jenkins]
The following parameters are available in the podman
class:
podman_pkg
skopeo_pkg
buildah_pkg
podman_docker_pkg
compose_pkg
machinectl_pkg
buildah_pkg_ensure
podman_docker_pkg_ensure
compose_pkg_ensure
machinectl_pkg_ensure
nodocker
storage_options
containers_options
rootless_users
enable_api_socket
manage_subuid
file_header
match_subuid_subgid
subid
pods
volumes
images
containers
networks
quadlets
Data type: String
The name of the podman package (default 'podman')
Default value: 'podman'
Data type: String
The name of the skopeo package (default 'skopeo')
Default value: 'skopeo'
Data type: String
The name of the buildah package (default 'buildah')
Default value: 'buildah'
Data type: String
The name of the podman-docker package (default 'podman-docker').
Default value: 'podman-docker'
Data type: String
The name of the podman-compose package (default 'podman-compose').
Default value: 'podman-compose'
Data type: String
The name of the machinectl package (default 'systemd-container').
Default value: 'systemd-container'
Data type: Enum['absent', 'installed']
The ensure value for the buildah package (default 'absent')
Default value: 'absent'
Data type: Enum['absent', 'installed']
The ensure value for the podman docker package (default 'installed')
Default value: 'installed'
Data type: Enum['absent', 'installed']
The ensure value for the podman-compose package (default 'absent')
Default value: 'absent'
Data type: Enum['absent', 'installed']
The ensure value for the machinectl package (default 'installed')
Default value: 'installed'
Data type: Enum['absent', 'file']
Should the module create the /etc/containers/nodocker
file to quiet Docker CLI messages.
Values should be either 'file' or 'absent'. (default is 'absent')
Default value: 'absent'
Data type: Hash
A hash containing any storage options you wish to set in /etc/containers/storage.conf
Default value: {}
Data type: Hash
A hash containing any containers options you wish to set in /etc/containers/containers.conf
Default value: {}
Data type: Array
An array of users to manage using podman::rootless
Default value: []
Data type: Boolean
The enable value of the API socket (default false
)
Default value: false
Data type: Boolean
Should the module manage the /etc/subuid
and /etc/subgid
files (default is false)
The implementation uses concat fragments to build
out the subuid/subgid entries. If you have a large number of entries you may want to manage them
with another method. You cannot use the subuid
and subgid
defined types unless this is true
.
Default value: false
Data type: String
Optional header when manage_subuid
is true. Ensure you include a leading #
.
Default file_header is # FILE MANAGED BY PUPPET
Default value: '# FILE MANAGED BY PUPPET'
Data type: Boolean
Enable the subid
parameter to manage both subuid and subgid entries with the same values.
This setting requires manage_subuid
to be true
or it will have no effect.
(default is true)
Default value: true
Data type: Hash
A hash of users (or UIDs) with assigned subordinate user ID number and an count.
Implemented by using the subuid
and subgid
defined types with the same data.
Hash key subuid
is the subordinate UID, and count
is the number of subordinate UIDs
Default value: {}
Data type: Hash
A hash of pods to manage using podman::pod
Default value: {}
Data type: Hash
A hash of volumes to manage using podman::volume
Default value: {}
Data type: Hash
A hash of images to manage using podman::image
Default value: {}
Data type: Hash
A hash of containers to manage using podman::container
Default value: {}
Data type: Hash
A hash of networks to manage using podman::network
Default value: {}
Data type: Hash
A hash of quadlets to manage using podman::quadlet
Default value: {}
manage podman container and register as a systemd service
podman::container { 'jenkins':
image => 'docker.io/jenkins/jenkins',
user => 'jenkins',
flags => {
publish => [
'8080:8080',
'50000:50000',
],
volume => 'jenkins:/var/jenkins_home',
},
service_flags => { timeout => '60' },
}
The following parameters are available in the podman::container
defined type:
Data type: Optional[String]
Container registry source of the image being deployed. Required when
ensure
is present
but optional when ensure
is set to absent
.
Default value: undef
Data type: Optional[String]
Optional user for running rootless containers. For rootless containers, the user must also be defined as a puppet resource that includes at least 'uid', 'gid', and 'home' attributes.
Default value: undef
Data type: Hash
All flags for the 'podman container create' command are supported via the
'flags' hash parameter, using only the long form of the flag name. The
container name will be set as the resource name (namevar) unless the 'name'
flag is included in the flags hash. If the flags for a container resource
are modified the container will be destroyed and re-deployed during the
next puppet run. This is achieved by storing the complete set of flags as
a base64 encoded string in a container label named puppet_resource_flags
so it can be compared with the assigned resource state.
Flags that can be used more than once should be expressed as an array. For
flags which take no arguments, set the hash value to be undef. In the
YAML representation you can use ~
or null
as the value.
Default value: {}
Data type: Hash
When a container is created, a systemd unit file for the container service is generated using the 'podman generate systemd' command. All flags for the command are supported using the 'service_flags' hash parameter, again using only the long form of the flag names.
Default value: {}
Data type: Optional[String]
Optional command to be used as the container entry point.
Default value: undef
Data type: Enum['present', 'absent']
Valid values are 'present' or 'absent'
Default value: 'present'
Data type: Boolean
Status of the automatically generated systemd service for the container. Valid values are 'running' or 'stopped'.
Default value: true
Data type: Boolean
When true
, the container will be redeployed when a new container image is
detected in the container registry. This is done by comparing the digest
value of the running container image with the digest of the registry image.
When false
, the container will only be redeployed when the declared state
of the puppet resource is changed.
Default value: true
Data type: Optional[Stdlib::Unixpath]
The absolute path to the ruby binary to use in scripts. The default path is '/opt/puppetlabs/puppet/bin/ruby' for Puppetlabs packaged puppet, and '/usr/bin/ruby' for all others.
Default value: undef
pull or remove container images
podman::image { 'my_container':
image => 'my_container:tag',
flags => {
creds => 'USERNAME:PASSWORD',
},
}
The following parameters are available in the podman::image
defined type:
Data type: String
The name of the container image to pull, which should be present in a configured container registry.
Data type: Enum['present', 'absent']
State of the resource must be either present
or absent
.
Default value: 'present'
Data type: Hash
All flags for the 'podman image pull' command are supported, using only the long form of the flag name.
Default value: {}
Data type: Optional[String]
Optional user for running rootless containers. When using this parameter, the user must also be defined as a Puppet resource and must include the 'uid', 'gid', and 'home'
Default value: undef
Data type: Array
Optional array of environment variables used when the container image is pulled. Useful for defining a proxy for downloads. For example: ["HTTP_PROXY=http://${proxy_fqdn}:3128", "HTTPS_PROXY=http://${proxy_fqdn}:3128"]
Default value: []
Create a podman network with defined flags
podman::network { 'mnetwork':
driver => 'bridge',
internal => true,
}
The following parameters are available in the podman::network
defined type:
Data type: Enum['present', 'absent']
State of the resource must be either 'present' or 'absent'.
Default value: 'present'
Data type: Boolean
Disables the DNS plugin for this network which if enabled, can perform container to container name resolution.
Default value: false
Data type: Enum['bridge', 'macvlan']
Driver to manage the network.
Default value: 'bridge'
Data type: Array[String]
A list of driver specific options.
Default value: []
Data type: Optional[String]
Define the gateway for the network. Must also provide the subnet.
Default value: undef
Data type: Boolean
Restrict external access of this network.
Default value: false
Data type: Optional[String]
Allocate container IP from a range. The range must be a complete subnet and in CIDR notation.
Default value: undef
Data type: Hash[String,String]
A hash of metadata labels to set on the network.
Default value: {}
Data type: Optional[String]
The subnet in CIDR notation
Default value: undef
Data type: Boolean
Enable IPv6 (dual-stack) networking.
Default value: false
Data type: Optional[String]
Optional user for creating rootless container networks. For rootless containers, the user must also be defined as a puppet resource that includes at least 'uid', 'gid', and 'home' attributes.
Default value: undef
Create a podman pod with defined flags
podman::pod { 'mypod':
flags => {
label => 'use=test, app=wordpress',
}
}
The following parameters are available in the podman::pod
defined type:
Data type: Enum['present', 'absent']
State of the resource, which must be either 'present' or 'absent'.
Default value: 'present'
Data type: Hash
All flags for the 'podman pod create' command are supported, using only the long form of the flag name. The resource name (namevar) will be used as the pod name unless the 'name' flag is included in the hash of flags.
Default value: {}
Data type: Optional[String]
Optional user for running rootless containers. When using this parameter, the user must also be defined as a Puppet resource and must include the 'uid', 'gid', and 'home'
Default value: undef
manage podman quadlets
podman::quadlet { 'jenkins':
user => 'jenkins',
settings => {
Unit => {
Description => "Jenkins container",
},
Container => {
Image => 'docker.io/jenkins/jenkins:latest',
PublishPort => '8080:8080',
PublishPort => '50000:50000',
Volume => 'jenkins:/var/jenkins_home',
},
Service => {
TimeoutStartSec => '180',
},
},
}
The following parameters are available in the podman::quadlet
defined type:
Data type: Enum['present', 'absent']
Valid values are 'present' or 'absent'
Default value: 'present'
Data type: String
A username for running rootless containers. The user must also be defined as a puppet resource that includes at least 'uid', 'gid', and 'home' attributes. The default value is "root" and results in root containers and resources.
Default value: 'root'
Data type:
Enum['container',
'volume',
'network',
'build',
'pod',
'kube'
]
Must be one of the supported quadlet types: "container", "volume", "network", "build", "pod", or "kube". Default is "container"
Default value: 'container'
Data type: Hash
A hash that represents the systemd unit file that will be managed for the podman quadlet. No sanity checking is done on this hash, so invalid values can result in a service that fails to start, but this also allows full configuration of any service or container setting now and in the future without needed to go back and update the module.
Default value: {}
Data type: Hash
A hash of values that's merged with settings to simplify module usage. This allows running a container with nothing but an image defined.
Default value: {}
Enable a given user to run rootless podman containers as a systemd user service.
Manage a podman secret. Create and remove secrets, it cannot replace.
podman::secret{'db_password':
secret => Sensitive('NeverGuess'),
flags => {
label => [
'version=20230615',
]
}
}
podman::secret{'db_password':
path => '/etc/passwd',
}
podman::secret{'ora_password':
secret => Sensitive(Deferred('secret_lookup',['ora_password'])),
flags => {
labels => ['version=20230615'],
}
user => 'rootless user',
}
The following parameters are available in the podman::secret
defined type:
Data type: Enum['present','absent']
State of the resource must be either 'present' or 'absent'.
Default value: 'present'
Data type: Optional[Stdlib::Unixpath]
Load secret from an existing file path The secret and path parameters are mutually exclusive.
Default value: undef
Data type: Optional[Sensitive[String]]
A secret to be stored - can be set as a Deferred function. If the secret is changed the secret will NOT be modified. Best to set a secret version as a label. The secret and path parameters are mutually exclusive.
Default value: undef
Data type: Hash
All flags for the 'podman secret create' command are supported as part of the 'flags' hash, using only the long form of the flag name. The value for any defined flag in the 'flags' hash must be entered as a string. If the flags for a secret are modified the secret will be recreated.
Default value: {}
Data type: Optional[String[1]]
Optional user for running rootless containers. When using this parameter, the user must also be defined as a Puppet resource and must include the 'uid', 'gid', and 'home'
Default value: undef
Define an entry in the /etc/subgid
file.
podman::subgid { 'myuser':
subgid => 1000000
count => 65535
}
The following parameters are available in the podman::subgid
defined type:
Data type: Integer
Numerical subordinate group ID
Data type: Integer
Numerical subordinate group ID count
Data type: Integer
Sequence number for concat fragments#
Default value: 10
Manage entries in /etc/subuid
podman::subuid { 'namevar':
subuid => 1000000
count => 65535
}
The following parameters are available in the podman::subuid
defined type:
Data type: Integer
Numerical subordinate user ID
Data type: Integer
Numerical subordinate user ID count
Data type: Integer
Sequence number for concat fragments
Default value: 10
Create a podman volume with defined flags
podman::volume { 'myvolume':
flags => {
label => 'use=test, app=wordpress',
}
}
The following parameters are available in the podman::volume
defined type:
Data type: Enum['present', 'absent']
State of the resource must be either 'present' or 'absent'.
Default value: 'present'
Data type: Hash
All flags for the 'podman volume create' command are supported as part of the 'flags' hash, using only the long form of the flag name. The value for any defined flag in the 'flags' hash must be entered as a string. Volume names are created based on the resoure title (namevar)
Default value: {}
Data type: Optional[String]
Optional user for running rootless containers. When using this parameter, the user must also be defined as a Puppet resource and must include the 'uid', 'gid', and 'home'
Default value: undef