-
Notifications
You must be signed in to change notification settings - Fork 92
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
Improved tasks and tests layout #25
Conversation
molecule/alternative/playbook.yml
Outdated
@@ -12,3 +10,5 @@ | |||
- "/srv/data2" | |||
- "/srv/data3" | |||
- "/srv/data4" | |||
roles: |
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.
Why swap order of roles
and vars
? This is a dict/map so from program point of view it doesn't change anything so we can only take an ease of code reading in account. Considering that roles
key won't increase in size, but vars
can, it would be better to have roles
before vars
as this won't cause problems in reading complex vars
entries and simplify addition of new entries to this file.
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.
The reason is that usually the vars refers to the declared roles. I think visually it's better to have the vars declared before the roles.
But I swapped them back in 2de48ef
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.
Yeah, it is usually a matter of personal preference and usually with such things I look what guys from OpenStack-Ansible use since they have more written guidelines than ansible itself. In this case they use vars
after roles
, like here: https://github.com/openstack/openstack-ansible/blob/master/playbooks/infra-journal-remote.yml
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.
Indeed :)
'minio_server_bin', | ||
'minio_client_bin', | ||
]) | ||
def test_minio_installed(host, AnsibleDefaults, minio_bin_var): |
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.
Why not put this in test_minio_common.py
?
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.
Because otherwise that would be tested in every scenario.
The idea is to test it once, in the default scenario, and eventually add the proper tests if we decide to override the default values for the minio_server_bin
and minio_client_bin
variables.
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 am not very fond of this solution, but it is ok 👍
This PR: