Skip to content

Commit

Permalink
add ansible fqdn
Browse files Browse the repository at this point in the history
  • Loading branch information
bodsch committed Dec 9, 2022
1 parent df9ec36 commit a107ed7
Show file tree
Hide file tree
Showing 26 changed files with 267 additions and 230 deletions.
4 changes: 2 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---

skip_list:
- role-name
# - yaml
- name[casing]
- name[template]
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

[*.py]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

30 changes: 30 additions & 0 deletions .github/workflows/galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

name: push to ansible galaxy

on:
workflow_dispatch:
workflow_run:
workflows:
- "CI"
branches:
- main
types:
- completed

jobs:
galaxy:
name: galaxy
runs-on: ubuntu-20.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out the codebase
uses: actions/checkout@v3
with:
path: 'ansible-algernon'

- name: galaxy
uses: robertdebock/galaxy-action@1.2.1
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
git_branch: main
33 changes: 33 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---

name: code linter

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- testing

jobs:
lint:
name: linting
runs-on: ubuntu-latest
steps:
- name: 🛎 Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: lint
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GH_REGISTRY_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_ANSIBLE: true
# VALIDATE_MARKDOWN: true
VALIDATE_YAML: true

...
121 changes: 46 additions & 75 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,49 @@
name: CI

on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 2 * * 0"
workflow_dispatch:
workflow_run:
workflows:
- "code linter"
branches:
- main
- feature
types:
- completed

defaults:
run:
working-directory: 'ansible-algernon'

jobs:
lint:
name: linting
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: lint
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
# DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GH_REGISTRY_TOKEN }}
VALIDATE_ALL_CODEBASE: true
VALIDATE_ANSIBLE: true
# VALIDATE_MARKDOWN: true
VALIDATE_YAML: true

arch:
name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
needs:
- lint
runs-on: ubuntu-18.04
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
image:
- archlinux:latest
python-version:
- '3.9'
# - artixlinux:latest
ansible-version:
- '4.1.0'
- '5.1.0'
- '5.10'
- '6.7'
- '7.0'

steps:
- name: check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: 'ansible-algernon'

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: 🐍 set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'

- name: install dependencies
run: |
Expand All @@ -67,40 +53,39 @@ jobs:
- name: test with tox
run: |
tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- molecule test
tox -e ansible_$(printf "${{ matrix.ansible-version }}") \
-- molecule test --scenario-name default
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}

deb:
name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
needs:
- lint
runs-on: ubuntu-18.04
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
image:
- debian:10
- debian:11
- ubuntu:20.04
python-version:
- '3.9'
ansible-version:
- '4.1.0'
- '5.1.0'
- '5.10'
- '6.7'
- '7.0'

steps:
- name: check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: 'ansible-algernon'

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: 🐍 set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'

- name: install dependencies
run: |
Expand All @@ -109,40 +94,39 @@ jobs:
- name: test with tox
run: |
tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- molecule test
tox -e ansible_$(printf "${{ matrix.ansible-version }}") \
-- molecule test --scenario-name default
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}

rpm:
name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
needs:
- lint
runs-on: ubuntu-18.04
name: "${{ matrix.image }} / ansible: ${{ matrix.ansible-version }}"
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
image:
- oraclelinux:8
- rockylinux:8
- almalinux:8
python-version:
- '3.9'
ansible-version:
- '4.1.0'
- '5.1.0'
- '5.10'
- '6.7'
- '7.0'

steps:
- name: check out the codebase.
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: 'ansible-algernon'

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: 🐍 set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: '3.x'

- name: install dependencies
run: |
Expand All @@ -151,22 +135,9 @@ jobs:
- name: test with tox
run: |
tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- molecule test
tox -e ansible_$(printf "${{ matrix.ansible-version }}") \
-- molecule test --scenario-name default
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}

publish:
if: github.ref == 'refs/heads/main'
needs:
- arch
- deb
- rpm
runs-on: ubuntu-18.04
steps:
- name: galaxy
uses: robertdebock/galaxy-action@1.2.0
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
git_branch: main
43 changes: 27 additions & 16 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
---
# Based on ansible-lint config
extends: default

rules:
line-length:
max: 195
level: warning
braces:
min-spaces-inside: 0
braces:
max-spaces-inside: 1
level: error
brackets:
min-spaces-inside: 0
max-spaces-inside: 1
indentation:
spaces: 2
level: error
colons:
max-spaces-after: -1
level: error
commas:
max-spaces-after: -1
level: error
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
max: 3
level: error
hyphens:
level: error
indentation:
spaces: 2
key-duplicates: enable
line-length:
max: 195
level: warning
new-line-at-end-of-file: disable
new-lines:
type: unix
trailing-spaces: disable
truthy: disable

ignore: |
tests/
molecule/
.molecule/
.travis.yml
.tox
.github
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
export TOX_SCENARIO ?= default
export TOX_PYTHON ?= py310
export TOX_ANSIBLE ?= ansible510
# export TOX_PYTHON ?= py310
export TOX_ANSIBLE ?= ansible_6.1

.PHONY: converge destroy verify lint

Expand Down
Loading

0 comments on commit a107ed7

Please sign in to comment.