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

Create a playbook to update the allsearch-api's banner #5200

Open
4 of 9 tasks
maxkadel opened this issue Jul 24, 2024 · 1 comment
Open
4 of 9 tasks

Create a playbook to update the allsearch-api's banner #5200

maxkadel opened this issue Jul 24, 2024 · 1 comment
Assignees
Labels

Comments

@maxkadel
Copy link
Contributor

maxkadel commented Jul 24, 2024

User story

We want to make it so that folks like Esmé can update the banner on the allsearch-api (which currently updates the Allsearch, but may in the future update other applications as well) without necessarily having a working local environment for it, and without needing to ssh onto the servers. The hope is that this playbook could be added to ansible-tower, and users could log in there to update the information about the banner, including the banner text.

Acceptance criteria

  • The playbook should accept 5 user-supplied variables
    • Environment (staging or production - default to staging)
    • Banner text - which may be a long string that may include html tags
    • alert_status - string - valid values are info, success, warning, or error
    • dismissible - boolean
    • autoclear - boolean
  • The playbook should then run the allsearch api banner:update rake task on one of the allsearch api servers for the given environment, using the user-supplied variables
  • It should work correctly if the text includes commas (a rake task gotcha is that you have to escape commas when running it on the command line)
  • The text, etc., on https://allsearch-api.princeton.edu/banner should update based on the user supplied variables

Concrete example

When we recently needed to update the banner text on Orangelight with very little notice, it was difficult to get the change on the servers (in part because of the rake task comma escaping weirdness).

Implementation notes, if any

@VickieKarasic
Copy link
Contributor

We got this error with the latest iteration of the playbook:

"stderr": "(in /opt/allsearch_api/releases/20241022171231)\nrake aborted!\nActiveRecord::ConnectionNotEstablished: connection to server at \"127.0.0.1\", port 5432 failed: Connection refused (ActiveRecord::ConnectionNotEstablished)\n\tIs the server running on that host and accepting TCP/IP connections?\n/opt/allsearch_api/shared/bundle/ruby/3.3.0/gems/activerecord-7.2.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:69:in `rescue in new_client'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants