Auto-fix yaml rules

In order to reduce divergance with ansible-lint rules, we apply
auto-fixing of violations.

In current patch we replace all kind of truthy variables with
`true` or `false` values to align with recommendations along with
alignment of used quotes.

With ansible-lint update it seems to be resolving symlink to absolute
path, which causes our linter check to search for the wrong
role name. Some more details were posted to ansible forum[1]

So we apply change here to resolve failing CI.

[1] https://forum.ansible.com/t/ansible-lint-resolving-symlinks-to-their-destinations/40388

Change-Id: Icdbe2bb4ad139254266d456cebba0c3f0c82496e
This commit is contained in:
Dmitriy Rabotyagov 2025-02-20 11:30:55 +01:00
parent 7573636fb8
commit 8500ca5861
7 changed files with 13 additions and 8 deletions

1
.gitignore vendored
View File

@ -45,6 +45,7 @@ logs/*
# OS generated files #
######################
._*
.ansible
.tox
*.egg-info
.eggs

View File

@ -93,7 +93,7 @@ httpd_pki_setup_host: "{{ openstack_pki_setup_host | default('localhost') }}"
## Create a certificate authority if one does not already exist
httpd_pki_create_ca: "{{ openstack_pki_authorities is not defined | bool and httpd_pki_create_certificates }}"
httpd_pki_regen_ca: ''
httpd_pki_regen_ca: ""
httpd_pki_authorities:
- name: "HTTPDRoot"
country: "GB"
@ -134,7 +134,7 @@ httpd_pki_certificates: "{{ _httpd_pki_generate_certificates_vhosts }}"
httpd_pki_create_certificates: "{{ httpd_pki_certificates | length > 0 }}"
httpd_pki_default_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',DNS:' ~ ansible_facts['fqdn']) }}"
httpd_pki_keys_path: "{{ httpd_pki_dir ~ '/certs/private/' }}"
httpd_pki_regen_cert: ''
httpd_pki_regen_cert: ""
httpd_pki_intermediate_cert_name: "{{ openstack_pki_service_intermediate_cert_name | default('HTTPDIntermediate') }}"
httpd_pki_intermediate_cert_path: "{{ httpd_pki_dir ~ '/roots/' ~ httpd_pki_intermediate_cert_name ~ '/certs/' ~ httpd_pki_intermediate_cert_name ~ '.crt' }}"

View File

@ -1,6 +1,5 @@
---
- name: Installing Apache Web Server
hosts: httpd
roles:
- role: "{{ playbook_dir | dirname | basename }}"
- role: httpd

View File

@ -0,0 +1,5 @@
---
- name: Installing Apache Web Server
hosts: httpd
roles:
- role: "{{ playbook_dir | dirname | dirname | basename }}"

View File

@ -24,7 +24,7 @@ provisioner:
name: ansible-lint
playbooks:
prepare: prepare.yml
converge: ../../examples/playbook.yml
converge: converge.yml
verify: verify.yml
inventory:
links:

View File

@ -14,4 +14,4 @@ collections:
- name: community.general
source: https://github.com/ansible-collections/community.general
type: git
version: 10.2.0
version: 10.2.0

View File

@ -76,7 +76,7 @@
- name: Remove Listen from Apache config
ansible.builtin.lineinfile:
dest: "{{ httpd_security_conf }}"
regexp: '^(Listen.*)'
regexp: "^(Listen.*)"
backrefs: true
line: '#\1'
line: "#\\1"
notify: Restart web server