Switch tty message to systemd service;Add missing kubeconfig;Refactor tty script
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Danny Bessems 2023-01-07 11:58:58 +01:00
parent 2a5a154df0
commit 62660c8d6c
4 changed files with 36 additions and 16 deletions

View File

@ -20,7 +20,11 @@
loop_control: loop_control:
label: "{{ item.src }}" label: "{{ item.src }}"
- name: Enable tarball compression service - name: Enable/Start services
ansible.builtin.systemd: ansible.builtin.systemd:
name: compressTarballs name: "{{ item }}"
enabled: yes enabled: yes
state: started
loop:
- compressTarballs
- ttyConsoleMessage

View File

@ -5,16 +5,24 @@
loop: loop:
- /opt/firstboot - /opt/firstboot
- name: Save tty script file - name: Create tty console message service
ansible.builtin.template: ansible.builtin.template:
src: tty.j2 src: "{{ item.src }}"
dest: /opt/firstboot/tty.sh dest: "{{ item.dest }}"
owner: root owner: root
group: root group: root
mode: 0700 mode: "{{ item.mode | default(omit) }}"
vars:
- name: Create @reboot crontab job _template:
ansible.builtin.cron: service:
name: tty.consolemessage name: ttyConsoleMessage
special_time: reboot executable: /opt/firstboot/tty.sh
job: /opt/firstboot/tty.sh workingdir: /tmp/
loop:
- src: tty.j2
dest: "{{ _template.service.executable }}"
mode: o+x
- src: systemdunit.j2
dest: /etc/systemd/system/{{ _template.service.name }}.service
loop_control:
label: "{{ item.src }}"

View File

@ -112,7 +112,10 @@
- name: Retrieve kubeconfig - name: Retrieve kubeconfig
ansible.builtin.command: ansible.builtin.command:
cmd: clusterctl get kubeconfig {{ vapp['workloadcluster.name'] | lower }} cmd: >-
clusterctl get kubeconfig \
{{ vapp['workloadcluster.name'] | lower }} \
--kubeconfig {{ kubeconfig.path }}
register: capi_kubectl_config register: capi_kubectl_config
- name: Store kubeconfig in tempfile - name: Store kubeconfig in tempfile

View File

@ -17,11 +17,16 @@ COMPONENTS=('ca' 'storage' 'registry' 'git' 'gitops')
FQDN='{{ vapp['metacluster.fqdn'] }}' FQDN='{{ vapp['metacluster.fqdn'] }}'
IPADDRESS='{{ vapp['guestinfo.ipaddress'] }}' IPADDRESS='{{ vapp['guestinfo.ipaddress'] }}'
# Waiting to allow boot sequence to finish; crude! I=10
sleep 30
clear > /dev/tty1
while /bin/true; do while /bin/true; do
if [[ $I -lt 9 ]]; then
clear > /dev/tty1
I=0
else
I=$(( $I + 1 ))
fi
echo -e "${PRST}" > /dev/tty1 echo -e "${PRST}" > /dev/tty1
echo -e "\n\n\t${DFLT}To manage this appliance, please connect to one of the following:${LCLR}\n" > /dev/tty1 echo -e "\n\n\t${DFLT}To manage this appliance, please connect to one of the following:${LCLR}\n" > /dev/tty1