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

Conflicting entries left in /etc/hosts file if installation settings are changed #5120

Open
rocodes opened this issue Feb 12, 2020 · 0 comments

Comments

@rocodes
Copy link
Contributor

rocodes commented Feb 12, 2020

Description

If incorrect information is entered in initial sdconfig and install (such as switching the app and mon IP names or IP addresses), and then the installation is rerun with correct values, app's /etc/hosts ends up with two conflicting entries.

(Reporting as issue has been encountered by an existing instance)

Steps to Reproduce

(Probably?) Run sdconfig but switch app and mon IP addresses in error (so 10.20.3.2 for app) to simulate user error, then install.
Then rerun sdconfig and install with correct values.

Expected Behavior

Subsequent install replaces old hosts file with new hosts file. In this case, incorrect alias should be overwritten.

amnesia@amnesia:~$ ssh app "sudo cat /etc/hosts | grep securedrop"
10.20.3.2 mon securedrop-monitor-server-alias

Actual Behavior

Old values are preserved and new values are appended, creating a conflict.

amnesia@amnesia:~$ ssh app "sudo cat /etc/hosts | grep securedrop"
10.20.3.2 app securedrop-monitor-server-alias
10.20.3.2 mon securedrop-monitor-server-alias

Comments

This is likely because securedrop/install_files/ansible-base/roles/common/tasks/setup_etc_hosts.yml has a task for avoiding adding duplicate entries, but does not handle the case of a user trying to replace/overwrite an incorrect entry.

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

1 participant