clustervision / trinityX

TrinityX is the new generation of ClusterVision's open-source HPC, A/I and cloudbursting platform. It is designed from the ground up to provide all services required in a modern HPC and A/I system, and to allow full customization of the installation.
GNU General Public License v3.0
64 stars 37 forks source link

INSTALL.sh doesn't update hosts #422

Open mulderij opened 3 months ago

mulderij commented 3 months ago

When running INSTALL.sh site/hosts is just copied from site/hosts.example. It should probably be updated from the site/group_vars/all.yml information that was entered in the tui_configurator. For example:

ha=$(/bin/grep '^ha: ' group_vars/all.yml | /bin/cut -d ' ' -f2)
trix_ctrl1_hostname=$(/bin/grep '^trix_ctrl1_hostname: ' group_vars/all.yml | /bin/cut -d ' ' -f2)
trix_ctrl1_ip=$(/bin/grep '^trix_ctrl1_ip: ' group_vars/all.yml | /bin/cut -d ' ' -f2)
trix_ctrl2_hostname=$(/bin/grep '^trix_ctrl2_hostname: ' group_vars/all.yml | /bin/cut -d ' ' -f2)
trix_ctrl2_ip=$(/bin/grep '^trix_ctrl2_ip: ' group_vars/all.yml | /bin/cut -d ' ' -f2)

/bin/cat <<EOF > hosts
# Generated by INSTALL.sh
[controllers]
${trix_ctrl1_hostname} ansible_host=${trix_ctrl1_ip}
EOF
[[ "${ha}" == 'true' ]] && /bin/echo "${trix_ctrl2_hostname} ansible_host=${trix_ctrl2_ip}" >> hosts
/bin/sed --in-place "s/^\($(/bin/hostname --short) .*\)$/\1 ansible_connection=local/g" hosts

Or at least

trix_ctrl1_hostname=$(/bin/grep '^trix_ctrl1_hostname: ' group_vars/all.yml | /bin/cut -d ' ' -f2)

/bin/cat <<EOF > hosts
# Generated by INSTALL.sh
[controllers]
${trix_ctrl1_hostname} ansible_host=127.0.0.1 ansible_connection=local
EOF
aphmschonewille commented 2 months ago

True. though this has no immediate effect on the run as long as host=127.0.0.1, we will look into updating that.