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

Allow to run services with custom user #297

Open
wants to merge 1 commit into
base: qa/1.x
Choose a base branch
from
Open

Conversation

scollazo
Copy link
Contributor

@scollazo scollazo commented Jun 1, 2020

In some envs, archivematica needs to run with an user different than
"archivematica"

This pr adds two configuration default to allow so:

  • archivematica_src_am_system_user
  • archivematica_src_am_system_group
  • archivematica_src_ss_system_user
  • archivematica_src_ss_system_group

Connects to #307

@scollazo scollazo requested a review from mamedin June 1, 2020 11:50
@mamedin
Copy link
Contributor

mamedin commented Aug 28, 2020

Hi @scollazo , thanks for the PR :)

I have some questions/requests:

1) Do we need to create the users and groups here?:

https://github.com/artefactual-labs/ansible-archivematica-src/blob/qa/1.x/tasks/common.yml#L7-L17

2) Does it make sense to create new variables for home directories, gids and uids? Probably the home directories could be something like:

"/var/lib/{{ archivematica_src_am_system_user }}"
"/var/lib/{{ archivematica_src_ss_system_user }}"

In this case, the am directory should be created here:

https://github.com/artefactual-labs/ansible-archivematica-src/blob/qa/1.x/tasks/pipeline-osconf.yml#L16

And the SS home directory needs to be created in a separate task.

3) The AtoM user tasks in the am-configure section needs a review:

https://github.com/artefactual-labs/ansible-archivematica-src/blob/qa/1.x/tasks/configure.yml#L171-L226

4) After the qa/1.x rebase, these lines needs a change:

tasks/pipeline-environment.yml:    owner: "archivematica"
tasks/configure.yml:    owner: "archivematica"

tasks/pipeline-environment.yml:    group: "archivematica"
tasks/configure.yml:    group: "archivematica"

tasks/configure-gpg.yml:      become_user: "archivematica"
tasks/configure-gpg.yml:      become_user: "archivematica"

@scollazo
Copy link
Contributor Author

scollazo commented Sep 1, 2020

Hi @scollazo , thanks for the PR :)

I have some questions/requests:

1) Do we need to create the users and groups here?:

https://github.com/artefactual-labs/ansible-archivematica-src/blob/qa/1.x/tasks/common.yml#L7-L17

I avoided creating them on purpose, as they might be already created using active directory or other means.

2) Does it make sense to create new variables for home directories, gids and uids? Probably the home directories could be something like:

"/var/lib/{{ archivematica_src_am_system_user }}"
"/var/lib/{{ archivematica_src_ss_system_user }}"

In this case, the am directory should be created here:

https://github.com/artefactual-labs/ansible-archivematica-src/blob/qa/1.x/tasks/pipeline-osconf.yml#L16

And the SS home directory needs to be created in a separate task.

Besides changing the effective UID/GID for the Archivematica processess, I didn't want to mess too much with the current setttings. In my current use case, the user was created with /var/lib/archivematica as home directory, so there wasn't a need to do this. Do you think it would help in other cases?

3) The AtoM user tasks in the am-configure section needs a review:

https://github.com/artefactual-labs/ansible-archivematica-src/blob/qa/1.x/tasks/configure.yml#L171-L226

Could you be more specific?

4) After the qa/1.x rebase, these lines needs a change:

tasks/pipeline-environment.yml:    owner: "archivematica"
tasks/configure.yml:    owner: "archivematica"

tasks/pipeline-environment.yml:    group: "archivematica"
tasks/configure.yml:    group: "archivematica"

tasks/configure-gpg.yml:      become_user: "archivematica"
tasks/configure-gpg.yml:      become_user: "archivematica"

I'll fix those conflicts

/santi

@scollazo
Copy link
Contributor Author

@mamedin ping

In some envs, archivematica needs to run with an user different than
"archivematica"

This pr adds two configuration default to allow so:
  - archivematica_src_am_system_user
  - archivematica_src_am_system_group
  - archivematica_src_ss_system_user
  - archivematica_src_ss_system_group
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

Successfully merging this pull request may close these issues.

2 participants