Skip to content

Conversation

@ljblancoredborder
Copy link
Member

https://redmine.redborder.lan/issues/21226

The goal of this task was initially to just fix the resolution in /etc/hosts to services in the manager, and also keep the connection with services in localhost.
Old process:

It is expected that anything chages the /etc/hosts file
Chef runs, calling update_file_hosts
Update_file_hosts reads /etc/hosts file
Update_file_hosts checks diffs between /etc/hosts file and nodes information.
Update_file_hosts only updates the new information on hosts.erb
Chef passes hosts mapped information to a simple template hosts.erb
The management of hosts.erb was getting complicated because of a concurrent condition and diff checks. It feels that this process is breaking the first two rules of SOLID. The process now is:

We don't care if some deprecated process add new lines in /etc/hosts, it should be in nodes information.
Chef runs, calling update_file_hosts
Update_file_hosts gathers information from nodes
Chef passes hosts mapped information to hosts.erb
In hosts.erb file we can define the order of the hosts information, aswell the new hosts we want to add on demand during next iteration.
Now update_file_hosts only writes the information in the node, but also leaves open for modifications the hosts.erb

@ljblancoredborder ljblancoredborder added the size/M size/M label May 27, 2025
@ljblancoredborder ljblancoredborder added the bug Something isn't working label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size/M size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants