Skip to content

Commit

Permalink
update molecule + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe LEAL committed Aug 25, 2021
1 parent aa34e6b commit fd58919
Show file tree
Hide file tree
Showing 13 changed files with 359 additions and 237 deletions.
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
skip_list:
- '106'
- '401'
173 changes: 101 additions & 72 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,83 +1,112 @@
---
# https://yamllint.readthedocs.io/en/stable/rules.html
extends: default
yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'

rules:
braces:
# Keeping 0 min-spaces to not error on empty collection definitions
min-spaces-inside: 0
# Allowing one space inside braces to improve code readability
max-spaces-inside: 1

brackets:
# Keeping 0 min-spaces to not error on empty collection definitions
min-spaces-inside: 0
# Allowing one space inside braces to improve code readability
max-spaces-inside: 1

colons:
braces: enable
brackets: enable
colons: enable
commas: enable
comments: disable
comments-indentation:
level: warning
max-spaces-before: 0
# Allow to tab all vars on the same column
max-spaces-after: -1

commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1

comments:
# Disabling to allow for code comment blocks and #!/usr/bin/ansible-playbook
require-starting-space: false
ignore-shebangs: true
min-spaces-from-content: 2

comments-indentation: enable

document-end: disable
document-start:
present: true

empty-lines:
max: 2
max-start: 0
max-end: 0

empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true

hyphens:
max-spaces-after: 1

indentation:
# Requiring 2 space indentation
spaces: 2
# Requiring consistent indentation within a file, either indented or not
indent-sequences: consistent
check-multi-line-strings: false

level: warning
empty-lines: enable
empty-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable

# Disabling due to copious amounts of long lines in the code which would
key-ordering: disable
line-length: disable

new-line-at-end-of-file: enable

new-lines:
type: unix

octal-values:
forbid-implicit-octal: false
forbid-explicit-octal: true

quoted-strings:
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning
quote-type: any
required: false
extra-required: []
extra-allowed: []

trailing-spaces: enable

# Disabling due to copious amounts of truthy warnings in the code which would
truthy: disable
#rules:
# braces:
# # Keeping 0 min-spaces to not error on empty collection definitions
# min-spaces-inside: 0
# # Allowing one space inside braces to improve code readability
# max-spaces-inside: 1
#
# brackets:
# # Keeping 0 min-spaces to not error on empty collection definitions
# min-spaces-inside: 0
# # Allowing one space inside braces to improve code readability
# max-spaces-inside: 1
#
# colons:
# level: warning
# max-spaces-before: 0
# # Allow to tab all vars on the same column
# max-spaces-after: -1
#
# commas:
# max-spaces-before: 0
# min-spaces-after: 1
# max-spaces-after: 1
#
# comments:
# # Disabling to allow for code comment blocks and #!/usr/bin/ansible-playbook
# require-starting-space: false
# ignore-shebangs: true
# min-spaces-from-content: 2
#
# comments-indentation: enable
#
# document-start:
# present: true
#
# empty-lines:
# max: 2
# max-start: 0
# max-end: 0
#
# empty-values:
# forbid-in-block-mappings: true
# forbid-in-flow-mappings: true
#
# hyphens:
# max-spaces-after: 1
#
# indentation:
# # Requiring 2 space indentation
# spaces: 2
# # Requiring consistent indentation within a file, either indented or not
# indent-sequences: consistent
# check-multi-line-strings: false
#
# key-duplicates: enable
#
# # Disabling due to copious amounts of long lines in the code which would
# line-length: disable
#
# new-line-at-end-of-file: enable
#
# new-lines:
# type: unix
#
# octal-values:
# forbid-implicit-octal: false
# forbid-explicit-octal: true
#
# quoted-strings:
# level: warning
# quote-type: any
# required: false
# extra-required: []
# extra-allowed: []
#
# trailing-spaces: enable
#
# # Disabling due to copious amounts of truthy warnings in the code which would
# truthy: disable
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=lotusnoir_ansible-apps_oxidized&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=lotusnoir_ansible-apps_oxidized)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=lotusnoir_ansible-apps_oxidized&metric=security_rating)](https://sonarcloud.io/dashboard?id=lotusnoir_ansible-apps_oxidized)


Deploy [oxidized](https://github.com/ytti/oxidized) a network configuration backup toole.
Deploy [oxidized](https://github.com/ytti/oxidized) a network configuration backup tool.

## Role variables

Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ galaxy_info:
platforms:
- name: "Ubuntu"
versions:
- "focal"
- "xenial"
- "bionic"
- name: "Debian"
versions:
Expand Down
23 changes: 0 additions & 23 deletions molecule/default/converge.yml

This file was deleted.

99 changes: 72 additions & 27 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,86 @@ dependency:
name: galaxy
driver:
name: docker
lint: |
yamllint .
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-debian10}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
- name: bionic
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:ubuntu-18.04
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: xenial
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:ubuntu-16.04
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: stretch
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:debian-9
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- name: buster
pre_build_image: true
image: quay.io/paulfantom/molecule-systemd:debian-10
docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
privileged: true
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
#- name: bullseye
# pre_build_image: true
# image: geerlingguy/docker-debian11-ansible #cant start service
# docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
# privileged: true
# volumes:
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
#- name: centos7
# pre_build_image: true
# image: quay.io/paulfantom/molecule-systemd:centos-7
# docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
# privileged: true
# volumes:
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
#- name: centos8
# pre_build_image: true
# image: quay.io/paulfantom/molecule-systemd:centos-8
# docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
# privileged: true
# volumes:
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
# groups:
# - python3
#- name: rocky8
# pre_build_image: true
# image: geerlingguy/docker-rockylinux8-ansible:latest
# docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
# privileged: true
# volumes:
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
#- name: fedora
# pre_build_image: true
# image: quay.io/paulfantom/molecule-systemd:fedora-30
# docker_host: "${DOCKER_HOST:-unix://var/run/docker.sock}"
# privileged: true
# volumes:
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
# groups:
# - python3
provisioner:
name: ansible
playbooks:
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
lint: |
ansible-lint
scenario:
name: default
test_sequence:
- lint
- dependency
- cleanup
- destroy
- syntax
- create
- prepare
- converge
- idempotence
- side_effect
- verify
- cleanup
- destroy
prepare: prepare.yml
converge: playbook.yml
inventory:
group_vars:
python3:
ansible_python_interpreter: /usr/bin/python3
host_vars:
bullseye:
ansible_python_interpreter: "/usr/bin/python3.9"

verifier:
name: goss
enabled: True
lint:
name: yamllint
7 changes: 7 additions & 0 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Run role
hosts: all
become: true

roles:
- role: apps_oxidized
5 changes: 5 additions & 0 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Prepare
hosts: all
gather_facts: false
tasks: []
Loading

0 comments on commit fd58919

Please sign in to comment.