Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INSTALL.sh doesn't update hosts #422

Open
mulderij opened this issue Jul 25, 2024 · 1 comment
Open

INSTALL.sh doesn't update hosts #422

mulderij opened this issue Jul 25, 2024 · 1 comment

Comments

@mulderij
Copy link

mulderij commented Jul 25, 2024

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants