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.

This does not include fixes for playbooks themselves, as that would
require pulling in all roles within the repo requirements

Change-Id: I7d2b31e5d6184f09d5e0c0fdc9e46f779878b7ca
This commit is contained in:
Dmitriy Rabotyagov
2025-02-17 12:42:25 +01:00
parent a9c7454897
commit 0381ae1a80
17 changed files with 30 additions and 29 deletions

1
.gitignore vendored
View File

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

View File

@@ -7,15 +7,15 @@ name: "osa"
version: "1.5.0"
readme: "README.rst"
authors:
- Dmitriy Rabotyagov <noonedeadpunk@ya.ru>
- Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
- Kevin Carter <kevin.carter@rackspace.com>
- Jimmy McCrory <jimmy.mccrory@gmail.com>
- Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
- Logan V <logan2211@gmail.com>
- Jean-Philippe Evrard <jean-philippe@evrard.me>
- Dmitriy Rabotyagov <noonedeadpunk@ya.ru>
- Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
- Kevin Carter <kevin.carter@rackspace.com>
- Jimmy McCrory <jimmy.mccrory@gmail.com>
- Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
- Logan V <logan2211@gmail.com>
- Jean-Philippe Evrard <jean-philippe@evrard.me>
license:
- "Apache-2.0"
- "Apache-2.0"
tags:
- openstack
- openstack
repository: "https://github.com/openstack/openstack-ansible-plugins"

View File

@@ -36,7 +36,7 @@
password: "{{ item.1.password }}"
host: "{{ item.1.host | default('%') }}"
priv: "{{ item.0.name }}.*:{{ item.1.priv | default('ALL') }}"
append_privs: yes
append_privs: true
login_host: "{{ _oslodb_setup_endpoint | default(omit) }}"
login_port: "{{ _oslodb_setup_port | default(omit) }}"
check_hostname: true

View File

@@ -86,7 +86,7 @@
- name: Restart systemd-tmpfiles-setup-dev
service:
name: "systemd-tmpfiles-setup-dev"
enabled: yes
enabled: true
state: restarted
when:
- not (is_metal | default(False))

View File

@@ -14,6 +14,6 @@
# limitations under the License.
glusterfs_server_distro_packages:
- python3-setuptools # required for gluster ansible collection
- python3-setuptools # required for gluster ansible collection
- glusterfs-cli
- glusterfs-server

View File

@@ -31,4 +31,3 @@
loop_var: _haproxy_item
tags:
- common-haproxy

View File

@@ -17,7 +17,7 @@
- name: Ensure systemd-journal-remote socket enabled
systemd:
name: systemd-journal-remote.socket
enabled: yes
enabled: true
state: started
when:
- (ansible_host in journald_remote_targets)

View File

@@ -21,7 +21,7 @@
state: "{{ item.state | default('present') }}"
option: "{{ item.key }}"
value: "{{ item.value }}"
backup: yes
backup: true
mode: "0644"
with_items: "{{ journald_remote_config_options }}"
when:

View File

@@ -26,7 +26,7 @@
cloud: "{{ openstack_resources_cloud_name }}"
interface: "{{ openstack_resources_interface }}"
filters:
'name': "{{ image['name'] }}"
"name": "{{ image['name'] }}"
register: available_images
loop: "{{ openstack_resources_image['images'] | rejectattr('checksum', 'undefined') }}"
loop_control:

View File

@@ -41,4 +41,4 @@
name: "{{ item['name'] }}"
state: absent
loop: "{{ images_to_rotate[image['name']][:-(image['keep_copies'])] }}"
ignore_errors: true # noqa: ignore-errors
ignore_errors: true # noqa: ignore-errors

View File

@@ -43,7 +43,7 @@
ansible.builtin.get_url:
url: "{{ image['url'] }}"
dest: "{{ openstack_resources_image['image_download_path'] | default(tempdir['path']) }}/{{ image['url'] | basename }}"
mode: '0644'
mode: "0644"
checksum: "{{ ('checksum' in image) | ternary('md5:' ~ image['checksum'] | default(), omit) }}"
loop: "{{ images_for_download }}"
loop_control:
@@ -58,7 +58,7 @@
fetch_status: []
- name: Register get_image watch variable
when: item.changed # noqa: no-handler
when: item.changed # noqa: no-handler
ansible.builtin.set_fact:
fetch_status: "{{ fetch_status + [item.ansible_job_id] }}"
loop: "{{ get_image_results.results }}"
@@ -113,7 +113,7 @@
upload_status: []
- name: Register watch variable
when: item.changed # noqa: no-handler
when: item.changed # noqa: no-handler
ansible.builtin.set_fact:
upload_status: "{{ upload_status + [item.ansible_job_id] }}"
loop: "{{ upload_results.results }}"

View File

@@ -31,7 +31,7 @@ ssh_keypairs_method: "standalone"
# --------
# boolean to enable/disable creation of keys
ssh_keypairs_create_keys: True
ssh_keypairs_create_keys: true
# ssh keypairs to create
#
@@ -75,7 +75,7 @@ ssh_keypairs: []
ssh_keypairs_install_keys: []
# boolean to enable/disable installation of ssh keys
ssh_keypairs_install_keypairs: True
ssh_keypairs_install_keypairs: true
# ----------
# TRUSTED CA
@@ -111,4 +111,4 @@ ssh_keypairs_authorized_principals_file: "/etc/ssh/auth_principals/%u_principals
ssh_keypairs_principals: []
# boolean to enable/disable installation of sshd certificate authorities
ssh_keypairs_install_authorities: True
ssh_keypairs_install_authorities: true

View File

@@ -1,3 +1,4 @@
---
# Copyright 2022, BBC
#
# Licensed under the Apache License, Version 2.0 (the "License");

View File

@@ -1,3 +1,4 @@
---
galaxy_info:
author: BBC
description: Installation and configuration of ssh keys

View File

@@ -29,8 +29,8 @@
with_items:
- "{{ ssh_keypairs_dirs }}"
delegate_to: "{{ ssh_keypairs_setup_host }}"
run_once: yes
check_mode: no
run_once: true
check_mode: false
- name: Create keypairs
include_tasks: "{{ ssh_keypairs_method }}/create_keypair.yml"

View File

@@ -19,7 +19,6 @@
_ca_file: "{{ ssh_keypairs_dir ~ '/' ~ kp.cert.signed_by }}"
delegate_to: "{{ ssh_keypairs_setup_host }}"
block:
- name: Generate key pair for {{ kp['name'] }}
community.crypto.openssh_keypair:
comment: "{{ kp.comment | default(omit) }}"

View File

@@ -46,7 +46,7 @@
set_fact:
resolvconf_resolver_ips: "{{ resolver_list }}"
resolvconf_options:
- 'timeout:1'
- "timeout:1"
when:
- resolver_list is defined
- resolver_list | length > 0
@@ -55,8 +55,8 @@
- name: Set resolver rotate when physical_host is not an unbound host
set_fact:
resolvconf_options:
- 'timeout:1'
- 'rotate'
- "timeout:1"
- "rotate"
when:
- resolver_list is not defined