Skip to content

Commit

Permalink
Merge pull request #558 from manala/refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gfaivre authored Dec 17, 2021
2 parents 9fc0473 + 43eccc4 commit fa19411
Show file tree
Hide file tree
Showing 4,010 changed files with 37,934 additions and 246,580 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exclude_paths:
# Github
- .github
82 changes: 82 additions & 0 deletions .config/molecule/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---

driver:
name: docker

platforms:
- name: debian.stretch
groups: [debian]
image: jrei/systemd-debian:stretch
dockerfile: ../Dockerfile.debian.stretch.j2
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
tmpfs:
- /tmp
override_command: false
- name: debian.buster
groups: [debian]
image: jrei/systemd-debian:buster
dockerfile: ../Dockerfile.debian.buster.j2
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
tmpfs:
- /tmp
override_command: false
- name: debian.bullseye
groups: [debian]
image: jrei/systemd-debian:bullseye
dockerfile: ../Dockerfile.debian.bullseye.j2
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
tmpfs:
- /tmp
override_command: false

provisioner:
name: ansible
config_options:
defaults:
stdout_callback: yaml
gathering: smart
fact_caching: jsonfile
fact_caching_connection: facts.json
fact_caching_timeout: 3600
inventory:
host_vars:
debian.stretch:
# Force python version on debian stretch
ansible_python_interpreter: /usr/bin/python3

scenario:
create_sequence:
- create
- prepare
cleanup_sequence:
- cleanup
check_sequence:
- cleanup
- destroy
- create
- prepare
- converge
- check
- cleanup
- destroy
converge_sequence:
- create
- prepare
- converge
destroy_sequence:
- cleanup
- destroy
test_sequence:
- cleanup
- destroy
- create
- prepare
- converge
- cleanup
- destroy
12 changes: 0 additions & 12 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
# Ansible
#ANSIBLE_VERSION=edge

# Verbose
#VERBOSE=2

# Cache
#CACHE_DIR=$(HOME)/workspace/manala/ansible/roles/.cache

# Collection
#COLLECTION_API_TOKEN=

# Gitsplit
#export GITSPLIT_GITHUB_API_TOKEN=
77 changes: 77 additions & 0 deletions .github/workflows/collection-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---

name: Collection Release
on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-20.04
if: "contains(github.event.head_commit.message, 'Release')"
steps:
- name: Notify Slack of starting
uses: act10ns/slack@v1
with:
status: starting
channel: '#collection_release'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

- uses: actions/checkout@v2

- name: Build Collection
run: make collection.build

- name: Publish Collection
run: make collection.publish
env:
COLLECTION_API_TOKEN: ${{ secrets.COLLECTION_API_TOKEN }}

- name: Retrieve version from galaxy.yml
id: get_version
uses: CumulusDS/[email protected]
with:
file: ./galaxy.yml
version: version

- name: Get Changelog Entry
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
path: ./CHANGELOG.md
version: ${{steps.get_version.outputs.version }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.version }}
release_name: manala-roles ${{ steps.changelog.outputs.version }}
body: ${{ steps.changelog.outputs.changes }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload_release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./manala-roles-${{ steps.changelog.outputs.version }}.tar.gz
asset_name: manala-roles-${{ steps.changelog.outputs.version }}.tar.gz
asset_content_type: application/zip

- name: Notify Slack of action status
uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#collection_release'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: always()
81 changes: 0 additions & 81 deletions .github/workflows/collection-release.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Lint

on:
pull_request:
workflow_dispatch:

jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint
uses: docker://quay.io/ansible/toolset:3.5.0
with:
args: ansible-lint
40 changes: 40 additions & 0 deletions .github/workflows/molecule.accounts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Molecule - Accounts

on:
pull_request:
paths:
- .github/workflows/molecule.accounts.yml
- .config/molecule/config.yml
- molecule/Dockerfile.*
- molecule/accounts/**
- roles/accounts/**
# Plugins
- plugins/filter/staten.py
- plugins/lookup/accounts_users_authorized_keys.py
workflow_dispatch:
inputs:
debug:
description: Run with tmate debugging
required: false
default: false

jobs:
molecule:
name: Molecule
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ansible_collections/manala/roles
- name: Molecule
uses: docker://quay.io/ansible/toolset:3.5.0
with:
args: |
sh -c " \
cd ansible_collections/manala/roles \
&& molecule converge --scenario-name accounts \
"
- name: Debug
uses: mxschmitt/action-tmate@v3
if: github.event.inputs.debug && always()
39 changes: 39 additions & 0 deletions .github/workflows/molecule.alternatives.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Molecule - Alternatives

on:
pull_request:
paths:
- .github/workflows/molecule.alternatives.yml
- .config/molecule/config.yml
- molecule/Dockerfile.*
- molecule/alternatives/**
- roles/alternatives/**
# Plugins
- plugins/filter/staten.py
workflow_dispatch:
inputs:
debug:
description: Run with tmate debugging
required: false
default: false

jobs:
molecule:
name: Molecule
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
path: ansible_collections/manala/roles
- name: Molecule
uses: docker://quay.io/ansible/toolset:3.5.0
with:
args: |
sh -c " \
cd ansible_collections/manala/roles \
&& molecule converge --scenario-name alternatives \
"
- name: Debug
uses: mxschmitt/action-tmate@v3
if: github.event.inputs.debug && always()
Loading

0 comments on commit fa19411

Please sign in to comment.