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 missing ansible tags #236

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Conversation

sanatsathaye
Copy link
Contributor

Added tags to lemmy.yml and lemmy-almalinux.yml. Hope they look fine, pls suggest if there's any that can be changed.

Also, this will kinda sorta help with #189 because you can run something like ansible-playbook lemmy.yml --skip-tags ssl that will effectively bypass everything related to ssl in case you want to reuse existing certificates (or your setup is like mine where I test out the files within WSL/vagrant without a valid domain).

Honestly speaking I wouldn't recommend running the playbook solely relying on tags at all unless you're extremely familiar with both the playbook and ansible, but it can be used for cases like I mentioned.

I don't think uninstall.yml needs tags because it completely works on user input so I didn't bother.

@sanatsathaye
Copy link
Contributor Author

@codyro did most of the work with tags already in the Alma playbook, so I've re-used as much as I can 😄

@ticoombs
Copy link
Collaborator

ticoombs commented Apr 8, 2024

Is there a reason we've gone so descriptive with these? ie; can you let us know how we'd want to use them?

  • --skip-tags directories (to speed up?)
  • --tags always --tags docker (to install docker?)
  • --skip-tags dependencies (speed up?)

If we have these tags we should also have some documentation on how to use them efficiently. Otherwise I can see people running into problems.

I understand ssl/certbot/initial as users could skip that and that could help solve #189 but i'm not sure of the others.

(We'll most likely accept it as it is, but if we can have some guidance on how we could utilise these tags that would be great)

@codyro
Copy link
Collaborator

codyro commented Apr 8, 2024

Is there a reason we've gone so descriptive with these? ie; can you let us know how we'd want to use them?

  • --skip-tags directories (to speed up?)

  • --tags always --tags docker (to install docker?)

  • --skip-tags dependencies (speed up?)

If we have these tags we should also have some documentation on how to use them efficiently. Otherwise I can see people running into problems.

I understand ssl/certbot/initial as users could skip that and that could help solve #189 but i'm not sure of the others.

(We'll most likely accept it as it is, but if we can have some guidance on how we could utilise these tags that would be great)

Regarding the playbook I made, I tend to do it for development reasons (which sometimes can be helpful in production). I don't think it's harmful to have, though.

I used the always tag because it's a special use one: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html#special-tags-always-and-never

It lets you ensure some tasks always run even when limiting them to a subset via --tags, providing mission critical tasks run regardless of what's passed. I assume that’s what @sanatsathaye using as an example/baseline.

@dessalines
Copy link
Member

I'll defer to @codyro 's recommendations on this one, but simpler is better.

@dessalines dessalines enabled auto-merge (squash) April 22, 2024 15:07
@dessalines dessalines merged commit 85e7ea2 into LemmyNet:main Apr 22, 2024
1 check passed
@sanatsathaye sanatsathaye deleted the ansible-tags branch June 8, 2024 18:34
Nothing4You added a commit to Nothing4You/lemmy-ansible that referenced this pull request Feb 15, 2025
LemmyNet#238 added the installation of cron as dependency, but the merge of LemmyNet#236 accidentally inserted a tags section in the middle of the packages to be installed
dessalines pushed a commit that referenced this pull request Feb 15, 2025
#238 added the installation of cron as dependency, but the merge of #236 accidentally inserted a tags section in the middle of the packages to be installed
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.

4 participants