refactor(standardize): remove redundant variables, deduplicate conditionals

This commit is contained in:
2026-02-12 23:47:41 +01:00
parent 29d365293c
commit bc43b3b994
3 changed files with 3 additions and 16 deletions

View File

@@ -16,8 +16,6 @@ method=auto
{% endif %}
{% if idx | int == 0 and dns_list %}
dns={{ dns_list | join(';') }}
{% endif %}
{% if idx | int == 0 and dns_list %}
ignore-auto-dns=true
{% endif %}
{% if idx | int == 0 and search_list %}

View File

@@ -208,11 +208,6 @@
- name: Configure RHEL Repos for installation
when: is_rhel | bool
block:
- name: Select repository template
ansible.builtin.set_fact:
environment_repo_template: "{{ os | lower }}"
changed_when: false
- name: Create directories for repository files and RPM GPG keys
ansible.builtin.file:
path: /etc/yum.repos.d
@@ -221,8 +216,8 @@
- name: Create RHEL repository file
ansible.builtin.template:
src: "{{ environment_repo_template }}.repo.j2"
dest: /etc/yum.repos.d/{{ environment_repo_template }}.repo
src: "{{ os }}.repo.j2"
dest: /etc/yum.repos.d/{{ os }}.repo
mode: "0644"
- name: Check for third-party preparation tasks
@@ -252,9 +247,4 @@
when:
- thirdparty_preparation_tasks_path | length > 0
- environment_thirdparty_tasks_stat.stat.exists
ansible.builtin.include_tasks: >-
{{
thirdparty_preparation_tasks_path
if thirdparty_preparation_tasks_path | regex_search('^/')
else playbook_dir + '/' + thirdparty_preparation_tasks_path
}}
ansible.builtin.include_tasks: "{{ environment_thirdparty_tasks_path }}"

View File

@@ -3,7 +3,6 @@
ansible.builtin.set_fact:
system: "{{ system | default({}) }}"
- name: Validate system input types
ansible.builtin.assert:
that: