trinityX
trinityX copied to clipboard
INSTALL.sh doesn't update hosts
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
True. though this has no immediate effect on the run as long as host=127.0.0.1, we will look into updating that.
I try to have this incorporated into trix 15 if not, 15.1. Since it's affecting the outcome little, i mark it as closed. I thank you for your input. It's really valuable.