From 74c5de520c8f9daafec3b1d82e6edafc22aede9c Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Mon, 2 Dec 2024 11:28:13 +0000 Subject: [PATCH] Update ansible-lint after sync --- .../ansible/deploy-os-capacity-exporter.yml | 17 +++++++++-------- etc/kayobe/ansible/fix-grub-rl9.yml | 9 +++++---- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/etc/kayobe/ansible/deploy-os-capacity-exporter.yml b/etc/kayobe/ansible/deploy-os-capacity-exporter.yml index a9cab23dc..8ef4673e1 100644 --- a/etc/kayobe/ansible/deploy-os-capacity-exporter.yml +++ b/etc/kayobe/ansible/deploy-os-capacity-exporter.yml @@ -22,7 +22,9 @@ register: openrc_file_stat run_once: true - - block: + - name: If admin-openrc.sh exists, deploy os-capacity exporter + when: stackhpc_enable_os_capacity and openrc_file_stat.stat.exists + block: - name: Ensure os-capacity directory exists ansible.builtin.file: path: /opt/kayobe/os-capacity/ @@ -37,12 +39,12 @@ - name: Set facts for admin credentials ansible.builtin.set_fact: - stackhpc_os_capacity_auth_url: "{{ credential.stdout_lines | select('match', '.*OS_AUTH_URL*.') | first | split('=') | last | replace(\"'\",'') }}" - stackhpc_os_capacity_project_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_NAME*.') | first | split('=') | last | replace(\"'\",'') }}" - stackhpc_os_capacity_domain_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_DOMAIN_NAME*.') | first | split('=') | last | replace(\"'\",'') }}" - stackhpc_os_capacity_openstack_region_name: "{{ credential.stdout_lines | select('match', '.*OS_REGION_NAME*.') | first | split('=') | last | replace(\"'\",'') }}" - stackhpc_os_capacity_username: "{{ credential.stdout_lines | select('match', '.*OS_USERNAME*.') | first | split('=') | last | replace(\"'\",'') }}" - stackhpc_os_capacity_password: "{{ credential.stdout_lines | select('match', '.*OS_PASSWORD*.') | first | split('=') | last | replace(\"'\",'') }}" + stackhpc_os_capacity_auth_url: "{{ credential.stdout_lines | select('match', '.*OS_AUTH_URL*.') | first | split('=') | last | replace(\"'\", '') }}" + stackhpc_os_capacity_project_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_NAME*.') | first | split('=') | last | replace(\"'\", '') }}" + stackhpc_os_capacity_domain_name: "{{ credential.stdout_lines | select('match', '.*OS_PROJECT_DOMAIN_NAME*.') | first | split('=') | last | replace(\"'\", '') }}" + stackhpc_os_capacity_openstack_region_name: "{{ credential.stdout_lines | select('match', '.*OS_REGION_NAME*.') | first | split('=') | last | replace(\"'\", '') }}" + stackhpc_os_capacity_username: "{{ credential.stdout_lines | select('match', '.*OS_USERNAME*.') | first | split('=') | last | replace(\"'\", '') }}" + stackhpc_os_capacity_password: "{{ credential.stdout_lines | select('match', '.*OS_PASSWORD*.') | first | split('=') | last | replace(\"'\", '') }}" - name: Template clouds.yml ansible.builtin.template: @@ -72,4 +74,3 @@ restart: "{{ clouds_yaml_result is changed or cacert_result is changed }}" restart_policy: unless-stopped become: true - when: stackhpc_enable_os_capacity and openrc_file_stat.stat.exists diff --git a/etc/kayobe/ansible/fix-grub-rl9.yml b/etc/kayobe/ansible/fix-grub-rl9.yml index 8192239e9..3a9a7e1d7 100644 --- a/etc/kayobe/ansible/fix-grub-rl9.yml +++ b/etc/kayobe/ansible/fix-grub-rl9.yml @@ -4,7 +4,11 @@ become: true gather_facts: true tasks: - - block: + - name: Remove "--root-dev-only" from grub.cfg if OS is Rocky Linux 9 + when: + - ansible_facts['distribution'] == 'Rocky' + - ansible_facts['distribution_major_version'] == '9' + block: - name: Check that /boot/efi/EFI/rocky/grub.cfg exists ansible.builtin.stat: path: /boot/efi/EFI/rocky/grub.cfg @@ -16,6 +20,3 @@ regexp: --root-dev-only\s? replace: "" when: stat_result.stat.exists - when: - - ansible_facts['distribution'] == 'Rocky' - - ansible_facts['distribution_major_version'] == '9'