[FOLIO-2807] Automate "Create Users" script in the reference environments Created: 28/Sep/20  Updated: 11/Nov/20  Resolved: 11/Nov/20

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: TBD
Reporter: Anton Emelianov (Inactive) Assignee: Wayne Schneider
Resolution: Done Votes: 0
Labels: devops-backlog
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Cloners
clones FOLIO-2806 Automate "Crate Users" script in the ... Closed
Duplicate
is duplicated by FOLIO-2797 Apply User Script to snapshot pipeline Closed
Relates
relates to FOLIO-2784 node script to populate users with pe... Closed
Sprint: DevOps: Sprint 97, DevOps: Sprint 99, DevOps: Sprint 100, CP: sprint 101
Development Team: FOLIO DevOps

 Description   

POs requested to populate users with predefined permissions sets to avoid testing with diku_admin user.
Zak Burke created the script by completing FOLIO-2784 Closed .
The next step would be to figure out the best way to execute this script as a final step in the Folio test system rebuild.

Error reporting

Since this script may potentially fail when permissions are missing please report any errors up to the pipeline.



 Comments   
Comment by Wayne Schneider [ 14/Oct/20 ]

This is now working for the folio-snapshot-test build. Need to refine so it only runs for "platform-complete" builds (not "platform-core").

Anton Emelianov is this also required for the release reference builds, or only snapshot and testing?

Comment by Anton Emelianov (Inactive) [ 14/Oct/20 ]

Wayne Schneider, It would be great to have it for the release reference builds too.

Comment by Wayne Schneider [ 15/Oct/20 ]

Still failing on the reference builds, see https://jenkins-aws.indexdata.com/job/FOLIO_Reference_Builds/job/folio-snapshot-load/636/. Possible timing issue with ELB/DNS updates?

Comment by Wayne Schneider [ 20/Oct/20 ]

Zak Burke has kindly offered to take a look at the add-users.js script to allow for a little more configurable connections. This would allow us to include this step in the environment build playbook with localhost as the target, rather than needing to wait for the ELB and DNS to be updated before this can be run.

Comment by Zak Burke [ 21/Oct/20 ]

Wayne Schneider, I added a --okapi CLI option, in addition to the present --hostname option.

  • Given --hostname some.host.edu, all requests will be made over https. (This is the original behavior.)
  • Given --okapi http://some.host.edu:port, the script will parse the value's prefix (http or https) (and port, if provided) to assess whether requests should be made over http or https.
  • Given --port, if the value is 443 requests will be made over https; any other value will cause requests to be made over http.
Comment by Wayne Schneider [ 03/Nov/20 ]

Playbooks updated. Users should be in platform-complete-based reference environments (including Vagrant boxes) after tonight's builds.

Comment by Wayne Schneider [ 03/Nov/20 ]

Verified – test users are available in folio-testing and folio-snapshot. Permission sets are pulled from the head of the main branch of folio-tools, so any changes there will be reflected in the reference builds.

Comment by Florian Gleixner [ 06/Nov/20 ]

On a new machine i get following error:
FAILED! =>

{"changed": true, "cmd": "n lts", "delta": "0:00:00.504599", "end": "2020-11-06 15:55:00.211065", "msg": "non-zero return code", "rc": 1, "start": "2020-11-06 15:54:59.706466", "stderr": "mkdir: cannot create directory ā€˜/usr/local/n’: Permission denied\n\n Error: sudo required (or change ownership, or define N_PREFIX)", "stderr_lines": ["mkdir: cannot create directory ā€˜/usr/local/n’: Permission denied", "", " Error: sudo required (or change ownership, or define N_PREFIX)"], "stdout": "\n installing : node-v14.15.0\n mkdir : /usr/local/n/versions/node/14.15.0", "stdout_lines": ["", " installing : node-v14.15.0", " mkdir : /usr/local/n/versions/node/14.15.0"]}

The task that calls "n lts" seems to need root permissions.

Comment by Wayne Schneider [ 09/Nov/20 ]

Florian Gleixner thank you, in our testing we probably ran a playbook that did n lts as root earlier in the build. We'll do a little testing and update the role if necessary.

Comment by Wayne Schneider [ 10/Nov/20 ]

Fix pushed to branch FOLIO-2807-sudo, but unable to test at the moment due to other build issues.

Comment by Wayne Schneider [ 11/Nov/20 ]

add-users role now uses become to execute n lts

Generated at Thu Feb 08 23:23:23 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.