-
Notifications
You must be signed in to change notification settings - Fork 851
Create user if it doesn't exist #36
Comments
any rpm/deb package no matter how you install it ( rpm / dpkg / yum / apt ) it will always create the user. |
When I wrote my own ansible role to install elasticsearch, I eventually had to add configuration to set the elasticsearch users uid and gid. The reason being that mismatched uid/gid's on different nodes resulted in some nodes being unable to read/write snapshots. Since the repo directory was on an nfs mount with an owner/group of the elasticsearch user on the node I initiated the repo from. At I think that's the initial problem I ran into, it's been a while. I do know forcing all nodes to have the same username and uid/gid's fixed that issue. So I'd love to be able to force the uid/gid's to be the same. Of course, I haven't checked to see if the owner/group issue still occurs with elasticsearch 2.x. I suppose I'm posting this a bit early... :\ |
I'd like to get @electrical view on this. Easily added but its whether this is the appropriate place or whether it should be supported elsewhere. |
I think that's only a problem when using |
Yes, S3 would not have issues with id's. But we're not using it for this. |
I can manually reproduce @jerrac issue. Its hard for us to automate and test for this in the kitchen tests as we currently don't form clusters across docker images. The alternative is to ask users to create users using a separate ansible role and simply specify the es_user and es_group. These will be used for the service. |
If I remember correctly, the package manager should use the existing user if one exists, right? So if I create a "elasticsearch" user before installing elasticsearch, the package manager would use the user I created. So, could we add a couple optional tasks to the role? If Does that make sense? |
So, what I described does seem to work just fine. See https://github.com/LaneCommunityCollege/ansible-elasticsearch/commit/de82918584edd5159643b43c1dff07cc4e5d63ca Is that enough for a pull request? Or is there something else I need to do? |
Hi |
Can support it yeah. |
@jerrac will you make a pull request here? If not, i'll work on this and try to get it to the next release. |
For #36 - Add support for creating optional elasticsearch user and group
Currently the default user "elasticsearch" is used - this is installed by the package manager.
If installed through a manual URL this might not be the case. User may also wish to use another user.
Proposal is to create the user if it doesn't exist.
The text was updated successfully, but these errors were encountered: