You've already forked ansible-role-common
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 936e547c9a | |||
| b217e25268 | |||
| d7c732f5d1 | |||
| 7858cae385 | |||
| e2e85d3dd7 | |||
| ef49eb146d | |||
| b2bcbd2bca | |||
| 58d82220c6 | |||
| 1263539af9 | |||
| 5e354d9fb5 | |||
| dac92a402b | |||
| b08e31ba85 | |||
| 212e979ec6 |
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@@ -81,3 +81,36 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.G_TOKEN }}
|
||||||
GITEA_HOST: ${{ secrets.G_SERVER_URL}}
|
GITEA_HOST: ${{ secrets.G_SERVER_URL}}
|
||||||
|
notify:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- lint
|
||||||
|
- molecule
|
||||||
|
- release
|
||||||
|
steps:
|
||||||
|
- name: ntfy-success-notifications
|
||||||
|
uses: niniyas/ntfy-action@master
|
||||||
|
if: success()
|
||||||
|
with:
|
||||||
|
url: '${{ vars.NTFY_URL }}'
|
||||||
|
title: Workflow success - ansible-role-common
|
||||||
|
topic: 'ci-status'
|
||||||
|
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_TOKEN }}" }'
|
||||||
|
priority: 4
|
||||||
|
tags: +1,partying_face,action,successfully,completed
|
||||||
|
details: Workflow has been successfully completed!
|
||||||
|
icon: 'https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png'
|
||||||
|
image: true
|
||||||
|
|
||||||
|
- name: ntfy-failed-notifications
|
||||||
|
uses: niniyas/ntfy-action@master
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
url: '${{ vars.NTFY_URL }}'
|
||||||
|
title: Workflow failed - ansible-role-common
|
||||||
|
topic: 'ci-status'
|
||||||
|
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_TOKEN }}" }'
|
||||||
|
priority: 5
|
||||||
|
tags: -1,skull,action,failed
|
||||||
|
details: Workflow has failed!
|
||||||
|
actions: 'default'
|
||||||
|
|||||||
62
.github/workflows/cron.yml
vendored
Normal file
62
.github/workflows/cron.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
name: Regular test
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "47 2 * * 0"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
molecule:
|
||||||
|
name: Molecule Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
os: [almalinux8, almalinux9]
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
cache: 'pip' # caching pip dependencies
|
||||||
|
|
||||||
|
- name: Ensure requirements are installed
|
||||||
|
run: pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Run Molecule tests.
|
||||||
|
run: molecule test
|
||||||
|
env:
|
||||||
|
PY_COLORS: '1'
|
||||||
|
ANSIBLE_FORCE_COLOR: '1'
|
||||||
|
MOLECULE_DISTRO: ${{ matrix.os }}
|
||||||
|
notify:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: molecule
|
||||||
|
steps:
|
||||||
|
- name: ntfy-success-notifications
|
||||||
|
uses: niniyas/ntfy-action@master
|
||||||
|
if: success()
|
||||||
|
with:
|
||||||
|
url: '${{ vars.NTFY_URL }}'
|
||||||
|
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_TOKEN }}" }'
|
||||||
|
title: Workflow success - ansible-role-common
|
||||||
|
topic: 'ci-status'
|
||||||
|
priority: 4
|
||||||
|
tags: +1,partying_face,action,successfully,completed
|
||||||
|
details: Workflow has been successfully completed!
|
||||||
|
icon: 'https://styles.redditmedia.com/t5_32uhe/styles/communityIcon_xnt6chtnr2j21.png'
|
||||||
|
image: true
|
||||||
|
|
||||||
|
- name: ntfy-failed-notifications
|
||||||
|
uses: niniyas/ntfy-action@master
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
url: '${{ vars.NTFY_URL }}'
|
||||||
|
headers: '{"Authorization": "Bearer ${{ secrets.NTFY_TOKEN }}" }'
|
||||||
|
title: Workflow failed - ansible-role-common
|
||||||
|
topic: 'ci-status'
|
||||||
|
priority: 5
|
||||||
|
tags: -1,skull,action,failed
|
||||||
|
details: Workflow has failed!
|
||||||
|
actions: 'default'
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -16,3 +16,6 @@ env/
|
|||||||
|
|
||||||
# Do not commit Vault password
|
# Do not commit Vault password
|
||||||
.vault_password.txt
|
.vault_password.txt
|
||||||
|
# No commit of .secrets (Only for local CI Tests)
|
||||||
|
.secrets
|
||||||
|
.vars
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ provisioner:
|
|||||||
name: ansible
|
name: ansible
|
||||||
env:
|
env:
|
||||||
MOLECULE_NO_LOG: true
|
MOLECULE_NO_LOG: true
|
||||||
|
config_options:
|
||||||
|
defaults:
|
||||||
|
roles_path: "$MOLECULE_PROJECT_DIRECTORY/.."
|
||||||
# verifier:
|
# verifier:
|
||||||
# name: ansible
|
# name: ansible
|
||||||
# lint: |
|
# lint: |
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
ansible-core<2.17
|
ansible-core==2.16.3
|
||||||
ansible-compat >= 4
|
ansible-compat == 25.1.4
|
||||||
molecule[docker]== 24.2.1
|
molecule==25.3.1
|
||||||
ansible-lint==24.2.2
|
molecule-plugins[docker]==23.7.0
|
||||||
|
ansible-lint==6.22.2
|
||||||
yamllint==1.35.1
|
yamllint==1.35.1
|
||||||
passlib==1.7.4
|
passlib==1.7.4
|
||||||
@@ -24,7 +24,9 @@ if getent group "{{ admin_group }}" | grep -qw "$(whoami)"; then
|
|||||||
#ROOT=`/usr/bin/df / -x fuse.gvfs-fuse-daemon -Ph | /usr/bin/egrep -i 'root|logvol|vda' | awk '{print $4}' | tr -d '\n'`
|
#ROOT=`/usr/bin/df / -x fuse.gvfs-fuse-daemon -Ph | /usr/bin/egrep -i 'root|logvol|vda' | awk '{print $4}' | tr -d '\n'`
|
||||||
#HOME=`/usr/bin/df /home -x fuse.gvfs-fuse-daemon -Ph | grep home | awk '{print $4}' | tr -d '\n'`
|
#HOME=`/usr/bin/df /home -x fuse.gvfs-fuse-daemon -Ph | grep home | awk '{print $4}' | tr -d '\n'`
|
||||||
#BACKUP=`/usr/bin/df -x fuse.gvfs-fuse-daemon -Ph | grep backup | awk '{print $4}' | tr -d '\n'`
|
#BACKUP=`/usr/bin/df -x fuse.gvfs-fuse-daemon -Ph | grep backup | awk '{print $4}' | tr -d '\n'`
|
||||||
|
if [ -f /etc/fstab ]; then
|
||||||
FILESYSTEMS=`cat /etc/fstab | grep -v '#' | grep -v 'swap' | grep -v 'proc' | awk '{if(NF>0) {print $2}}'`
|
FILESYSTEMS=`cat /etc/fstab | grep -v '#' | grep -v 'swap' | grep -v 'proc' | awk '{if(NF>0) {print $2}}'`
|
||||||
|
fi
|
||||||
MEMORY=`/usr/bin/env free -m | /usr/bin/env grep "Mem" | /usr/bin/env awk '{print $2,"-",$3,"-",$4}'`
|
MEMORY=`/usr/bin/env free -m | /usr/bin/env grep "Mem" | /usr/bin/env awk '{print $2,"-",$3,"-",$4}'`
|
||||||
SWAP=`/usr/bin/env free -m | /usr/bin/env grep "Swap" | /usr/bin/env awk '{print $2,"-",$3,"-",$4}'`
|
SWAP=`/usr/bin/env free -m | /usr/bin/env grep "Swap" | /usr/bin/env awk '{print $2,"-",$3,"-",$4}'`
|
||||||
PSA=`/usr/bin/env ps -Afl | /usr/bin/env wc -l`
|
PSA=`/usr/bin/env ps -Afl | /usr/bin/env wc -l`
|
||||||
@@ -64,11 +66,9 @@ RESET_COLORS="\e[0m"
|
|||||||
echo -e "
|
echo -e "
|
||||||
===========================================================================
|
===========================================================================
|
||||||
$COLOR_COLUMN- Hostname$RESET_COLORS............: $COLOR_VALUE $HOSTNAME $RESET_COLORS
|
$COLOR_COLUMN- Hostname$RESET_COLORS............: $COLOR_VALUE $HOSTNAME $RESET_COLORS
|
||||||
{% if common_show_ipv6 == true %}
|
{% if common_show_ipv6 == true %}$COLOR_COLUMN- IP Address (Main v4)$RESET_COLORS: $COLOR_VALUE $IP $RESET_COLORS
|
||||||
$COLOR_COLUMN- IP Address (Main v4)$RESET_COLORS: $COLOR_VALUE $IP $RESET_COLORS
|
|
||||||
$COLOR_COLUMN- IP Address (Main v6)$RESET_COLORS: $COLOR_VALUE $IP6 $RESET_COLORS
|
$COLOR_COLUMN- IP Address (Main v6)$RESET_COLORS: $COLOR_VALUE $IP6 $RESET_COLORS
|
||||||
{% else %}
|
{% else %}$COLOR_COLUMN- IP Address (Default)$RESET_COLORS: $COLOR_VALUE $IP $RESET_COLORS
|
||||||
$COLOR_COLUMN- IP Address (Default)$RESET_COLORS: $COLOR_VALUE $IP $RESET_COLORS
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ansible_distribution == "Alpine" %}
|
{% if ansible_distribution == "Alpine" %}
|
||||||
$COLOR_COLUMN- Release$RESET_COLORS.............: $COLOR_VALUE Alpine `/usr/bin/env cat /etc/os-release` $RESET_COLORS
|
$COLOR_COLUMN- Release$RESET_COLORS.............: $COLOR_VALUE Alpine `/usr/bin/env cat /etc/os-release` $RESET_COLORS
|
||||||
@@ -92,6 +92,7 @@ for FS in ${FILESYSTEMS}; do
|
|||||||
echo -e "$COLOR_COLUMN- ..........$RESET_COLORS..........: $COLOR_VALUE `df -H ${FS} | grep -v 'Filesystem' | grep -v '^[[:space:]]*$' | awk '{print $6 \" \" $4}'` remaining $RESET_COLORS"
|
echo -e "$COLOR_COLUMN- ..........$RESET_COLORS..........: $COLOR_VALUE `df -H ${FS} | grep -v 'Filesystem' | grep -v '^[[:space:]]*$' | awk '{print $6 \" \" $4}'` remaining $RESET_COLORS"
|
||||||
done
|
done
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
"
|
||||||
echo -e "
|
echo -e "
|
||||||
===========================================================================
|
===========================================================================
|
||||||
"
|
"
|
||||||
|
|||||||
Reference in New Issue
Block a user