refactor(uyuni): consolidate helm installation logic into dedicated task file
Remove duplicated helm install tasks from main.yml and centralize them in helm.yml, simplifying the role structure and reducing redundancy by consolidating OCI registry and local chart installation paths into a single file.
This commit is contained in:
parent
a33f75a7a2
commit
78103e121e
3 changed files with 2 additions and 111 deletions
|
|
@ -1,32 +0,0 @@
|
|||
# Uyuni Helm Chart Configuration
|
||||
|
||||
This directory contains the Uyuni Helm chart and configuration files.
|
||||
|
||||
## Chart Location
|
||||
|
||||
The Uyuni Helm chart is located at: `uyuni/uyuni-server`
|
||||
|
||||
## Custom Values
|
||||
|
||||
You can customize the installation by modifying the values in your Ansible playbook:
|
||||
|
||||
```yaml
|
||||
uyuni_helm_values:
|
||||
server:
|
||||
hostname: uyuni.example.com
|
||||
resources:
|
||||
requests:
|
||||
memory: "4Gi"
|
||||
cpu: "2"
|
||||
limits:
|
||||
memory: "8Gi"
|
||||
cpu: "4"
|
||||
database:
|
||||
type: internal
|
||||
proxy:
|
||||
enabled: false
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
For detailed configuration options, see the [Uyuni Helm Chart documentation](https://github.com/uyuni-project/uyuni-helm).
|
||||
|
|
@ -14,51 +14,3 @@
|
|||
PATH: "/usr/local/bin:/usr/bin:/bin"
|
||||
register: _helm_install
|
||||
changed_when: "'STATUS: deployed' in _helm_install.stdout or 'has been upgraded' in _helm_install.stdout"
|
||||
when: uyuni_helm_values is defined
|
||||
|
||||
- name: Helm | Install or upgrade Uyuni from OCI registry (no values)
|
||||
ansible.builtin.command: >
|
||||
helm upgrade --install uyuni-server oci://registry.opensuse.org/uyuni/server-helm
|
||||
--namespace {{ uyuni_namespace }}
|
||||
--create-namespace
|
||||
--version {{ uyuni_chart_version }}
|
||||
--timeout 20m0s
|
||||
--wait
|
||||
environment:
|
||||
KUBECONFIG: "{{ uyuni_kubeconfig }}"
|
||||
PATH: "/usr/local/bin:/usr/bin:/bin"
|
||||
register: _helm_install_simple
|
||||
changed_when: "'STATUS: deployed' in _helm_install_simple.stdout or 'has been upgraded' in _helm_install_simple.stdout"
|
||||
when: uyuni_helm_values is not defined
|
||||
|
||||
- name: Helm | Install or upgrade Uyuni
|
||||
ansible.builtin.command: >
|
||||
helm upgrade --install uyuni-server uyuni/uyuni-server
|
||||
--namespace {{ uyuni_namespace }}
|
||||
--create-namespace
|
||||
--version {{ uyuni_chart_version }}
|
||||
--set {{ item.key }}={{ item.value }}
|
||||
--timeout 20m0s
|
||||
--wait
|
||||
loop: "{{ uyuni_helm_values | dict2items }}"
|
||||
environment:
|
||||
KUBECONFIG: "{{ uyuni_kubeconfig }}"
|
||||
PATH: "/usr/local/bin:/usr/bin:/bin"
|
||||
register: _helm_install
|
||||
changed_when: "'STATUS: deployed' in _helm_install.stdout or 'has been upgraded' in _helm_install.stdout"
|
||||
when: uyuni_helm_values is defined
|
||||
|
||||
- name: Helm | Install or upgrade Uyuni (no values)
|
||||
ansible.builtin.command: >
|
||||
helm upgrade --install uyuni-server uyuni/uyuni-server
|
||||
--namespace {{ uyuni_namespace }}
|
||||
--create-namespace
|
||||
--version {{ uyuni_chart_version }}
|
||||
--timeout 20m0s
|
||||
--wait
|
||||
environment:
|
||||
KUBECONFIG: "{{ uyuni_kubeconfig }}"
|
||||
PATH: "/usr/local/bin:/usr/bin:/bin"
|
||||
register: _helm_install_simple
|
||||
changed_when: "'STATUS: deployed' in _helm_install_simple.stdout or 'has been upgraded' in _helm_install_simple.stdout"
|
||||
when: uyuni_helm_values is not defined
|
||||
|
|
|
|||
|
|
@ -69,34 +69,5 @@
|
|||
delay: 10
|
||||
when: uyuni_create_certificates | bool
|
||||
|
||||
- name: Helm | Install or upgrade Uyuni from OCI registry
|
||||
ansible.builtin.command: >
|
||||
helm upgrade --install uyuni-server oci://registry.opensuse.org/uyuni/server-helm
|
||||
--namespace {{ uyuni_namespace }}
|
||||
--create-namespace
|
||||
--version {{ uyuni_chart_version }}
|
||||
--set {{ item.key }}={{ item.value }}
|
||||
--timeout 20m0s
|
||||
--wait
|
||||
loop: "{{ uyuni_helm_values | dict2items }}"
|
||||
environment:
|
||||
KUBECONFIG: "{{ uyuni_kubeconfig }}"
|
||||
PATH: "/usr/local/bin:/usr/bin:/bin"
|
||||
register: _helm_install
|
||||
changed_when: "'STATUS: deployed' in _helm_install.stdout or 'has been upgraded' in _helm_install.stdout"
|
||||
when: uyuni_helm_values is defined
|
||||
|
||||
- name: Helm | Install or upgrade Uyuni from OCI registry (no values)
|
||||
ansible.builtin.command: >
|
||||
helm upgrade --install uyuni-server oci://registry.opensuse.org/uyuni/server-helm
|
||||
--namespace {{ uyuni_namespace }}
|
||||
--create-namespace
|
||||
--version {{ uyuni_chart_version }}
|
||||
--timeout 20m0s
|
||||
--wait
|
||||
environment:
|
||||
KUBECONFIG: "{{ uyuni_kubeconfig }}"
|
||||
PATH: "/usr/local/bin:/usr/bin:/bin"
|
||||
register: _helm_install_simple
|
||||
changed_when: "'STATUS: deployed' in _helm_install_simple.stdout or 'has been upgraded' in _helm_install_simple.stdout"
|
||||
when: uyuni_helm_values is not defined
|
||||
- name: Include Helm installation
|
||||
ansible.builtin.include_tasks: helm.yml
|
||||
|
|
|
|||
Loading…
Reference in a new issue