Use sudo/become instead of root directly #158
Labels
No labels
Blocked
Existing Service
Infrastructure Issue
Refactor
Security Hardening
Security Issue
Service Idea
Service Removal
Upgrade service
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: data.coop/ansible#158
Loading…
Reference in a new issue
No description provided.
Delete branch "use_sudo"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have added an extra target
create_ansible_cfg
in the Makefile to replace the username placeholder, that should be run first thing when cloning the repo.Supersedes #35.
eccadb6b3f
tobb6e550fea
00334457b2
to63414b60dd
63414b60dd
to0fd11fee37
I'm not a fan of putting
ansible.cfg
in.gitignore
, and the defaultremote_user
is guaranteed to not work. Can we maybe just removeremote_user
? And then either hope that the local username matches the remote username, or have the user setANSIBLE_REMOTE_USER=
environment variable.I generally like having make targets like
create_ansible_cfg
in order to bootstrap local configurations in repositories. This is usually the sweet spot between sharing configuration in the repo and needing to individually customize it. But it does have downsides, too.@reynir
That could work, just needs to be written in the README then?
I do see the issue here... once a local env is bootstrapped, it's hard to push a change to ansible.cfg through Git, so it has to be communicated manually.
That can probably become an issue... is that what you mean @reynir ?
Can ansible.cfg include configurations from other conf files? Because then we could have one that's actually in the repo.
@reynir @benjaoming we could probably get away with an env var instead. I don't think
ansible.cfg
can include other files, but we could handle it indeploy.sh
usingAt least for me, my username on hevonen is not the same as my local username.
Yes, indeed. I'm not a fan of putting repository data in .gitignore.
We could use a
ansible.cfg.template
as a source and have a ansible.cfg target. That would solve the problem of the defaultREMOTE_USER
. Quick update: and allow us to put ansible.cfg in .gitignore.Isn't that exactly what I've done?
Either way, I actually think it's better to have a
.gitignore
'd.env
file to store aANSIBLE_REMOTE_USER
var, removeremote_user
entirely fromansible.cfg
, and then handle it indeploy.sh
like I described above.No, the difference is the template is under a different name and can be checked in to git without a problem.
Right okay. So what you mean is that we should have an
ansible.cfg.template
that simply doesn't have theremote_user
line, and then a make target that createsansible.cfg
? I guess that'll work, seems like a cleaner way to do it.Alternatively, the
--user
flag with a.env
could work as well. That would make it unnecessary to run the make target if the local username is the same as the remote username.What do you think?
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.