Compare commits

...

No commits in common. "main" and "docs" have entirely different histories.
main ... docs

22 changed files with 73 additions and 492 deletions

11
.gitignore vendored
View File

@ -1,11 +0,0 @@
# ---> Ansible
*.retry
plugins
library
# ---> Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

View File

@ -1,15 +0,0 @@
---
ansible:
custom_modules:
- iptables_raw
- openssl_pkcs12
- proxmox_kvm
- ucr
- corenetworks_dns
- corenetworks_token
rules:
exclude_files:
- "LICENSE*"
- "**/*.md"
- "**/*.ini"

View File

@ -1,7 +0,0 @@
---
default: True
MD013: False
MD041: False
MD024: False
MD004:
style: dash

View File

@ -1 +0,0 @@
LICENSE

View File

@ -1,47 +0,0 @@
---
when:
- event: [pull_request]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
steps:
- name: generate
image: quay.io/thegeeklab/ansible-doctor
environment:
ANSIBLE_DOCTOR_EXCLUDE_FILES: molecule/
ANSIBLE_DOCTOR_FORCE_OVERWRITE: "true"
ANSIBLE_DOCTOR_LOG_LEVEL: INFO
ANSIBLE_DOCTOR_ROLE_NAME: ${CI_REPO_NAME}
ANSIBLE_DOCTOR_TEMPLATE: readme
- name: format
image: quay.io/thegeeklab/alpine-tools
commands:
- prettier -w README.md
- name: diff
image: quay.io/thegeeklab/alpine-tools
commands:
- git diff --color=always README.md
- name: publish
image: quay.io/thegeeklab/wp-git-action
settings:
action:
- commit
- push
author_email: ci-bot@rknet.org
author_name: ci-bot
branch: main
message: "[skip ci] automated docs update"
netrc_machine: gitea.rknet.org
netrc_password:
from_secret: gitea_token
when:
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
depends_on:
- test

View File

@ -1,30 +0,0 @@
---
when:
- event: [pull_request, tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
steps:
- name: ansible-later
image: quay.io/thegeeklab/ansible-later:4
commands:
- ansible-later
environment:
FORCE_COLOR: "1"
- name: python-format
image: docker.io/python:3.12
commands:
- pip install -qq ruff
- ruff format --check --diff .
environment:
PY_COLORS: "1"
- name: python-lint
image: docker.io/python:3.12
commands:
- pip install -qq ruff
- ruff .
environment:
PY_COLORS: "1"

View File

@ -1,26 +0,0 @@
---
when:
- event: [tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
runs_on: [success, failure]
steps:
- name: matrix
image: quay.io/thegeeklab/wp-matrix
settings:
homeserver:
from_secret: matrix_homeserver
password:
from_secret: matrix_password
roomid:
from_secret: matrix_roomid
username:
from_secret: matrix_username
when:
- status: [success, failure]
depends_on:
- docs

View File

@ -1,25 +0,0 @@
---
when:
- event: [pull_request, tag]
- event: [push, manual]
branch:
- ${CI_REPO_DEFAULT_BRANCH}
variables:
- &molecule_base
image: quay.io/thegeeklab/molecule:6
group: molecule
secrets:
- source: molecule_hcloud_token
target: HCLOUD_TOKEN
environment:
PY_COLORS: "1"
steps:
- name: molecule-default
<<: *molecule_base
commands:
- molecule test -s default
depends_on:
- lint

21
LICENSE
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2022 Robert Kaussow <mail@thegeeklab.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next
paragraph) shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,43 +1,35 @@
# xoxys.podman
---
title: podman
type: docs
---
[![Build Status](https://ci.rknet.org/api/badges/ansible/xoxys.podman/status.svg)](https://ci.rknet.org/repos/ansible/xoxys.podman)
[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.podman)
[![Build Status](https://img.shields.io/drone/build/ansible/xoxys.podman?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.podman)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](https://gitea.rknet.org/ansible/xoxys.podman/src/branch/main/LICENSE)
Setup Podman container manager.
## Table of content
<!--more-->
- [Requirements](#requirements)
- [Default Variables](#default-variables)
- [podman_containers_label](#podman_containers_label)
- [podman_containers_logger](#podman_containers_logger)
- [podman_containers_userns](#podman_containers_userns)
- [podman_engine_event_logger](#podman_engine_event_logger)
- [podman_nsremap_range_length](#podman_nsremap_range_length)
- [podman_nsremap_range_start](#podman_nsremap_range_start)
- [podman_registries](#podman_registries)
- [podman_sebooleans](#podman_sebooleans)
- [podman_socket_enabled](#podman_socket_enabled)
- [Dependencies](#dependencies)
- [License](#license)
- [Author](#author)
---
## Requirements
- Minimum Ansible version: `2.10`
- Minimum Ansible version: `2.1`
## Default Variables
### podman_containers_label
#### Default value
```YAML
podman_containers_label: true
```
### podman_containers_logger
#### Default value
@ -46,14 +38,6 @@ podman_containers_label: true
podman_containers_logger: journald
```
### podman_containers_userns
#### Default value
```YAML
podman_containers_userns: auto
```
### podman_engine_event_logger
#### Default value
@ -95,7 +79,8 @@ podman_registries:
- registry: myregistry.example.com (optional)
username: docker
password: secure
active: True
reauthorize: False
state: present
```
### podman_sebooleans
@ -109,22 +94,8 @@ podman_sebooleans:
persistent: true
```
### podman_socket_enabled
#### Default value
```YAML
podman_socket_enabled: false
```
## Dependencies
None.
## License
MIT
## Author
[Robert Kaussow](https://gitea.rknet.org/xoxys)

View File

@ -1,26 +0,0 @@
---
podman_sebooleans:
- name: container_manage_cgroup
state: True
persistent: True
podman_containers_userns: auto
podman_containers_label: True
podman_containers_logger: journald
podman_engine_event_logger: journald
podman_nsremap_range_start: 231072
podman_nsremap_range_length: 65536
# @var podman_registries:description: List of docker registries to auto login
# @var podman_registries:example: >
# podman_registries:
# - registry: myregistry.example.com (optional)
# username: docker
# password: secure
# active: True
# @end
podman_registries: []
podman_socket_enabled: False

62
index.md Normal file
View File

@ -0,0 +1,62 @@
---
title: podman
type: docs
---
[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.podman) [![Build Status](https://img.shields.io/drone/build/ansible/xoxys.podman?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.podman) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](https://gitea.rknet.org/ansible/xoxys.podman/src/branch/main/LICENSE)
Setup Podman container manager.
<!--more-->
- [Default Variables](#default-variables)
- [podman_containers_logger](#podman_containers_logger)
- [podman_engine_event_logger](#podman_engine_event_logger)
- [podman_sebooleans](#podman_sebooleans)
- [podman_systemd_home_basedir](#podman_systemd_home_basedir)
- [Dependencies](#dependencies)
---
## Default Variables
### podman_containers_logger
#### Default value
```YAML
podman_containers_logger: journald
```
### podman_engine_event_logger
#### Default value
```YAML
podman_engine_event_logger: journald
```
### podman_sebooleans
#### Default value
```YAML
podman_sebooleans:
- name: container_manage_cgroup
state: true
persistent: true
```
### podman_systemd_home_basedir
#### Default value
```YAML
podman_systemd_home_basedir: /var/lib/rootless
```
## Dependencies
None.

View File

@ -1,21 +0,0 @@
---
galaxy_info:
# @meta author:value: [Robert Kaussow](https://gitea.rknet.org/xoxys)
author: "Robert Kaussow <mail@thegeeklab.de>"
namespace: xoxys
role_name: podman
# @meta description: >
# [![Build Status](https://ci.rknet.org/api/badges/ansible/xoxys.podman/status.svg)](https://ci.rknet.org/repos/ansible/xoxys.podman)
# [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](https://gitea.rknet.org/ansible/xoxys.podman/src/branch/main/LICENSE)
#
# Setup Podman container manager.
# @end
description: Setup Podman container manager
license: MIT
min_ansible_version: "2.10"
platforms:
- name: EL
versions:
- "7"
galaxy_tags: []
dependencies: []

View File

@ -1,5 +0,0 @@
---
- name: Converge
hosts: all
roles:
- role: xoxys.podman

View File

@ -1,17 +0,0 @@
---
driver:
name: molecule_hetznercloud
dependency:
name: galaxy
options:
role-file: molecule/requirements.yml
requirements-file: molecule/requirements.yml
platforms:
- name: "rocky9-podman"
server_type: "cx11"
image: "rocky-9"
provisioner:
name: ansible
log: False
verifier:
name: testinfra

View File

@ -1,11 +0,0 @@
---
- name: Prepare
hosts: all
gather_facts: False
tasks:
- name: Bootstrap Python for Ansible
ansible.builtin.raw: |
command -v python3 python ||
((test -e /usr/bin/apt && (apt -y update && apt install -y python-minimal)) ||
echo "Warning: Python not boostrapped due to unknown platform.")
changed_when: False

View File

@ -1,18 +0,0 @@
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_podman_installed(host):
assert host.package("podman").is_installed
def test_podman_run(host):
cmd = host.run("/usr/bin/podman info")
assert "cgroupVersion: v2" in cmd.stdout
assert cmd.succeeded

View File

@ -1,5 +0,0 @@
---
collections:
- name: containers.podman
roles: []

View File

@ -1,17 +0,0 @@
[tool.ruff]
exclude = [".git", "__pycache__"]
line-length = 99
indent-width = 4
[tool.ruff.lint]
ignore = ["W191", "E111", "E114", "E117", "S101", "S105"]
select = ["F", "E", "I", "W", "S"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "lf"
[tool.pytest.ini_options]
filterwarnings = ["ignore::FutureWarning", "ignore::DeprecationWarning"]

View File

@ -1,74 +0,0 @@
---
- name: Ensure required packages are installed
ansible.builtin.package:
name: "{{ item }}"
state: "present"
loop:
- podman
- container-selinux
- bash-completion
- name: Install Podman bash-completion
ansible.builtin.command:
cmd: "podman completion bash -f /etc/bash_completion.d/podman"
creates: "/etc/bash_completion.d/podman"
- name: Deploy container configuration
ansible.builtin.template:
src: etc/containers/containers.conf.j2
dest: /etc/containers/containers.conf
owner: root
group: root
mode: "0644"
- name: Deploy storage configuration
ansible.builtin.template:
src: etc/containers/storage.conf.j2
dest: /etc/containers/storage.conf
owner: root
group: root
mode: "0644"
- name: Set SELinux booleans
ansible.posix.seboolean:
name: "{{ item.name }}"
state: "{{ item.state | bool }}"
persistent: "{{ item.persistent | default(True) | bool }}"
loop: "{{ podman_sebooleans }}"
loop_control:
label: "{{ item.name }}: {{ item.state | bool }}"
- name: Configure namespace id range
ansible.builtin.lineinfile:
dest: "{{ item }}"
regexp: "^containers:"
line: "containers:{{ podman_nsremap_range_start }}:{{ podman_nsremap_range_length }}"
loop:
- /etc/subuid
- /etc/subgid
- name: Handle registry logins
containers.podman.podman_login:
registry: "{{ item.registry }}"
username: "{{ item.username }}"
password: "{{ item.password }}"
when: item.active | default(True) | bool
loop: "{{ podman_registries }}"
loop_control:
label: "{{ item.registry }}"
- name: Handle registry logouts
containers.podman.podman_logout:
registry: "{{ item.registry }}"
when: not item.active | default(True) | bool
loop: "{{ podman_registries }}"
loop_control:
label: "{{ item.registry }}"
- name: Enable podman socket
ansible.builtin.service:
name: podman.socket
daemon_reload: True
enabled: "{{ podman_socket_enabled | bool }}"
masked: "{{ not podman_socket_enabled | bool }}"
state: "{{ podman_socket_enabled | bool | ternary('started', 'stopped', 'started') }}"

View File

@ -1,55 +0,0 @@
#jinja2: lstrip_blocks: True
{{ ansible_managed | comment }}
# The containers configuration file specifies all of the available configuration
# command-line options/flags for container engine tools like Podman & Buildah,
# but in a TOML format that can be easily modified and versioned.
# Please refer to containers.conf(5) for details of all configuration options.
# Not all container engines implement all of the options.
# All of the options have hard coded defaults and these options will override
# the built in defaults. Users can then override these options via the command
# line. Container engines will read containers.conf files in up to three
# locations in the following order:
# 1. /usr/share/containers/containers.conf
# 2. /etc/containers/containers.conf
# 3. $HOME/.config/containers/containers.conf (Rootless containers ONLY)
# Items specified in the latter containers.conf, if they exist, override the
# previous containers.conf settings, or the default settings.
[containers]
default_capabilities = [
"CHOWN",
"DAC_OVERRIDE",
"FOWNER",
"FSETID",
"KILL",
"NET_BIND_SERVICE",
"SETFCAP",
"SETGID",
"SETPCAP",
"SETUID",
]
default_sysctls = [
"net.ipv4.ping_group_range=0 0",
]
log_driver = "{{ podman_containers_logger }}"
userns = "{{ podman_containers_userns }}"
label = {{ podman_containers_label | bool | lower }}
[secrets]
[secrets.opts]
[network]
[engine]
events_logger = "{{ podman_engine_event_logger }}"
runtime = "crun"
[engine.runtimes]
[engine.volume_plugins]
[machine]

View File

@ -1,20 +0,0 @@
# This file is is the configuration file for all tools
# that use the containers/storage library.
# See man 5 containers-storage.conf for more information
# The "container storage" table contains all of the server options.
[storage]
driver = "overlay"
runroot = "/run/containers/storage"
graphroot = "/var/lib/containers/storage"
[storage.options]
additionalimagestores = [
]
pull_options = {enable_partial_images = "false", use_hard_links = "false", ostree_repos=""}
[storage.options.overlay]
mountopt = "nodev,metacopy=on"
[storage.options.thinpool]