From 8cbfcb016b48ffb6cc627a52f1df6e3176ed6336 Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Mon, 27 Jun 2022 20:26:09 +0200 Subject: [PATCH] Remove debugging; Cleanup redundant logic;Add vapp property --- .../roles/metacluster/tasks/main.yml | 11 ++++++ .../roles/metacluster/tasks/components.yml | 7 ---- ansible/vars/metacluster.yml | 1 - scripts/Update-OvfConfiguration.yml | 38 +++++++++++++++---- 4 files changed, 42 insertions(+), 15 deletions(-) diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml index ef7d6d5..61e35fb 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/main.yml @@ -56,6 +56,17 @@ path: /opt/metacluster/container_images state: absent +- name: Install longhorn chart + kubernetes.core.helm: + name: longhorn + chart_ref: /opt/metacluster/helm_charts/longhorn + release_namespace: longhorn + create_namespace: yes + values: + ingress: + enabled: true + host: storage.{{ vapp['guestinfo.fqdn'] }} + - name: Cleanup tempfile ansible.builtin.file: path: "{{ kubeconfig.path }}" diff --git a/ansible/roles/metacluster/tasks/components.yml b/ansible/roles/metacluster/tasks/components.yml index 2c3d916..39a9267 100644 --- a/ansible/roles/metacluster/tasks/components.yml +++ b/ansible/roles/metacluster/tasks/components.yml @@ -21,17 +21,10 @@ loop_control: label: "{{ item.key }}" -- ansible.builtin.command: - cmd: ls /opt/metacluster/helm-charts -lashR - register: result -- ansible.builtin.debug: - var: result - - name: Parse helm charts for container images ansible.builtin.shell: cmd: "{{ item.value.helm.parse_logic }}" chdir: /opt/metacluster/helm-charts/{{ item.key }} -# chdir: /opt/metacluster/helm-charts/{{ item.value.helm.basedir | default(item.key) }} register: containerimages loop: "{{ lookup('ansible.builtin.dict', components) }}" loop_control: diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index 29346f2..78a851d 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -31,7 +31,6 @@ components: helm: version: v5.0.9 # (= Gitea v1.16.8) chart: gitea-charts/gitea - basedir: helm-chart parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | awk '!/ /' argo-cd: diff --git a/scripts/Update-OvfConfiguration.yml b/scripts/Update-OvfConfiguration.yml index 4e1d3e4..09b8bb4 100644 --- a/scripts/Update-OvfConfiguration.yml +++ b/scripts/Update-OvfConfiguration.yml @@ -1,18 +1,22 @@ DeploymentConfigurations: + - Id: small Label: 'Ubuntu Server 22.04 [SMALL: 1 vCPU/2GB RAM]' Description: Ubuntu Server 22.04.x Size: CPU: 1 Memory: 2048 + - Id: medium Label: 'Ubuntu Server 22.04 [MEDIUM: 2 vCPU/4GB RAM]' Description: Ubuntu Server 22.04.x Size: CPU: 2 Memory: 4096 + DynamicDisks: [] PropertyCategories: + # - Name: 0) Deployment information # ProductProperties: # - Key: deployment.type @@ -21,8 +25,10 @@ PropertyCategories: # - small # - medium # UserConfigurable: false + - Name: 1) Operating System ProductProperties: + - Key: guestinfo.hostname Type: string(1..15) Label: Hostname* @@ -30,6 +36,7 @@ PropertyCategories: DefaultValue: '' Configurations: '*' UserConfigurable: true + - Key: guestinfo.rootpw Type: password(7..) Label: Local root password* @@ -37,6 +44,7 @@ PropertyCategories: DefaultValue: '' Configurations: '*' UserConfigurable: true + - Key: guestinfo.rootsshkey Type: password(1..) Label: Local root SSH public key* @@ -44,15 +52,10 @@ PropertyCategories: DefaultValue: '' Configurations: '*' UserConfigurable: true - - Key: guestinfo.ntpserver - Type: string(1..) - Label: Time server* - Description: A comma-separated list of timeservers - DefaultValue: 0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org - Configurations: '*' - UserConfigurable: true + - Name: 2) Networking ProductProperties: + - Key: guestinfo.ipaddress Type: ip Label: IP Address* @@ -60,6 +63,7 @@ PropertyCategories: DefaultValue: '' Configurations: '*' UserConfigurable: true + - Key: guestinfo.prefixlength Type: int(8..32) Label: Subnet prefix length* @@ -67,6 +71,7 @@ PropertyCategories: DefaultValue: '24' Configurations: '*' UserConfigurable: true + - Key: guestinfo.dnsserver Type: ip Label: DNS server* @@ -74,6 +79,7 @@ PropertyCategories: DefaultValue: '' Configurations: '*' UserConfigurable: true + - Key: guestinfo.gateway Type: ip Label: Gateway* @@ -82,6 +88,24 @@ PropertyCategories: Configurations: '*' UserConfigurable: true + - Key: guestinfo.ntpserver + Type: string(1..) + Label: Time server* + Description: A comma-separated list of timeservers + DefaultValue: 0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org + Configurations: '*' + UserConfigurable: true + +- Name: 3) Kubernetes + ProductProperties: + - Key: guestinfo.fqdn + Type: string(1..) + Label: Appliance FQDN* + Description: 'Respective subdomains will be available for each component (e.g. storage.example.org); this address should already be configured as a wildcard record within your DNS zone.' + DefaultValue: 'example.org' + Configurations: '*' + UserConfigurable: true + AdvancedOptions: - Key: appliance.name Value: "{{ appliance.name }}"