Skip to content

Commit

Permalink
fix ci, remove support for outdated distros
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhoesel committed Feb 12, 2024
1 parent e3814ac commit cbe679a
Show file tree
Hide file tree
Showing 16 changed files with 277 additions and 110 deletions.
21 changes: 21 additions & 0 deletions .config/ansible-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# Don't automatically install roles from galaxy
offline: true

exclude_paths:
- ".cache"
- tests/integration/targets/
- .github/

# Unfortunately, warnings only show up when running ansible-lint normally, not during pre-commit
warn_list:
- "name[missing]" # this is *sometimes* okay, like with a block or simple include

skip_list:
- "key-order[task]" # Lots of false positives from this one, any equals sign in a command will trigger it
- "no-free-form" # ... really?
- "galaxy[version-incorrect]" # This errors on 0.x versions, which we are totally okay with
- "fqcn-builtins" # While we should migrate away from the old builtins, this is in no way urgent
- "name[casing]" # too noisy, does not account for names starting with variable names
- "name[play]" # The only plays in a collection are going to be molecule plays, which already have a name through their filename
- "var-naming[no-role-prefix]" # we started out with postfix_ instead of postfix_nullclient. not worth breaking compatibility for
28 changes: 28 additions & 0 deletions .config/molecule/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
dependency:
name: galaxy

driver:
name: docker

provisioner:
name: ansible
env:
ANSIBLE_PIPELINING: true

scenario:
test_sequence:
- destroy
- dependency
- syntax
- create
- prepare
- converge
- idempotence
- check # also run check mode in regular tests
- side_effect
- verify
- destroy

verifier:
name: ansible
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@ on:
pull_request:
workflow_dispatch:

defaults:
run:
working-directory: postfix_nullclient

jobs:
lint:
name: "CI"
runs-on: ubuntu-latest
strategy:
matrix:
job:
- molecule-ansible8
- molecule-ansible9
- lint
steps:
- name: Check out codebase
uses: actions/checkout@v2
with:
fetch-depth: 0
path: postfix_nullclient

- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.12"
- name: Set up pip
run: pip3 install --upgrade pip

- name: Install tox
run: sudo apt update && sudo apt install -y tox
run: sudo apt update && apt -y install tox

- name: Run Tox
run: tox
run: tox -e ${{ matrix.job }}
5 changes: 5 additions & 0 deletions .github/workflows/rennovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"github>maxhoesel-ansible/.github:renovate-config"
]
}
156 changes: 154 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,154 @@
.cache
.tox
.vscode/

### Ansible ###
*.retry

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/Nox
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
pytestdebug.log

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.Nox
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv*
venv*/
env/
venv/
ENV/
env.bak/
venv.bak/
pythonenv*

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# profiling data
.prof

# Ansible collection archives
*.tar.gz
docs/ansible_collections/

# Don't commit ephermal integration config
tests/integration/integration_config.yml
collections

# CI files
results
split-tests
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ Requirements
- A recent Ansible version. This role supports the 2 most recent major Ansible releases.
Older versions might still work, but are not supported
- A host running:
- Ubuntu 18.04 LTS or newer
- Debian 10 or newer
- Arch Linux
- Ubuntu 20.04 LTS or newer
- Debian 11 or newer
- Other distributions may work, but are not supported (Feel free to add support with a PR!)

Role Variables
Expand Down
6 changes: 4 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
# handlers file for postfix_nullclient
# code: language=ansible
- name: restart postfix
service:
name: postfix
state: restarted
become: yes

- name: rehash sasl_passwd
- name: rehash sasl_passwd # noqa no-changed-when
command: "postmap {{ postfix_config_path }}/{{ postfix_sasl_file }}"
become: yes
8 changes: 4 additions & 4 deletions meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ argument_specs:
options:
postfix_relayhost:
type: str
required: yes
required: true
description: Hostname or IP address of the host to send mails to
postfix_port:
type: int
description: Optionally overwite the automatically selecteed port (see README.md)
postfix_relayhost_auth:
type: bool
default: yes
default: true
description: Set to yes if you need to login with a username and password
postfix_relayhost_username:
type: str
Expand All @@ -22,15 +22,15 @@ argument_specs:
postfix_tls:
type: bool
description: Whether to use TLS when connecting to the relayhost
default: yes
default: true
postfix_tls_mode:
type: str
choices: ["SSL/TLS", "STARTTLS"]
description: Whether to use an implicit (SSL/TLS) or explicit/upgrade (STARTTLS) TLS connetion.
default: "SSL/TLS"
postfix_tls_verify_cert:
type: bool
default: yes
default: true
description: Whether to verify the remote TLS cert. Only turn this off if you want to use a self-signed certificate and know what you are doing
postfix_tls_custom_cafile:
type: str
Expand Down
9 changes: 4 additions & 5 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ galaxy_info:
role_name: postfix_nullclient

license: license GPL-3.0-or-later

min_ansible_version: 2.9

min_ansible_version: "2.9"
platforms:
- name: Ubuntu
versions:
- bionic
- focal
- jammy
- name: Debian
versions:
- buster
- bullseye
- bookworm

galaxy_tags: ["postfix"]

Expand Down
2 changes: 1 addition & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
tasks:
- name: "Include postfix_nullclient"
include_role:
name: "postfix_nullclient"
name: "maxhoesel.postfix_nullclient"
vars:
postfix_relayhost: mail.invalid.tld
postfix_relayhost_username: [email protected]
Expand Down
Loading

0 comments on commit cbe679a

Please sign in to comment.