Compare commits
No commits in common. "docs" and "main" have entirely different histories.
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# ---> Ansible
|
||||||
|
*.retry
|
||||||
|
plugins
|
||||||
|
library
|
||||||
|
|
||||||
|
# ---> Python
|
||||||
|
# Byte-compiled / optimized / DLL files
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
|
15
.later.yml
Normal file
15
.later.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
ansible:
|
||||||
|
custom_modules:
|
||||||
|
- iptables_raw
|
||||||
|
- openssl_pkcs12
|
||||||
|
- proxmox_kvm
|
||||||
|
- ucr
|
||||||
|
- corenetworks_dns
|
||||||
|
- corenetworks_token
|
||||||
|
|
||||||
|
rules:
|
||||||
|
exclude_files:
|
||||||
|
- "LICENSE*"
|
||||||
|
- "**/*.md"
|
||||||
|
- "**/*.ini"
|
7
.markdownlint.yml
Normal file
7
.markdownlint.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
default: True
|
||||||
|
MD013: False
|
||||||
|
MD041: False
|
||||||
|
MD024: False
|
||||||
|
MD004:
|
||||||
|
style: dash
|
1
.prettierignore
Normal file
1
.prettierignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
LICENSE
|
47
.woodpecker/docs.yaml
Normal file
47
.woodpecker/docs.yaml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
---
|
||||||
|
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
|
30
.woodpecker/lint.yaml
Normal file
30
.woodpecker/lint.yaml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
---
|
||||||
|
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"
|
26
.woodpecker/notify.yml
Normal file
26
.woodpecker/notify.yml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
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
|
25
.woodpecker/test.yaml
Normal file
25
.woodpecker/test.yaml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
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
Normal file
21
LICENSE
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
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.
|
|
@ -1,37 +1,46 @@
|
||||||
---
|
# xoxys.packages
|
||||||
title: packages
|
|
||||||
type: docs
|
|
||||||
---
|
|
||||||
|
|
||||||
[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.packages)
|
[![Build Status](https://ci.rknet.org/api/badges/ansible/xoxys.packages/status.svg)](https://ci.rknet.org/repos/ansible/xoxys.packages)
|
||||||
[![Build Status](https://img.shields.io/drone/build/ansible/xoxys.packages?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.packages)
|
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](https://gitea.rknet.org/ansible/xoxys.packages/src/branch/main/LICENSE)
|
||||||
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/ansible/xoxys.packages/src/branch/main/LICENSE)
|
|
||||||
|
|
||||||
Setup package repositories.
|
Setup package repositories.
|
||||||
|
|
||||||
<!--more-->
|
## Table of content
|
||||||
|
|
||||||
- [Requirements](#requirements)
|
- [Requirements](#requirements)
|
||||||
- [Default Variables](#default-variables)
|
- [Default Variables](#default-variables)
|
||||||
|
- [packages_dnf_installonly_limit](#packages_dnf_installonly_limit)
|
||||||
- [packages_enablerepo](#packages_enablerepo)
|
- [packages_enablerepo](#packages_enablerepo)
|
||||||
- [packages_install](#packages_install)
|
- [packages_install](#packages_install)
|
||||||
- [packages_install_extra](#packages_install_extra)
|
- [packages_install_extra](#packages_install_extra)
|
||||||
- [packages_repofiles_remove](#packages_repofiles_remove)
|
- [packages_repofiles_remove](#packages_repofiles_remove)
|
||||||
- [packages_uninstall](#packages_uninstall)
|
- [packages_uninstall](#packages_uninstall)
|
||||||
- [packages_uninstall_extra](#packages_uninstall_extra)
|
- [packages_uninstall_extra](#packages_uninstall_extra)
|
||||||
|
- [packages_uninstall_pre](#packages_uninstall_pre)
|
||||||
|
- [packages_uninstall_pre_extra](#packages_uninstall_pre_extra)
|
||||||
- [packages_upgrade_enabled](#packages_upgrade_enabled)
|
- [packages_upgrade_enabled](#packages_upgrade_enabled)
|
||||||
- [packages_yum_repositories](#packages_yum_repositories)
|
- [packages_yum_repositories](#packages_yum_repositories)
|
||||||
- [packages_yum_repositories_extra](#packages_yum_repositories_extra)
|
- [packages_yum_repositories_extra](#packages_yum_repositories_extra)
|
||||||
- [Dependencies](#dependencies)
|
- [Dependencies](#dependencies)
|
||||||
|
- [License](#license)
|
||||||
|
- [Author](#author)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Minimum Ansible version: `2.1`
|
- Minimum Ansible version: `2.10`
|
||||||
|
|
||||||
## Default Variables
|
## Default Variables
|
||||||
|
|
||||||
|
### packages_dnf_installonly_limit
|
||||||
|
|
||||||
|
#### Default value
|
||||||
|
|
||||||
|
```YAML
|
||||||
|
packages_dnf_installonly_limit: 2
|
||||||
|
```
|
||||||
|
|
||||||
### packages_enablerepo
|
### packages_enablerepo
|
||||||
|
|
||||||
#### Default value
|
#### Default value
|
||||||
|
@ -85,6 +94,22 @@ packages_uninstall:
|
||||||
packages_uninstall_extra: []
|
packages_uninstall_extra: []
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### packages_uninstall_pre
|
||||||
|
|
||||||
|
#### Default value
|
||||||
|
|
||||||
|
```YAML
|
||||||
|
packages_uninstall_pre: []
|
||||||
|
```
|
||||||
|
|
||||||
|
### packages_uninstall_pre_extra
|
||||||
|
|
||||||
|
#### Default value
|
||||||
|
|
||||||
|
```YAML
|
||||||
|
packages_uninstall_pre_extra: []
|
||||||
|
```
|
||||||
|
|
||||||
### packages_upgrade_enabled
|
### packages_upgrade_enabled
|
||||||
|
|
||||||
#### Default value
|
#### Default value
|
||||||
|
@ -121,8 +146,14 @@ packages_yum_repositories:
|
||||||
packages_yum_repositories_extra: []
|
packages_yum_repositories_extra: []
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
None.
|
None.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
[Robert Kaussow](https://gitea.rknet.org/xoxys)
|
33
defaults/main.yml
Normal file
33
defaults/main.yml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
---
|
||||||
|
packages_yum_repositories: []
|
||||||
|
# @var packages_yum_repositories:example: >
|
||||||
|
# packages_yum_repositories:
|
||||||
|
# - name: epel
|
||||||
|
# filename: Extra-EPEL
|
||||||
|
# desc: Extra Packages for Enterprise Linux (EPEL)
|
||||||
|
# baseurl: "http://download.fedoraproject.org/pub/epel/$releasever/$basearch/"
|
||||||
|
# gpgkey: "http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever/"
|
||||||
|
# enabled: True
|
||||||
|
# @end
|
||||||
|
packages_yum_repositories_extra: []
|
||||||
|
|
||||||
|
packages_repofiles_remove: []
|
||||||
|
packages_enablerepo: []
|
||||||
|
|
||||||
|
packages_install: []
|
||||||
|
packages_install_extra: []
|
||||||
|
|
||||||
|
packages_uninstall_pre: []
|
||||||
|
packages_uninstall_pre_extra: []
|
||||||
|
|
||||||
|
packages_uninstall:
|
||||||
|
- setroubleshoot
|
||||||
|
- mcstransd
|
||||||
|
- xinetd
|
||||||
|
- ypbind
|
||||||
|
- telnet
|
||||||
|
packages_uninstall_extra: []
|
||||||
|
|
||||||
|
packages_upgrade_enabled: False
|
||||||
|
|
||||||
|
packages_dnf_installonly_limit: 2
|
14
handlers/main.yml
Normal file
14
handlers/main.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
- name: Upgrade all packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: "*"
|
||||||
|
state: latest
|
||||||
|
async: 1000
|
||||||
|
listen: __packages_upgrade
|
||||||
|
when: packages_upgrade_enabled | bool
|
||||||
|
tags:
|
||||||
|
- skip_ansible_later
|
||||||
|
|
||||||
|
- name: Clean metadata cache
|
||||||
|
ansible.builtin.command: dnf clean metadata
|
||||||
|
listen: __packages_clean_metadata
|
123
index.md
123
index.md
|
@ -1,123 +0,0 @@
|
||||||
---
|
|
||||||
title: packages
|
|
||||||
type: docs
|
|
||||||
---
|
|
||||||
|
|
||||||
[![Source Code](https://img.shields.io/badge/gitea-source%20code-blue?logo=gitea&logoColor=white)](https://gitea.rknet.org/ansible/xoxys.packages)
|
|
||||||
[![Build Status](https://img.shields.io/drone/build/ansible/xoxys.packages?logo=drone&server=https%3A%2F%2Fdrone.rknet.org)](https://drone.rknet.org/ansible/xoxys.packages)
|
|
||||||
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://gitea.rknet.org/ansible/xoxys.packages/src/branch/main/LICENSE)
|
|
||||||
|
|
||||||
Setup package repositories.
|
|
||||||
|
|
||||||
<!--more-->
|
|
||||||
|
|
||||||
- [Default Variables](#default-variables)
|
|
||||||
- [packages_enablerepo](#packages_enablerepo)
|
|
||||||
- [packages_install](#packages_install)
|
|
||||||
- [packages_install_extra](#packages_install_extra)
|
|
||||||
- [packages_repofiles_remove](#packages_repofiles_remove)
|
|
||||||
- [packages_uninstall](#packages_uninstall)
|
|
||||||
- [packages_uninstall_extra](#packages_uninstall_extra)
|
|
||||||
- [packages_upgrade_enabled](#packages_upgrade_enabled)
|
|
||||||
- [packages_yum_repositories](#packages_yum_repositories)
|
|
||||||
- [packages_yum_repositories_extra](#packages_yum_repositories_extra)
|
|
||||||
- [Dependencies](#dependencies)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Default Variables
|
|
||||||
|
|
||||||
### packages_enablerepo
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_enablerepo: []
|
|
||||||
```
|
|
||||||
|
|
||||||
### packages_install
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_install: []
|
|
||||||
```
|
|
||||||
|
|
||||||
### packages_install_extra
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_install_extra: []
|
|
||||||
```
|
|
||||||
|
|
||||||
### packages_repofiles_remove
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_repofiles_remove: []
|
|
||||||
```
|
|
||||||
|
|
||||||
### packages_uninstall
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_uninstall:
|
|
||||||
- setroubleshoot
|
|
||||||
- mcstransd
|
|
||||||
- xinetd
|
|
||||||
- ypbind
|
|
||||||
- telnet
|
|
||||||
```
|
|
||||||
|
|
||||||
### packages_uninstall_extra
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_uninstall_extra: []
|
|
||||||
```
|
|
||||||
|
|
||||||
### packages_upgrade_enabled
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_upgrade_enabled: false
|
|
||||||
```
|
|
||||||
|
|
||||||
### packages_yum_repositories
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_yum_repositories: []
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example usage
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_yum_repositories:
|
|
||||||
- name: epel
|
|
||||||
filename: Extra-EPEL
|
|
||||||
desc: Extra Packages for Enterprise Linux (EPEL)
|
|
||||||
baseurl: "http://download.fedoraproject.org/pub/epel/$releasever/$basearch/"
|
|
||||||
gpgkey: "http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-$releasever/"
|
|
||||||
enabled: True
|
|
||||||
```
|
|
||||||
|
|
||||||
### packages_yum_repositories_extra
|
|
||||||
|
|
||||||
#### Default value
|
|
||||||
|
|
||||||
```YAML
|
|
||||||
packages_yum_repositories_extra: []
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
None.
|
|
25
meta/main.yml
Normal file
25
meta/main.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
# @meta author:value: [Robert Kaussow](https://gitea.rknet.org/xoxys)
|
||||||
|
author: Robert Kaussow <mail@thegeeklab.de>
|
||||||
|
namespace: xoxys
|
||||||
|
role_name: packages
|
||||||
|
# @meta description: >
|
||||||
|
# [![Build Status](https://ci.rknet.org/api/badges/ansible/xoxys.packages/status.svg)](https://ci.rknet.org/repos/ansible/xoxys.packages)
|
||||||
|
# [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?label=license)](https://gitea.rknet.org/ansible/xoxys.packages/src/branch/main/LICENSE)
|
||||||
|
#
|
||||||
|
# Setup package repositories.
|
||||||
|
# @end
|
||||||
|
description: Setup package repositories
|
||||||
|
license: MIT
|
||||||
|
min_ansible_version: "2.10"
|
||||||
|
platforms:
|
||||||
|
- name: EL
|
||||||
|
versions:
|
||||||
|
- "9"
|
||||||
|
galaxy_tags:
|
||||||
|
- packages
|
||||||
|
- repository
|
||||||
|
dependencies: []
|
||||||
|
collections:
|
||||||
|
- community.general
|
5
molecule/default/converge.yml
Normal file
5
molecule/default/converge.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- name: Converge
|
||||||
|
hosts: all
|
||||||
|
roles:
|
||||||
|
- role: xoxys.packages
|
17
molecule/default/molecule.yml
Normal file
17
molecule/default/molecule.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
---
|
||||||
|
driver:
|
||||||
|
name: molecule_hetznercloud
|
||||||
|
dependency:
|
||||||
|
name: galaxy
|
||||||
|
options:
|
||||||
|
role-file: molecule/requirements.yml
|
||||||
|
requirements-file: molecule/requirements.yml
|
||||||
|
platforms:
|
||||||
|
- name: "rocky9-packages"
|
||||||
|
server_type: "cx11"
|
||||||
|
image: "rocky-9"
|
||||||
|
provisioner:
|
||||||
|
name: ansible
|
||||||
|
log: False
|
||||||
|
verifier:
|
||||||
|
name: testinfra
|
11
molecule/default/prepare.yml
Normal file
11
molecule/default/prepare.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
- 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
|
13
molecule/default/tests/test_default.py
Normal file
13
molecule/default/tests/test_default.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
import testinfra.utils.ansible_runner
|
||||||
|
|
||||||
|
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
||||||
|
os.environ["MOLECULE_INVENTORY_FILE"]
|
||||||
|
).get_hosts("all")
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("package", ["setroubleshoot", "mcstransd", "xinetd", "ypbind", "telnet"])
|
||||||
|
def test_packages_uninstalled(host, package):
|
||||||
|
assert not host.package(package).is_installed
|
4
molecule/requirements.yml
Normal file
4
molecule/requirements.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
collections: []
|
||||||
|
|
||||||
|
roles: []
|
17
pyproject.toml
Normal file
17
pyproject.toml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[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"]
|
54
tasks/main.yml
Normal file
54
tasks/main.yml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
---
|
||||||
|
- name: Uninstall prerequisite packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ packages_uninstall_pre + packages_uninstall_pre_extra }}"
|
||||||
|
|
||||||
|
- name: Adjust dnf config file
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: etc/dnf/dnf.conf.j2
|
||||||
|
dest: /etc/dnf/dnf.conf
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: Remove repository files
|
||||||
|
ansible.builtin.file:
|
||||||
|
name: "/etc/yum.repos.d/{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ packages_repofiles_remove }}"
|
||||||
|
loop_control:
|
||||||
|
label: "/etc/yum.repos.d/{{ item }}"
|
||||||
|
notify: __packages_clean_metadata
|
||||||
|
|
||||||
|
- name: Add common repositories
|
||||||
|
ansible.builtin.yum_repository:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
file: "{{ item.filename | default(omit) }}"
|
||||||
|
description: "{{ item.desc | default(omit) }}"
|
||||||
|
baseurl: "{{ item.baseurl | default(omit) }}"
|
||||||
|
gpgkey: "{{ item.gpgkey | default(omit) }}"
|
||||||
|
gpgcheck: "{{ item.gpgcheck | default('yes') }}"
|
||||||
|
sslverify: "{{ item.sslverify | default('yes') }}"
|
||||||
|
enabled: "{{ item.enabled | default('yes') }}"
|
||||||
|
state: "{{ item.state | default('present') }}"
|
||||||
|
loop: "{{ packages_yum_repositories + packages_yum_repositories_extra }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
|
notify:
|
||||||
|
- __packages_upgrade
|
||||||
|
- __packages_clean_metadata
|
||||||
|
|
||||||
|
- name: Uninstall packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: absent
|
||||||
|
loop: "{{ packages_uninstall + packages_uninstall_extra }}"
|
||||||
|
|
||||||
|
- name: Install common packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
enablerepo: "{{ packages_enablerepo }}"
|
||||||
|
state: present
|
||||||
|
loop: "{{ packages_install + packages_install_extra }}"
|
8
templates/etc/dnf/dnf.conf.j2
Normal file
8
templates/etc/dnf/dnf.conf.j2
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#jinja2: lstrip_blocks: True
|
||||||
|
{{ ansible_managed | comment }}
|
||||||
|
[main]
|
||||||
|
gpgcheck=1
|
||||||
|
installonly_limit={{ packages_dnf_installonly_limit }}
|
||||||
|
clean_requirements_on_remove=True
|
||||||
|
best=True
|
||||||
|
skip_if_unavailable=False
|
Loading…
Reference in New Issue
Block a user