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

Add LinkWarden role #326

Merged
merged 9 commits into from
Jan 31, 2024
Merged

Add LinkWarden role #326

merged 9 commits into from
Jan 31, 2024

Conversation

RaneyDazed
Copy link
Contributor

Add LinkWarden role with default configs and tasks

Introduce a new Ansible role for LinkWarden, setting up default
variables for Docker deployment, such as container name, image,
environment variables, and networks. Included tasks handle PostgreSQL dependency, DNS setup, container management, and directory creation. This addition allows for LinkWarden deployment and maintenance in the
Sandbox environment.

<3 GPT

Relevant issue: #324

Introduce a new Ansible role for LinkWarden, setting up default
variables for Docker deployment, such as container name, image,
environment variables, and networks. Included tasks handle PostgreSQL
dependency, DNS setup, container management, and directory creation.
This addition allows for LinkWarden deployment and maintenance in the
Sandbox environment.

<3 GPT

Relevant issue: saltyorg#324
Updated the DATABASE_URL environment variable to dynamically use the
specific `linkwarden_name` value rather than a hardcoded database name.
@owine
Copy link
Collaborator

owine commented Jan 30, 2024

Warning: Jinja2 spacing could be improved: {{ 'https://' + (linkwarden_web_subdomain + '.'   + linkwarden_web_domain if (linkwarden_web_subdomain | length > 0) else linkwarden_web_domain) }} -> {{ 'https://' + (linkwarden_web_subdomain + '.' + linkwarden_web_domain if (linkwarden_web_subdomain | length > 0) else linkwarden_web_domain) }}
roles/linkwarden/defaults/main.yml:32 Jinja2 template rewrite recommendation: `{{ 'https://' + (linkwarden_web_subdomain + '.' + linkwarden_web_domain if (linkwarden_web_subdomain | length > 0) else linkwarden_web_domain) }}`.

@RaneyDazed
Copy link
Contributor Author

RaneyDazed commented Jan 30, 2024

Warning: Jinja2 spacing could be improved: {{ 'https://' + (linkwarden_web_subdomain + '.'   + linkwarden_web_domain if (linkwarden_web_subdomain | length > 0) else linkwarden_web_domain) }} -> {{ 'https://' + (linkwarden_web_subdomain + '.' + linkwarden_web_domain if (linkwarden_web_subdomain | length > 0) else linkwarden_web_domain) }}
roles/linkwarden/defaults/main.yml:32 Jinja2 template rewrite recommendation: `{{ 'https://' + (linkwarden_web_subdomain + '.' + linkwarden_web_domain if (linkwarden_web_subdomain | length > 0) else linkwarden_web_domain) }}`.

Hey @owine, I saw this late last night, I'll get on it in a bit, thanks for pointing it out. I used vs codes "Change All Occurences" thing to fix the + spacing and I guess I got those too. :p

RaneyDazed and others added 2 commits January 30, 2024 12:43
Improved the readability of the URL construction logic in the linkwarden
role defaults by removing excess whitespace. This change ensures that
the web URL is generated cleanly when the subdomain is present. No
functionality is altered, just a cosmetic fix that enhances code
maintainability.
Copy link
Contributor Author

@RaneyDazed RaneyDazed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should do it!

@owine
Copy link
Collaborator

owine commented Jan 30, 2024

Changed postgres formatting to match some changes I made to others to expose more items as inventory vars. Can you just do a quick test on those @RaneyDazed and this should be good to merge

@RaneyDazed
Copy link
Contributor Author

Changed postgres formatting to match some changes I made to others to expose more items as inventory vars. Can you just do a quick test on those @RaneyDazed and this should be good to merge

I'll take a look later tonight! Gotta start on my final for social science :p

@RaneyDazed
Copy link
Contributor Author

RaneyDazed commented Jan 30, 2024

Changed postgres formatting to match some changes I made to others to expose more items as inventory vars. Can you just do a quick test on those @RaneyDazed and this should be good to merge

not working. will pull up pgadmin or something in a bit and take a look!

Datasource "db": PostgreSQL database "linkwarden", schema "public" at "linkwarden-postgres:5432"

Error: P1000: Authentication failed against database server at `linkwarden-postgres`, the provided database credentials for `linkwarden` are not valid.

Please make sure to provide valid database credentials for the database server at `linkwarden-postgres`.
error Command failed with exit code 1.

@owine

@owine
Copy link
Collaborator

owine commented Jan 30, 2024

Did you put it against a clean setup or your existing instance? Wouldn't expect it to work against existing since it's setting up a user/pass for auth instead of using defaults

@RaneyDazed
Copy link
Contributor Author

Did you put it against a clean setup or your existing instance? Wouldn't expect it to work against existing since it's setting up a user/pass for auth instead of using defaults

clean install, removed the existing linkwarden dir. ran update tag. linkwarden and linkwarden-postgres are both pulled, PG is up and running, but LW is in a restart loop.

@RaneyDazed
Copy link
Contributor Author

actually ran docker system prune -a before attempting the install.

@owine
Copy link
Collaborator

owine commented Jan 31, 2024

I see the error, fix coming

@RaneyDazed
Copy link
Contributor Author

standby, I only changed the one variable in postgres include. updating to reflect your changes in defaults as well. testing rn

@RaneyDazed
Copy link
Contributor Author

All set!

@owine owine merged commit 84adc5e into saltyorg:master Jan 31, 2024
175 checks passed
@RaneyDazed
Copy link
Contributor Author

closes #324 @inject3d

@RaneyDazed RaneyDazed deleted the linkwarden branch January 31, 2024 14:54
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.

3 participants