From 2d3c7f2db07f559117773dd950d50da5580bd72f Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 12 Feb 2025 14:28:31 +0100 Subject: [PATCH] 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. Change-Id: Ib65002dbe635a4560259664c2079449dd6895fa7 --- .gitignore | 1 + defaults/main.yml | 7 ++++--- files/skyline_conf_d.yml | 1 + files/skyline_secrets.yml | 1 + handlers/main.yml | 10 ++++------ tasks/skyline_apache.yml | 2 +- tasks/skyline_install.yml | 4 ++-- tasks/skyline_install_yarn.yml | 6 +++--- vars/debian.yml | 2 -- vars/redhat.yml | 2 -- zuul.d/jobs.yaml | 3 +-- 11 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 3a77206..c46a9ec 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,7 @@ logs/* # OS generated files # ###################### ._* +.ansible .tox *.egg-info .eggs diff --git a/defaults/main.yml b/defaults/main.yml index 366d886..63c14e8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,4 @@ +--- # Copyright 2022, BBC R&D # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,7 +55,7 @@ skyline_console_git_install_branch: master # We will not build yarn when version matches a regex for valid Python versions, then # it's assumed, that version in topic should be available from PyPi and build is not needed. -skyline_console_pypi_version_regex: '^(\d*!)?(\d*)(\.(\d*))*((a|b|rc)(\d*))?(\.post(\d*))?(\.dev(\d*))?$' +skyline_console_pypi_version_regex: "^(\\d*!)?(\\d*)(\\.(\\d*))*((a|b|rc)(\\d*))?(\\.post(\\d*))?(\\.dev(\\d*))?$" skyline_upper_constraints_url: >- {{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~ requirements_git_install_branch | default('master')) }} @@ -98,7 +99,7 @@ skyline_ssl_cipher_suite_tls12: >- # TLS v1.3 skyline_ssl_cipher_suite_tls13: >- {{ ssl_cipher_suite_tls13 | default('TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256') }} -skyline_pki_regen_cert: '' +skyline_pki_regen_cert: "" skyline_pki_san: "{{ openstack_pki_san | default('DNS:' ~ ansible_facts['hostname'] ~ ',IP:' ~ management_address) }}" # skyline_user_ssl_cert: # skyline_user_ssl_key: @@ -128,7 +129,7 @@ skyline_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }} skyline_service_port: 9999 skyline_server_name: "{{ ansible_facts['fqdn'] | default('skyline') }}" # skyline_prometheus_basic_auth_password: -skyline_prometheus_basic_auth_user: 'skyline' +skyline_prometheus_basic_auth_user: "skyline" # skyline_secret_key: skyline_interface: internal ## Cap the maximum number of threads / workers when a user value is unspecified. diff --git a/files/skyline_conf_d.yml b/files/skyline_conf_d.yml index 9573759..c0267e2 100644 --- a/files/skyline_conf_d.yml +++ b/files/skyline_conf_d.yml @@ -1,3 +1,4 @@ +--- skyline_hosts: aio1: ip: 172.29.236.100 diff --git a/files/skyline_secrets.yml b/files/skyline_secrets.yml index a9b54b8..d80cd0d 100644 --- a/files/skyline_secrets.yml +++ b/files/skyline_secrets.yml @@ -1,3 +1,4 @@ +--- skyline_prometheus_basic_auth_password: secrete skyline_service_password: secrete skyline_galera_password: secrete diff --git a/handlers/main.yml b/handlers/main.yml index 5e81f87..f69df7b 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -12,14 +12,12 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - - - name: Stop services service: name: "{{ item.service_name }}" - enabled: yes + enabled: true state: "stopped" - daemon_reload: yes + daemon_reload: true loop: "{{ filtered_skyline_services }}" register: _stop until: _stop is success @@ -32,9 +30,9 @@ - name: Start services service: name: "{{ item.service_name }}" - enabled: yes + enabled: true state: "started" - daemon_reload: yes + daemon_reload: true loop: "{{ filtered_skyline_services }}" register: _start until: _start is success diff --git a/tasks/skyline_apache.yml b/tasks/skyline_apache.yml index f9c345c..ffee876 100644 --- a/tasks/skyline_apache.yml +++ b/tasks/skyline_apache.yml @@ -37,7 +37,7 @@ options: - '' - ' Header set Cache-Control "max-age=86400, public"' - - '' + - - RewriteEngine On - RewriteCond %{REQUEST_URI} !^/index.html$ - RewriteCond %{REQUEST_FILENAME} !-f diff --git a/tasks/skyline_install.yml b/tasks/skyline_install.yml index 2a0cc0b..488f027 100644 --- a/tasks/skyline_install.yml +++ b/tasks/skyline_install.yml @@ -46,7 +46,7 @@ venv_facts_when_changed: - section: "skyline" option: "need_service_restart" - value: True + value: true - section: "skyline" option: "venv_tag" value: "{{ skyline_venv_tag }}" @@ -66,7 +66,7 @@ systemd_service_tasks_accounting: true systemd_services: - service_name: "{{ service_var.service_name }}" - enabled: yes + enabled: true state: started execstarts: "{{ service_var.execstarts }}" execreloads: "{{ service_var.execreloads | default([]) }}" diff --git a/tasks/skyline_install_yarn.yml b/tasks/skyline_install_yarn.yml index ee73005..5b1f169 100644 --- a/tasks/skyline_install_yarn.yml +++ b/tasks/skyline_install_yarn.yml @@ -38,8 +38,8 @@ name: epel-yarn baseurl: "{{ skyline_yarn_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}" description: "NodeJS Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch" - gpgcheck: yes - enabled: yes + gpgcheck: true + enabled: true state: present includepkgs: "yarnpkg" register: install_epel_repo @@ -54,7 +54,7 @@ version: "{{ skyline_console_git_install_branch }}" dest: "{{ skyline_console_yarn_build_path }}" force: true - changed_when: False + changed_when: false - name: Detect if rebuild is needed delegate_to: "{{ skyline_console_yarn_setup_host }}" diff --git a/vars/debian.yml b/vars/debian.yml index eae5610..9d7c4f8 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -12,8 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - - ## APT Cache options cache_timeout: 600 diff --git a/vars/redhat.yml b/vars/redhat.yml index 71c1aaf..8b93fc7 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -12,8 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - - ## APT Cache options cache_timeout: 600 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 362b2c6..c957697 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -1,5 +1,4 @@ --- - - job: name: openstack-ansible-deploy-aio_skyline_yarn-ubuntu-jammy parent: openstack-ansible-deploy-aio @@ -8,4 +7,4 @@ - job: name: openstack-ansible-deploy-aio_skyline_yarn-rockylinux-9 parent: openstack-ansible-deploy-aio - nodeset: rockylinux-9 \ No newline at end of file + nodeset: rockylinux-9