-
Notifications
You must be signed in to change notification settings - Fork 53
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
Task to fail if ansible_min_version isn't met #130
Task to fail if ansible_min_version isn't met #130
Conversation
Read ansible_min_version from meta/main.yml and fail the playbook if that version of Ansible (or higher) isn't being used. Use `fail`, rather than `assert` to avoid noisy error message.
If we are happy with this we should backport into |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
tasks/cli.yaml
Outdated
@@ -1,4 +1,14 @@ | |||
--- | |||
- name: read ansible_min_version from meta data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this go into a dedicated tasks/validate.yaml
which all other tasks
include?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slightly different pattern that makes this work a little more seamlessly within the roles. Take a look at the following two links:
https://github.com/ansible-network/arista_eos/blob/devel/tasks/load_config.yaml#L3
https://github.com/ansible-network/arista_eos/blob/devel/includes/init.yaml
The above pattern creates an init set of tasks where we can centrally handle all role validation instead of having to manage individual ones and make sure they are propagated to every role, every time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Build succeeded.
|
Build succeeded (gate pipeline).
|
At somepoint the Roles will use Ansible features that are only in certain releases, ensure that the end user is running the correct version of Ansible.
Read ansible_min_version from meta/main.yml and fail the playbook if
that version of Ansible (or higher) isn't being used.
Use
fail
, rather thanassert
to avoid noisy error message.Ansible 2.5
Ansible 2.6