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

use list of parameters for ansible conditions #36

Closed

Conversation

paulfantom
Copy link
Contributor

Reduce number of long lines by using list of conditions.

As per ansible docs:

Multiple conditions that all need to be true (a logical ‘and’) can also be specified as a list

To be consistent, lists are used everywhere where there is more than one condition

…internally identical to using logical 'and' operator
Copy link
Member

@tyll tyll left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM!

when: timesync_mode == 2 and timesync_mode2_hwts
when:
- timesync_mode == 2
- timesync_mode2_hwts
Copy link
Member

Choose a reason for hiding this comment

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

Is this really guaranteed to be identical? I am asking because Ansible handles bare variables specially. See ansible/ansible#39414 ansible/ansible#51030 ansible/ansible#60943

when: timesync_mode == 2 and timesync_mode2_hwts
when:
- timesync_mode == 2
- timesync_mode2_hwts
Copy link
Member

Choose a reason for hiding this comment

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

see above

vcrhonek added a commit to vcrhonek/timesync that referenced this pull request Sep 26, 2019
…le condition.

This is just comsetic followup to
linux-system-roles#36
with intention to make the role consistent.
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