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

EPIC: Improve our use of ansible to use best practices #2492

Open
sxa opened this issue Feb 28, 2022 · 8 comments
Open

EPIC: Improve our use of ansible to use best practices #2492

sxa opened this issue Feb 28, 2022 · 8 comments
Milestone

Comments

@sxa
Copy link
Member

sxa commented Feb 28, 2022

Quite a lot of our ansible use has been "improvised" over the years. We should revisit areas where we see improvements that can be made and try and "do the right thing" in each case to become a shining example of how to use ansible!

@sxa
Copy link
Member Author

sxa commented Feb 28, 2022

@aixtools
Copy link
Contributor

As long as you don't expect it all done by tomorrow - I am willing to invest time in this - building on my experience as I redo AIX playbooks - on a parallel path.

@Willsparker
Copy link
Contributor

I'd love to help too! Though maybe that goes without saying..

@Haroon-Khel
Copy link
Contributor

Haroon-Khel commented Mar 3, 2022

We should also define what 'best practices' are (if there does not already exists a wiki page somewhere). For starters, I like @Willsparker's encouragement of idempotency (for roles which we do not already do it) in #2373

Some others

  • Clean up of downloaded tar files when necessary
  • Modularity; ensure that we keep roles separated when they can

@sxa sxa added this to the 2022-04 (April) milestone Mar 3, 2022
@Willsparker
Copy link
Contributor

Willsparker commented Mar 4, 2022

Funny you mention that, @Haroon-Khel , a wiki page does exist!

That sort of goes into the nitty-gritty of 'best practices' (i.e. playbook structure, inventory structure etc.), but the best way to put it is, the playbooks need to be idempotent, modular and easily human-readable. I recently made a small playbook that sets up Nagios-Core for #2445 , with these in things mind.

Other things, maybe more specific to Adopt, is to not use shell or command where at all possible, and when you do use them, ensure that changed_when is used ( See: #2424 and #2450 ), I do concede that, with our playbooks being so monolithic (i.e. supporting multiple platforms, on multiple architectures, some of which are EOL), best practices can be a hard thing to keep going.

@sxa
Copy link
Member Author

sxa commented Mar 4, 2022

ensure that changed_when is used ( See: #2424 and #2450 )

changed_when is also being used more in the AIX playbooks in @aixtools' PRs at https://github.com/adoptium/infrastructure/pull/2453/files and https://github.com/adoptium/infrastructure/pull/2483/files

@aixtools
Copy link
Contributor

From the wiki page @Willsparker mentioned - imho: a good start for re-structuring the Unix playbooks will be using something suggested here: https://docs.ansible.com/ansible/2.8/user_guide/playbooks_best_practices.html#id24

@sxa
Copy link
Member Author

sxa commented May 30, 2022

Related: #1757

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

No branches or pull requests

4 participants