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 versions to requirements.yml examples #13

Open
aharden opened this issue Jan 1, 2020 · 3 comments
Open

Add versions to requirements.yml examples #13

aharden opened this issue Jan 1, 2020 · 3 comments

Comments

@aharden
Copy link

aharden commented Jan 1, 2020

In a production Ansible configuration, it should be a best practice to provide desired versions of Galaxy roles that are to be downloaded to support the playbooks. I recommend adding versions to the roles in the requirements.yml files in the examples as you get closer to the 1.0 release.

@geerlingguy
Copy link
Owner

I have gone both ways on this, for the book examples:

  • On the one hand, as you mention, for production use, you should always use specific versions (tags), ideally immutable versions (though you can't get that with Galaxy roles, only collections today).
  • On the other hand, it has two downsides specific to the book:
    1. It makes maintenance more difficult, as in addition to updating about 15 other parts of the book every few months, I'll need to spend a few hours updating all the role versions every time I update the book.
    2. This book's repo actually has a number of end-to-end functional tests for my roles that I might not cover in the role's repo CI itself (whether that's a flaw in my test methodology or not, we can debate elsewhere ;). So if I keep them on 'latest', I can find flaws (and avoid bumping into deprecated usages after new Ansible releases) more quickly and easily through the repo's CI builds.

That said, it would be kind of nice if Ansible let me say 'override versions and use latest' using the ansible-galaxy cli. I could also include two versions of the requirements.yml files, one with and one without (for CI), but that still requires more maintenance.

@aharden
Copy link
Author

aharden commented Jan 6, 2020

@geerlingguy I think a good compromise might be to explicitly put 'version: latest' in the examples and explain in the text that production processes should be locked into specific versions to avoid accidental breakage.

@geerlingguy
Copy link
Owner

@aharden Agreed. I think at a minimum I'll do that, and put a 'Warning' aside. Thanks for the suggestion!

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

No branches or pull requests

2 participants