refctor: rework ci to ue ansible-lint and fix molecule
This commit is contained in:
parent
88238fba1a
commit
db68614ca2
15
.later.yml
15
.later.yml
@ -1,15 +0,0 @@
|
||||
---
|
||||
ansible:
|
||||
custom_modules:
|
||||
- iptables_raw
|
||||
- openssl_pkcs12
|
||||
- proxmox_kvm
|
||||
- ucr
|
||||
- corenetworks_dns
|
||||
- corenetworks_token
|
||||
|
||||
rules:
|
||||
exclude_files:
|
||||
- "LICENSE*"
|
||||
- "**/*.md"
|
||||
- "**/*.ini"
|
@ -9,11 +9,11 @@ steps:
|
||||
- name: generate
|
||||
image: quay.io/thegeeklab/ansible-doctor
|
||||
environment:
|
||||
ANSIBLE_DOCTOR_EXCLUDE_FILES: molecule/
|
||||
ANSIBLE_DOCTOR_FORCE_OVERWRITE: "true"
|
||||
ANSIBLE_DOCTOR_LOG_LEVEL: INFO
|
||||
ANSIBLE_DOCTOR_ROLE_NAME: ${CI_REPO_NAME}
|
||||
ANSIBLE_DOCTOR_TEMPLATE: readme
|
||||
ANSIBLE_DOCTOR_EXCLUDE_FILES: "['molecule/']"
|
||||
ANSIBLE_DOCTOR_RENDERER__FORCE_OVERWRITE: "true"
|
||||
ANSIBLE_DOCTOR_LOGGING__LEVEL: info
|
||||
ANSIBLE_DOCTOR_ROLE__NAME: ${CI_REPO_NAME}
|
||||
ANSIBLE_DOCTOR_TEMPLATE__NAME: readme
|
||||
|
||||
- name: format
|
||||
image: quay.io/thegeeklab/alpine-tools
|
||||
|
@ -6,10 +6,10 @@ when:
|
||||
- ${CI_REPO_DEFAULT_BRANCH}
|
||||
|
||||
steps:
|
||||
- name: ansible-later
|
||||
image: quay.io/thegeeklab/ansible-later:4
|
||||
- name: ansible-lint
|
||||
image: quay.io/thegeeklab/ansible-dev-tools:1
|
||||
commands:
|
||||
- ansible-later
|
||||
- ansible-lint
|
||||
environment:
|
||||
FORCE_COLOR: "1"
|
||||
|
||||
|
@ -7,7 +7,7 @@ when:
|
||||
|
||||
variables:
|
||||
- &molecule_base
|
||||
image: quay.io/thegeeklab/molecule:6
|
||||
image: quay.io/thegeeklab/ansible-dev-tools:1
|
||||
group: molecule
|
||||
environment:
|
||||
PY_COLORS: "1"
|
||||
|
20
.yamllint
Normal file
20
.yamllint
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
truthy:
|
||||
allowed-values: ["True", "False"]
|
||||
comments:
|
||||
min-spaces-from-content: 1
|
||||
comments-indentation: False
|
||||
line-length: disable
|
||||
braces:
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 1
|
||||
brackets:
|
||||
min-spaces-inside: 0
|
||||
max-spaces-inside: 0
|
||||
indentation: enable
|
||||
octal-values:
|
||||
forbid-implicit-octal: True
|
||||
forbid-explicit-octal: True
|
@ -21,5 +21,3 @@ galaxy_info:
|
||||
- security
|
||||
- selinux
|
||||
dependencies: []
|
||||
collections:
|
||||
- community.general
|
||||
|
@ -4,11 +4,11 @@ driver:
|
||||
dependency:
|
||||
name: galaxy
|
||||
options:
|
||||
role-file: molecule/requirements.yml
|
||||
requirements-file: molecule/requirements.yml
|
||||
role-file: requirements.yml
|
||||
requirements-file: requirements.yml
|
||||
platforms:
|
||||
- name: "rocky9-selinux"
|
||||
server_type: "CX22"
|
||||
server_type: "cx22"
|
||||
image: "rocky-9"
|
||||
provisioner:
|
||||
name: ansible
|
||||
|
@ -1,4 +0,0 @@
|
||||
---
|
||||
collections: []
|
||||
|
||||
roles: []
|
5
requirements.yml
Normal file
5
requirements.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
collections:
|
||||
- name: ansible.posix
|
||||
|
||||
roles: []
|
@ -1,5 +1,6 @@
|
||||
---
|
||||
- ansible.builtin.include_vars: "{{ var_files }}"
|
||||
- name: Include OS specific vars
|
||||
ansible.builtin.include_vars: "{{ var_files }}"
|
||||
vars:
|
||||
var_files: "{{ lookup('first_found', params, errors='ignore') }}"
|
||||
params:
|
||||
@ -10,5 +11,24 @@
|
||||
paths:
|
||||
- "vars"
|
||||
when: var_files
|
||||
- ansible.builtin.include_tasks: overwrites.yml
|
||||
- ansible.builtin.include_tasks: setup.yml
|
||||
|
||||
- name: Define selinux_packages
|
||||
ansible.builtin.set_fact:
|
||||
selinux_packages: "{{ __selinux_packages }}"
|
||||
when: selinux_packages is not defined
|
||||
|
||||
- name: Set current selinux policy
|
||||
ansible.builtin.set_fact:
|
||||
selinux_current: "{{ ansible_selinux.config_mode }}"
|
||||
|
||||
- name: Install dependencies
|
||||
ansible.builtin.package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop: "{{ selinux_packages }}"
|
||||
|
||||
- name: Set selinux policy
|
||||
ansible.posix.selinux:
|
||||
policy: "{{ selinux_policy }}"
|
||||
state: "{{ selinux_state }}"
|
||||
notify: __selinux_autorelabel
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
- name: Define selinux_packages
|
||||
ansible.builtin.set_fact:
|
||||
selinux_packages: "{{ __selinux_packages }}"
|
||||
when: selinux_packages is not defined
|
@ -1,16 +0,0 @@
|
||||
---
|
||||
- name: Set current selinux policy
|
||||
ansible.builtin.set_fact:
|
||||
selinux_current: "{{ ansible_selinux.config_mode }}"
|
||||
|
||||
- name: Install dependencies
|
||||
ansible.builtin.package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop: "{{ selinux_packages }}"
|
||||
|
||||
- name: Set selinux policy
|
||||
ansible.posix.selinux:
|
||||
policy: "{{ selinux_policy }}"
|
||||
state: "{{ selinux_state }}"
|
||||
notify: __selinux_autorelabel
|
Loading…
Reference in New Issue
Block a user