Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f18d866
fix: ansible lint use fcqn for builtins module actions
Apr 30, 2023
1c5ee54
fix: replace integer uses in versions by strings
Apr 30, 2023
d071f77
fix: ansible-lint errors fqcn and rename vars for get timestamp(as py…
Apr 30, 2023
48e45cc
fix: rename vars for get timestamp(as python private vars syntax)
Apr 30, 2023
9df2503
fix: improve jinja spacing
Apr 30, 2023
bdc0727
fix: replace yes by true for express boolean
Apr 30, 2023
c940f1d
fix: molecule test and improve yaml syntax
Apr 30, 2023
95e1ed0
feat: add molecule workflow in github actions
Apr 30, 2023
7c28f75
fix: change linter for molecule
Apr 30, 2023
026b042
fix: molecule lint failed in actions
Apr 30, 2023
7da795a
fix: jinja variables and filters should have spaces before and after
Apr 30, 2023
b6628cb
fix: give some privileges to the platform
Apr 30, 2023
c1f0b50
fix: add new line at the end of file
Apr 30, 2023
c33fa05
fix: install python dep's and test only in debian 11
Apr 30, 2023
500cb4f
fix: remove uses and run keys for a step
Apr 30, 2023
3e13943
fix: remove python3 install with apt
Apr 30, 2023
3401ba7
fix: install package using pip command directly
Apr 30, 2023
a5a8362
fix: deprrecation warning about using callback_whitelist option
Apr 30, 2023
7bdeb30
fix: deprecation warning by using ansible.builtin.ipaddr as filter
Apr 30, 2023
423886e
fix: handle bind service name changed in debian 11
Apr 30, 2023
89bbd47
fix: uses python image for install dependencies
Apr 30, 2023
eeec659
fix: run molecule test as command in workflow
Apr 30, 2023
7c7cb92
fix: python netaddr not installed in controller
Apr 30, 2023
55cbfb6
fix: rollback to initial workflow format
Apr 30, 2023
26f38e6
fix: specifiy clearly python version to use
Apr 30, 2023
7519b45
fix: use molecule test as command
Apr 30, 2023
ea1dc1b
fix: use role fqcn as path in workflow
Apr 30, 2023
6aa25b9
feat: add bullseye support
Apr 30, 2023
e27c806
fix: systemctl not found for shared_inventory scenario
Apr 30, 2023
beb5a10
fix: systemctl not found for shared_inventory scenario
Apr 30, 2023
0e14d45
fix: run scenarios in two steps instead one
Apr 30, 2023
071b351
tests: add more distributions in workflow
Apr 30, 2023
a9abd36
feat: add lint job in workflow
Apr 30, 2023
18c2b5b
fix: remove jammy support and update others ubuntu support
Apr 30, 2023
cb385b4
fix: handle service name change from ubuntu 20.04
Apr 30, 2023
74020b9
fix: remove old images and add amzn linux in workflow
Apr 30, 2023
56609fb
fix: remove amazon linux image in workflow
Apr 30, 2023
2d190b1
fix: remove actions in feature branch
Apr 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
exclude_paths:
- molecule/
- .pre-commit-config.yaml
- .github/

parseable: true

use_default_rules: true

enable_list:
# Specific to use of command and shell modules
- command-instead-of-module
- command-instead-of-shell
- deprecated-command-syntax
- inline-env-var
- no-changed-when
- risky-shell-pipe
# Related to internal implementation of the linter
- internal-error
- load-failure
- parser-error
- syntax-check
# Indicate use of features that are removed from Ansible
- deprecated-bare-vars
- deprecated-command-syntax
- deprecated-local-action
- deprecated-module
- no-jinja-when
- role-name
# Related to code-style
- no-jinja-nesting
- no-tabs
- playbook-extension
- risky-octal
- var-spacing
- yaml
# Possible indication that consequent runs would produce different results
- git-latest
- hg-latest
- no-changed-when
- package-latest
# Anti-pattern detected, likely to cause undesired behavior
- command-instead-of-module
- command-instead-of-shell
- empty-string-compare
- inline-env-var
- literal-compare
- no-handler
- no-loop-var-prefix
- no-relative-paths
- unnamed-task
- var-naming
# Invalid metadata, likely related to galaxy, collections or roles
- meta-incorrect
- meta-no-tags
- meta-video-links
- role-name
- ignore-errors
- partial-become
- syntax-check
# External linter which will also produce its own rule codes.
- yaml

warn_list:
- experimental # all rules tagged as experimental
- meta-no-info # meta/main.yml should contain relevant info
- risky-file-permissions # File permissions unset or incorrect

skip_list:
- role-name # BUG
- name[casing]

verbosity: 1
60 changes: 46 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,77 @@ name: CI
branches:
- master

defaults:
run:
working-directory: "bertvv.bind"

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out the codebase.
uses: actions/checkout@v3
with:
path: "bertvv.bind"

test:
- name: Set up Python 3.
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install test dependencies.
run: pip3 install yamllint

- name: Lint code.
run: |
yamllint .
molecule:
name: Molecule
runs-on: ubuntu-latest
strategy:
matrix:
distro:
- centos7
- centos8
- debian8
- debian9
- debian10
- ubuntu1604
- ubuntu1804
- ubuntu2004

- image: "quay.io/centos/centos"
tag: "stream8"
- image: "quay.io/centos/centos"
tag: "centos7"
- image: "debian"
tag: "11"
- image: "debian"
tag: "10"
- image: "ubuntu"
tag: "20.04"
- image: "ubuntu"
tag: "18.04"
- image: "ubuntu"
tag: "16.04"
steps:
- name: Check out the codebase.
uses: actions/checkout@v2
with:
path: "bertvv.bind"

- name: Set up Python 3
- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install test dependencies.
run: pip3 install ansible molecule molecule-docker yamllint ansible-lint docker netaddr dnspython
run: pip3 install ansible molecule molecule-plugins[docker] docker netaddr dnspython

- name: Run Molecule Primary/Secondary/Forwarder tests
run: molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.distro }}
image: ${{ matrix.distro.image }}
tag: ${{ matrix.distro.tag }}

- name: Run Molecule Shared Inventory tests
run: molecule test --scenario-name shared_inventory
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
MOLECULE_DISTRO: ${{ matrix.distro }}
image: ${{ matrix.distro.image }}
tag: ${{ matrix.distro.tag }}
59 changes: 7 additions & 52 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,57 +1,12 @@
---
extends: default

rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
max-spaces-inside: 1
level: error
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
level: warning
require-starting-space: true
min-spaces-from-content: 2
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
present: true
empty-lines:
max: 2
max-start: 0
max-end: 0
empty-values:
forbid-in-block-mappings: false
forbid-in-flow-mappings: false
hyphens:
max-spaces-after: 1
indentation:
spaces: consistent
indent-sequences: true
check-multi-line-strings: false
key-duplicates: enable
key-ordering: disable
line-length:
max: 1000
level: warning
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
allowed-values: ['true', 'false', 'yes', 'no']
level: warning
max-spaces-inside: 1
level: error
line-length: disable
document-start: disable
6 changes: 3 additions & 3 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: reload bind
service:
- name: Reload bind
ansible.builtin.systemd:
name: "{{ bind_service }}"
state: reloaded
become: yes
become: true
13 changes: 7 additions & 6 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@ galaxy_info:
Sets up ISC BIND as an authoritative DNS server for one or more domains
(primary and/or secondary).
license: BSD
min_ansible_version: 2.7
min_ansible_version: "2.7"
platforms:
- name: ArchLinux
versions:
- any
- all
- name: Debian
versions:
- jessie
- stretch
- buster
- bullseye
- name: FreeBSD
versions:
- 12.1
- "12.1"
- name: EL
versions:
- 6
- 7
- 8
- "6"
- "7"
- "8"
- name: Ubuntu
versions:
- xenial
Expand Down
24 changes: 24 additions & 0 deletions molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

{% if item.env is defined %}
{% for var, value in item.env.items() %}
{% if value %}
ENV {{ var }} {{ value }}
{% endif %}
{% endfor %}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python3 sudo bash ca-certificates iproute2 systemd wget && apt-get clean; \
elif [ $(command -v yum) ]; then yum install -y python3 sudo bash iproute systemd initscripts wget; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 wget && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates wget; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 wget && xbps-remove -O; fi

RUN wget -O /usr/bin/systemctl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py && \
chmod +x /usr/bin/systemctl
Loading