Change ImagePullPolicy;Update tty console message;Sanitize user input;Add missing vapp property
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2023-01-22 15:08:12 +01:00
parent e7d89006fc
commit ca51303602
6 changed files with 20 additions and 9 deletions

View File

@ -27,7 +27,7 @@
chdir: /opt/metacluster/k3s chdir: /opt/metacluster/k3s
environment: environment:
INSTALL_K3S_SKIP_DOWNLOAD: 'true' INSTALL_K3S_SKIP_DOWNLOAD: 'true'
INSTALL_K3S_EXEC: "server --cluster-init --token {{ vapp['metacluster.token'] }} --tls-san {{ vapp['metacluster.vip'] }} --disable local-storage --config /etc/rancher/k3s/config.yaml" INSTALL_K3S_EXEC: "server --cluster-init --token {{ vapp['metacluster.token'] | trim }} --tls-san {{ vapp['metacluster.vip'] }} --disable local-storage --config /etc/rancher/k3s/config.yaml"
when: ansible_facts.services['k3s.service'] is undefined when: ansible_facts.services['k3s.service'] is undefined
- name: Debug possible taints on k3s node - name: Debug possible taints on k3s node

View File

@ -19,7 +19,7 @@
content: | content: |
{{ lookup('ansible.builtin.file', '/opt/metacluster/kube-vip/rbac.yaml') }} {{ lookup('ansible.builtin.file', '/opt/metacluster/kube-vip/rbac.yaml') }}
--- ---
{{ kubevip_manifest.stdout }} {{ kubevip_manifest.stdout | replace('imagePullPolicy: Always', 'imagePullPolicy: IfNotPresent') }}
notify: notify:
- Apply manifests - Apply manifests

View File

@ -18,6 +18,9 @@
name: ttyConsoleMessage name: ttyConsoleMessage
executable: /opt/firstboot/tty.sh executable: /opt/firstboot/tty.sh
workingdir: /tmp/ workingdir: /tmp/
metacluster:
fqdn: "{{ vapp['metacluster.fqdn'] }}"
vip: "{{ vapp['metacluster.vip'] }}"
loop: loop:
- src: tty.j2 - src: tty.j2
dest: "{{ _template.service.executable }}" dest: "{{ _template.service.executable }}"

View File

@ -13,9 +13,9 @@ LCLR='\033[K' # Clear to end of line
PRST='\033[0;0H' # Reset cursor position PRST='\033[0;0H' # Reset cursor position
# COMPONENTS=('ca' 'ingress' 'storage' 'registry' 'git' 'gitops') # COMPONENTS=('ca' 'ingress' 'storage' 'registry' 'git' 'gitops')
COMPONENTS=('ca' 'storage' 'registry' 'git' 'gitops') COMPONENTS=('storage' 'registry' 'git' 'gitops')
FQDN='{{ vapp['metacluster.fqdn'] }}' FQDN='{{ _template.metacluster.fqdn }}'
IPADDRESS='{{ vapp['guestinfo.ipaddress'] }}' IPADDRESS='{{ _template.metacluster.vip }}'
I=60 I=60

View File

@ -27,7 +27,7 @@
chdir: /opt/metacluster/k3s chdir: /opt/metacluster/k3s
environment: environment:
INSTALL_K3S_SKIP_DOWNLOAD: 'true' INSTALL_K3S_SKIP_DOWNLOAD: 'true'
INSTALL_K3S_EXEC: "server --token {{ vapp['metacluster.token'] }} --server https://{{ vapp['metacluster.fqdn'] }}:6443 --disable local-storage --config /etc/rancher/k3s/config.yaml" INSTALL_K3S_EXEC: "server --token {{ vapp['metacluster.token'] | trim }} --server https://{{ vapp['metacluster.fqdn'] }}:6443 --disable local-storage --config /etc/rancher/k3s/config.yaml"
when: ansible_facts.services['k3s.service'] is undefined when: ansible_facts.services['k3s.service'] is undefined
- name: Ensure API availability - name: Ensure API availability

View File

@ -12,10 +12,18 @@ PropertyCategories:
- Name: 1) Existing meta-cluster - Name: 1) Existing meta-cluster
ProductProperties: ProductProperties:
- Key: metacluster.vip - Key: metacluster.fqdn
Type: string(1..) Type: string(1..)
Label: Meta-cluster FQDN/IP-address* Label: Meta-cluster FQDN*
Description: The address of the target meta-cluster which this appliance will perform an upgrade on. Description: The FQDN of the target meta-cluster which this appliance will perform an upgrade on.
DefaultValue: meta.k8s.cluster
Configurations: '*'
UserConfigurable: true
- key: metacluster.vip
Type: ip
Label: Meta-cluster virtual IP*
Description: Meta-cluster control plane endpoint virtual IP
DefaultValue: '' DefaultValue: ''
Configurations: '*' Configurations: '*'
UserConfigurable: true UserConfigurable: true