Rolle aktualisiert: ctop (#467)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: #467
This commit is contained in:
Michael Grote 2023-02-17 11:48:41 +01:00
parent 8d4acdeda6
commit 791b2adac5
22 changed files with 66 additions and 134 deletions

View file

@ -14,21 +14,21 @@ env:
jobs: jobs:
test: test:
name: Molecule test name: Molecule test
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
ansible-version: ansible-version:
- '2.9.1' - '2.10.7' # max-ansible-test-version
molecule-scenario: molecule-scenario:
- centos - rocky
- debian_max - debian_max
- debian_min - debian_min
- ubuntu_max - ubuntu_max
- opensuse - opensuse
- fedora - fedora
include: include:
- ansible-version: '2.8.16' - ansible-version: '2.9.26' # min-ansible-test-version
molecule-scenario: ubuntu_min molecule-scenario: ubuntu_min
env: env:
@ -41,7 +41,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: '3.6' python-version: '3.8'
- name: Cache Molecule - name: Cache Molecule
id: molecule-cache id: molecule-cache
@ -74,7 +74,7 @@ jobs:
test-all: test-all:
if: ${{ always() }} if: ${{ always() }}
name: Test (matrix) name: Test (matrix)
runs-on: ubuntu-18.04 runs-on: ubuntu-20.04
needs: test needs: test
steps: steps:
- name: Check test matrix status - name: Check test matrix status

View file

@ -1,29 +1,12 @@
name: Release name: Release
on: on:
push: release:
tags: types:
- '*' - published
jobs: jobs:
release: release:
name: Release name: Release
runs-on: ubuntu-18.04 uses: gantsign/workflows/.github/workflows/ansible-galaxy-import.yml@v1
steps: secrets: inherit
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'
- name: Install Ansible
run: pip3 install --no-compile ansible-base
- name: Trigger a new import on Galaxy
run: >-
ansible-galaxy role import
--api-key ${{ secrets.GALAXY_API_KEY }}
${GITHUB_REPOSITORY%%/*} ${GITHUB_REPOSITORY#*/}

View file

@ -1 +1 @@
2.9.1 2.10.7

View file

@ -1 +0,0 @@
4.3.1

View file

@ -1 +1 @@
3.8.4 4.0.1

View file

@ -1 +1 @@
3.0.8 3.1.5

View file

@ -1 +1 @@
3.6.7 3.8.10

View file

@ -1 +1 @@
1.25.0 1.26.3

View file

@ -12,7 +12,7 @@ a glance from your terminal.
Requirements Requirements
------------ ------------
* Ansible >= 2.8 * Ansible >= 2.9
* Linux Distribution * Linux Distribution
@ -20,29 +20,30 @@ Requirements
* Debian * Debian
* Jessie (8)
* Stretch (9) * Stretch (9)
* Buster (10)
* Bullseye (11)
* Ubuntu * Ubuntu
* Xenial (16.04)
* Bionic (18.04) * Bionic (18.04)
* Focal (20.04)
* RedHat Family * RedHat Family
* CentOS * Rocky Linux
* 7 * 8
* Fedora * Fedora
* 31 * 35
* SUSE Family * SUSE Family
* openSUSE * openSUSE
* 15.1 * 15.3
* Note: other versions are likely to work but have not been tested. * Note: other versions are likely to work but have not been tested.
@ -56,10 +57,10 @@ are shown below):
```yaml ```yaml
# ctop version number # ctop version number
ctop_version: '0.7.6' ctop_version: '0.7.7'
# SHA256 sum for the ctop redistributable # SHA256 sum for the ctop redistributable
ctop_redis_sha256sum: 'c5f8da250ec733084fb3891f2f8d04a49ffd25e81af59079216f2e6bb35fd983' ctop_redis_sha256sum: 'b78374734ebe3d14b6edee3d5512c911c250d7fa7f3f964cb00acd3bc5a02a09'
# Directory to store files downloaded for ctop # Directory to store files downloaded for ctop
ctop_download_dir: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}" ctop_download_dir: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}"

View file

@ -1,9 +1,9 @@
--- ---
# ctop version number # ctop version number
ctop_version: '0.7.6' ctop_version: '0.7.7'
# SHA256 sum for the ctop redistributable # SHA256 sum for the ctop redistributable
ctop_redis_sha256sum: 'c5f8da250ec733084fb3891f2f8d04a49ffd25e81af59079216f2e6bb35fd983' ctop_redis_sha256sum: 'b78374734ebe3d14b6edee3d5512c911c250d7fa7f3f964cb00acd3bc5a02a09'
# Directory to store files downloaded for ctop # Directory to store files downloaded for ctop
ctop_download_dir: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}" ctop_download_dir: "{{ x_ansible_download_dir | default(ansible_env.HOME + '/.ansible/tmp/downloads') }}"

View file

@ -5,25 +5,26 @@ galaxy_info:
description: Ansible role for downloading and installing ctop. description: Ansible role for downloading and installing ctop.
company: GantSign Ltd. company: GantSign Ltd.
license: MIT license: MIT
min_ansible_version: 2.8 min_ansible_version: 2.9
platforms: platforms:
- name: EL - name: EL
versions: versions:
- 7 - 8
- name: Fedora - name: Fedora
versions: versions:
- 31 - 35
- name: Ubuntu - name: Ubuntu
versions: versions:
- xenial
- bionic - bionic
- focal
- name: Debian - name: Debian
versions: versions:
- jessie
- stretch - stretch
- buster
- bullseye
- name: opensuse - name: opensuse
versions: versions:
- 15.1 - 15.3
galaxy_tags: galaxy_tags:
- ctop - ctop
- docker - docker

View file

@ -13,8 +13,7 @@ lint: |
platforms: platforms:
- name: ansible_role_ctop_debian_max - name: ansible_role_ctop_debian_max
image: debian:9 image: debian:11
dockerfile: ../default/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible

View file

@ -13,8 +13,7 @@ lint: |
platforms: platforms:
- name: ansible_role_ctop_debian_min - name: ansible_role_ctop_debian_min
image: debian:8 image: debian:9
dockerfile: ../default/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible

View file

@ -13,7 +13,7 @@ lint: |
platforms: platforms:
- name: ansible_role_ctop_default - name: ansible_role_ctop_default
image: ubuntu:18.04 image: ubuntu:20.04
provisioner: provisioner:
name: ansible name: ansible

View file

@ -13,8 +13,7 @@ lint: |
platforms: platforms:
- name: ansible_role_ctop_fedora - name: ansible_role_ctop_fedora
image: fedora:31 image: fedora:35
dockerfile: ../default/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible

View file

@ -13,8 +13,7 @@ lint: |
platforms: platforms:
- name: ansible_role_ctop_opensuse - name: ansible_role_ctop_opensuse
image: opensuse/leap:15.1 image: opensuse/leap:15.3
dockerfile: ../default/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible

View file

@ -12,9 +12,8 @@ lint: |
flake8 flake8
platforms: platforms:
- name: ansible_role_ctop_centos - name: ansible_role_ctop_rocky
image: centos:7 image: rockylinux/rockylinux:8
dockerfile: ../default/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible

View file

@ -13,8 +13,7 @@ lint: |
platforms: platforms:
- name: ansible_role_ctop_ubuntu_max - name: ansible_role_ctop_ubuntu_max
image: ubuntu:18.04 image: ubuntu:20.04
dockerfile: ../default/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible

View file

@ -13,8 +13,7 @@ lint: |
platforms: platforms:
- name: ansible_role_ctop_ubuntu_min - name: ansible_role_ctop_ubuntu_min
image: ubuntu:16.04 image: ubuntu:18.04
dockerfile: ../default/Dockerfile.j2
provisioner: provisioner:
name: ansible name: ansible

View file

@ -28,12 +28,11 @@
set -e set -e
WRAPPER_VERSION=1.1.0 WRAPPER_VERSION=1.2.0
VERSION_DIR='.moleculew' VERSION_DIR='.moleculew'
PYTHON_VERSION_FILE="$VERSION_DIR/python_version" PYTHON_VERSION_FILE="$VERSION_DIR/python_version"
ANSIBLE_VERSION_FILE="$VERSION_DIR/ansible_version" ANSIBLE_VERSION_FILE="$VERSION_DIR/ansible_version"
DOCKER_LIB_VERSION_FILE="$VERSION_DIR/docker_lib_version"
MOLECULE_VERSION_FILE="$VERSION_DIR/molecule_version" MOLECULE_VERSION_FILE="$VERSION_DIR/molecule_version"
YAMLLINT_VERSION_FILE="$VERSION_DIR/yamllint_version" YAMLLINT_VERSION_FILE="$VERSION_DIR/yamllint_version"
ANSIBLE_LINT_VERSION_FILE="$VERSION_DIR/ansible_lint_version" ANSIBLE_LINT_VERSION_FILE="$VERSION_DIR/ansible_lint_version"
@ -44,7 +43,6 @@ BUILD_DEPENDENCIES_INSTALLLED=false
PYENV_INSTALLED=false PYENV_INSTALLED=false
ANSIBLE_VERSION='' ANSIBLE_VERSION=''
DOCKER_LIB_VERSION=''
MOLECULE_VERSION='' MOLECULE_VERSION=''
PYTHON_VERSION='' PYTHON_VERSION=''
YAMLLINT_VERSION='' YAMLLINT_VERSION=''
@ -183,7 +181,7 @@ docker_present() {
return return
fi fi
if [[ $USE_SYSTEM_DEPENDENCIES == true ]]; then if [[ $USE_SYSTEM_DEPENDENCIES == true ]]; then
echo 'Error: docker is not installed.' >&2 echo 'Error: Docker is not installed.' >&2
exit 1 exit 1
fi fi
@ -238,22 +236,24 @@ virtualenv_presant() {
fi fi
} }
install_rich() {
# Workaround breaking changes in rich 11 by installing version 10
local RICH_VERSION='10.16.2'
banner "Installing Rich $RICH_VERSION into virtualenv $VIRTUAL_ENV"
pip install "rich==$RICH_VERSION"
echo ''
}
install_ansible() { install_ansible() {
banner "Installing Ansible $ANSIBLE_VERSION into virtualenv $VIRTUAL_ENV" banner "Installing Ansible $ANSIBLE_VERSION into virtualenv $VIRTUAL_ENV"
pip install "ansible==$ANSIBLE_VERSION" pip install "ansible==$ANSIBLE_VERSION"
echo '' echo ''
} }
install_docker_lib() {
banner "Installing Python Docker $DOCKER_LIB_VERSION into virtualenv $VIRTUAL_ENV"
pip install "docker==$DOCKER_LIB_VERSION"
echo ''
}
install_molecule() { install_molecule() {
banner "Installing Molecule $MOLECULE_VERSION into virtualenv $VIRTUAL_ENV" banner "Installing Molecule $MOLECULE_VERSION into virtualenv $VIRTUAL_ENV"
pip install "molecule==$MOLECULE_VERSION" pip install "molecule[docker]==$MOLECULE_VERSION"
echo '' echo ''
} }
@ -323,7 +323,6 @@ wrapper_version() {
print_versions() { print_versions() {
echo "Python: $PYTHON_VERSION" echo "Python: $PYTHON_VERSION"
echo "Ansible: $ANSIBLE_VERSION" echo "Ansible: $ANSIBLE_VERSION"
echo "Python Docker library: $DOCKER_LIB_VERSION"
echo "Molecule: $MOLECULE_VERSION" echo "Molecule: $MOLECULE_VERSION"
echo "YamlLint: $YAMLLINT_VERSION" echo "YamlLint: $YAMLLINT_VERSION"
echo "Ansible Lint: $ANSIBLE_LINT_VERSION" echo "Ansible Lint: $ANSIBLE_LINT_VERSION"
@ -347,7 +346,6 @@ wrapper_freeze() {
echo "$PYTHON_VERSION" > "$PYTHON_VERSION_FILE" echo "$PYTHON_VERSION" > "$PYTHON_VERSION_FILE"
echo "$ANSIBLE_VERSION" > "$ANSIBLE_VERSION_FILE" echo "$ANSIBLE_VERSION" > "$ANSIBLE_VERSION_FILE"
echo "$DOCKER_LIB_VERSION" > "$DOCKER_LIB_VERSION_FILE"
echo "$MOLECULE_VERSION" > "$MOLECULE_VERSION_FILE" echo "$MOLECULE_VERSION" > "$MOLECULE_VERSION_FILE"
echo "$YAMLLINT_VERSION" > "$YAMLLINT_VERSION_FILE" echo "$YAMLLINT_VERSION" > "$YAMLLINT_VERSION_FILE"
echo "$ANSIBLE_LINT_VERSION" > "$ANSIBLE_LINT_VERSION_FILE" echo "$ANSIBLE_LINT_VERSION" > "$ANSIBLE_LINT_VERSION_FILE"
@ -368,9 +366,6 @@ wrapper_unfreeze() {
if [[ -f "$ANSIBLE_VERSION_FILE" ]]; then if [[ -f "$ANSIBLE_VERSION_FILE" ]]; then
rm --verbose "$ANSIBLE_VERSION_FILE" rm --verbose "$ANSIBLE_VERSION_FILE"
fi fi
if [[ -f "$DOCKER_LIB_VERSION_FILE" ]]; then
rm --verbose "$DOCKER_LIB_VERSION_FILE"
fi
if [[ -f "$MOLECULE_VERSION_FILE" ]]; then if [[ -f "$MOLECULE_VERSION_FILE" ]]; then
rm --verbose "$MOLECULE_VERSION_FILE" rm --verbose "$MOLECULE_VERSION_FILE"
fi fi
@ -397,7 +392,6 @@ wrapper_upgrade_versions() {
local CURRENT_PYTHON_VERSION="$PYTHON_VERSION" local CURRENT_PYTHON_VERSION="$PYTHON_VERSION"
local CURRENT_ANSIBLE_VERSION="$ANSIBLE_VERSION" local CURRENT_ANSIBLE_VERSION="$ANSIBLE_VERSION"
local CURRENT_DOCKER_LIB_VERSION="$DOCKER_LIB_VERSION"
local CURRENT_MOLECULE_VERSION="$MOLECULE_VERSION" local CURRENT_MOLECULE_VERSION="$MOLECULE_VERSION"
local CURRENT_YAMLLINT_VERSION="$YAMLLINT_VERSION" local CURRENT_YAMLLINT_VERSION="$YAMLLINT_VERSION"
local CURRENT_ANSIBLE_LINT_VERSION="$ANSIBLE_LINT_VERSION" local CURRENT_ANSIBLE_LINT_VERSION="$ANSIBLE_LINT_VERSION"
@ -406,7 +400,6 @@ wrapper_upgrade_versions() {
query_latest_python_version query_latest_python_version
query_latest_package_version ANSIBLE_VERSION ansible query_latest_package_version ANSIBLE_VERSION ansible
query_latest_package_version DOCKER_LIB_VERSION docker
query_latest_package_version MOLECULE_VERSION molecule query_latest_package_version MOLECULE_VERSION molecule
query_latest_package_version YAMLLINT_VERSION yamllint query_latest_package_version YAMLLINT_VERSION yamllint
query_latest_package_version ANSIBLE_LINT_VERSION ansible-lint query_latest_package_version ANSIBLE_LINT_VERSION ansible-lint
@ -427,12 +420,6 @@ wrapper_upgrade_versions() {
echo "Ansible: $CURRENT_ANSIBLE_VERSION -> $ANSIBLE_VERSION" echo "Ansible: $CURRENT_ANSIBLE_VERSION -> $ANSIBLE_VERSION"
fi fi
if [[ "$CURRENT_DOCKER_LIB_VERSION" == "$DOCKER_LIB_VERSION" ]]; then
echo "Python Docker library: $CURRENT_DOCKER_LIB_VERSION (no change)"
else
echo "Python Docker library: $CURRENT_DOCKER_LIB_VERSION -> $DOCKER_LIB_VERSION"
fi
if [[ "$CURRENT_MOLECULE_VERSION" == "$MOLECULE_VERSION" ]]; then if [[ "$CURRENT_MOLECULE_VERSION" == "$MOLECULE_VERSION" ]]; then
echo "Molecule: $CURRENT_MOLECULE_VERSION (no change)" echo "Molecule: $CURRENT_MOLECULE_VERSION (no change)"
else else
@ -478,8 +465,6 @@ Molecule Wrapper
Additional options: Additional options:
--ansible VERSION Use the specified version of Ansible --ansible VERSION Use the specified version of Ansible
--docker-lib VERSION Use the specified version of the Python Docker
library
--molecule VERSION Use the specified version of Molecule --molecule VERSION Use the specified version of Molecule
--python VERSION Use the specified version of Python --python VERSION Use the specified version of Python
--yamllint VERSION Use the specified version of YamlLint --yamllint VERSION Use the specified version of YamlLint
@ -538,14 +523,9 @@ wrapper_options_ansible() {
query_package_versions 'ansible' '2.8' query_package_versions 'ansible' '2.8'
} }
wrapper_options_docker_lib() {
echo 'latest'
query_package_versions 'docker' '3.0'
}
wrapper_options_molecule() { wrapper_options_molecule() {
echo 'latest' echo 'latest'
query_package_versions 'molecule' '3.0.6' query_package_versions 'molecule' '3.1.5'
} }
wrapper_options_python() { wrapper_options_python() {
@ -574,22 +554,22 @@ wrapper_options_python() {
wrapper_options_yamllint() { wrapper_options_yamllint() {
echo 'latest' echo 'latest'
query_package_versions 'yamllint' '1.24.2' query_package_versions 'yamllint' '1.26.3'
} }
wrapper_options_ansible_lint() { wrapper_options_ansible_lint() {
echo 'latest' echo 'latest'
query_package_versions 'ansible_lint' '4.2.0' query_package_versions 'ansible_lint' '5.4.0'
} }
wrapper_options_flake8() { wrapper_options_flake8() {
echo 'latest' echo 'latest'
query_package_versions 'flake8' '3.8.3' query_package_versions 'flake8' '4.0.1'
} }
wrapper_options_testinfra() { wrapper_options_testinfra() {
echo 'latest' echo 'latest'
query_package_versions 'testinfra' '5.2.2' query_package_versions 'testinfra' '5.3.1'
} }
wrapper_options_scenario() { wrapper_options_scenario() {
@ -633,15 +613,6 @@ parse_args() {
ANSIBLE_VERSION="$1" ANSIBLE_VERSION="$1"
shift shift
;; ;;
--docker-lib=*)
DOCKER_LIB_VERSION="${1#*=}"
shift
;;
--docker-lib)
shift
DOCKER_LIB_VERSION="$1"
shift
;;
--molecule=*) --molecule=*)
MOLECULE_VERSION="${1#*=}" MOLECULE_VERSION="${1#*=}"
shift shift
@ -730,9 +701,6 @@ detemine_versions() {
if [[ $ANSIBLE_VERSION == '' ]]; then if [[ $ANSIBLE_VERSION == '' ]]; then
ANSIBLE_VERSION="$MOLECULEW_ANSIBLE" ANSIBLE_VERSION="$MOLECULEW_ANSIBLE"
fi fi
if [[ $DOCKER_LIB_VERSION == '' ]]; then
DOCKER_LIB_VERSION="$MOLECULEW_DOCKER_LIB"
fi
if [[ $MOLECULE_VERSION == '' ]]; then if [[ $MOLECULE_VERSION == '' ]]; then
MOLECULE_VERSION="$MOLECULEW_MOLECULE" MOLECULE_VERSION="$MOLECULEW_MOLECULE"
fi fi
@ -777,17 +745,6 @@ detemine_versions() {
query_latest_package_version ANSIBLE_VERSION ansible query_latest_package_version ANSIBLE_VERSION ansible
fi fi
if [[ $DOCKER_LIB_VERSION == '' ]] || [[ $DOCKER_LIB_VERSION == 'default' ]]; then
if [[ -f $DOCKER_LIB_VERSION_FILE ]]; then
DOCKER_LIB_VERSION=$(<"$DOCKER_LIB_VERSION_FILE")
fi
if [[ $DOCKER_LIB_VERSION == '' ]]; then
query_latest_package_version DOCKER_LIB_VERSION docker
fi
elif [[ $DOCKER_LIB_VERSION == 'latest' ]]; then
query_latest_package_version DOCKER_LIB_VERSION docker
fi
if [[ $MOLECULE_VERSION == '' ]] || [[ $MOLECULE_VERSION == 'default' ]]; then if [[ $MOLECULE_VERSION == '' ]] || [[ $MOLECULE_VERSION == 'default' ]]; then
if [[ -f $MOLECULE_VERSION_FILE ]]; then if [[ -f $MOLECULE_VERSION_FILE ]]; then
MOLECULE_VERSION=$(<$MOLECULE_VERSION_FILE) MOLECULE_VERSION=$(<$MOLECULE_VERSION_FILE)
@ -847,7 +804,7 @@ detemine_versions() {
activate_virtualenv() { activate_virtualenv() {
detemine_versions detemine_versions
MOLECULE_WRAPPER_ENV="$HOME/.moleculew/ml-${MOLECULE_VERSION}_an-${ANSIBLE_VERSION}_py-${PYTHON_VERSION}_dk-${DOCKER_LIB_VERSION}_yl-${YAMLLINT_VERSION}_al-${ANSIBLE_LINT_VERSION}_f8-${FLAKE8_VERSION}_ti-${TESTINFRA_VERSION}" MOLECULE_WRAPPER_ENV="$HOME/.moleculew/ml-${MOLECULE_VERSION}_an-${ANSIBLE_VERSION}_py-${PYTHON_VERSION}_yl-${YAMLLINT_VERSION}_al-${ANSIBLE_LINT_VERSION}_f8-${FLAKE8_VERSION}_ti-${TESTINFRA_VERSION}"
if [ ! -f "$MOLECULE_WRAPPER_ENV/bin/activate" ]; then if [ ! -f "$MOLECULE_WRAPPER_ENV/bin/activate" ]; then
@ -865,9 +822,10 @@ activate_virtualenv() {
source "$MOLECULE_WRAPPER_ENV/bin/activate" source "$MOLECULE_WRAPPER_ENV/bin/activate"
echo '' echo ''
install_ansible # Workaround breaking changes in rich 11 by installing version 10
install_rich
install_docker_lib install_ansible
install_molecule install_molecule
@ -902,9 +860,6 @@ case $MOLECULE_CMD in
wrapper-options-ansible) wrapper-options-ansible)
wrapper_options_ansible wrapper_options_ansible
;; ;;
wrapper-options-docker-lib)
wrapper_options_docker_lib
;;
wrapper-options-molecule) wrapper-options-molecule)
wrapper_options_molecule wrapper_options_molecule
;; ;;

View file

@ -6,7 +6,7 @@ ctop_install_dir: '/usr/local/bin'
ctop_install_path: '{{ ctop_install_dir }}/ctop' ctop_install_path: '{{ ctop_install_dir }}/ctop'
# Mirror to download the ctop from # Mirror to download the ctop from
ctop_mirror: 'https://github.com/bcicen/ctop/releases/download/{{ ctop_version }}' ctop_mirror: 'https://github.com/bcicen/ctop/releases/download/v{{ ctop_version }}'
# The OS of the ctop redistributable # The OS of the ctop redistributable
ctop_os: 'linux' ctop_os: 'linux'