Skip to content

Commit

Permalink
Update ansible-lint after sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Welsh committed Dec 2, 2024
1 parent 6bc5e8b commit 74c5de5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
17 changes: 9 additions & 8 deletions etc/kayobe/ansible/deploy-os-capacity-exporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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:
Expand Down Expand Up @@ -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
9 changes: 5 additions & 4 deletions etc/kayobe/ansible/fix-grub-rl9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'

0 comments on commit 74c5de5

Please sign in to comment.