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
Improved onboarding process and tools to set up hostnames #208
Conversation
This PR helps address issue #172 |
I think the target name is stored in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Some comments and suggestions.
salt/core/init.sls
Outdated
|
||
include: | ||
- core.apt | ||
- core.customization | ||
- core.fail2ban | ||
- core.firewall | ||
- core.locale | ||
- core.mail | ||
- core.motd | ||
- core.ntp | ||
- core.sshd | ||
- core.swap | ||
- core.systemd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't dependencies of the init.sls
file. I think it's better to leave them in the top file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very true, I was considering them dependencies of the "core" install as I don't see us running init.sls
without the other files.
The benefit of moving these here is that when onboarding.sls
runs include: core
this then picks up on all of the other state files. Rather than duplicating them in onboarding.sls
.
I see your other comment regarding salt-ssh TARGET 'onboarding,core*'
which also mitigates this.
Happy with that approach instead.
include: | ||
- core | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, we can do salt-ssh TARGET state.apply 'onboarding,core*'
above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix this last bit after merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applying suggested changes
Co-authored-by: James McKinney <26463+jpmckinney@users.noreply.github.com>
Co-authored-by: James McKinney <26463+jpmckinney@users.noreply.github.com>
In my testing |
Aha, it must have only worked because the server I was working on had the hostname equal to the target name :) |
Co-authored-by: James McKinney <26463+jpmckinney@users.noreply.github.com>
@RobHooper Can you fix the conflicts, then let me know when it's ready for review? |
This PR adds a new salt config called "onboarding.sls" that manages the initial steps we run on new servers.
These currently being: patching, setting up and configuring the server hostname and finally running the "core" install.
This was a bit delayed because I was hoping to use the salt target to get the hostname.
The PR instead requires a extra bit of pillar data:
I wanted to use the target because the above feels it is duplicate information - the "host_id" is in the target name, I just can't query the target name in salt.
I was wondering if there was a work around via Python but I didn't get anywhere when I looked into it.