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 Ansible linting under Ansible 2.x #757

Merged
merged 1 commit into from
Feb 12, 2016
Merged

Add Ansible linting under Ansible 2.x #757

merged 1 commit into from
Feb 12, 2016

Conversation

nrb
Copy link
Contributor

@nrb nrb commented Jan 19, 2016

This commit adds a new tox environment for linting playbooks and roles
against Ansible 2.x. It also modifies the linting-ansible.sh script so
that it is compatible with both the 1.x and 2.x series.

This commit is not intended to provide full Ansible 2.x support. Rather,
it is to serve as an early warning system so that the playbooks and
roles aren't written in an incompatible manner prior to actually
switching.

Fixes: #754

@sigmavirus24
Copy link
Contributor

👍

@d34dh0r53
Copy link
Contributor

Rebase please


[testenv:ansible2-lint]
commands =
{toxinidir}/scripts/linting-ansible.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be (more simply)

commands = {[testenv:ansible2-lint]commands}

That way if one of them changes, they both change automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that's worth doing.

@sigmavirus24
Copy link
Contributor

I'm 👍 once the gate passes

@nrb
Copy link
Contributor Author

nrb commented Feb 9, 2016

Added one last change, and I think I'm satisfied now. I marked the job as an ignored failure so travis won't make the build red just because of an ansible 2.0 linting error.

@sigmavirus24
Copy link
Contributor

I'm +0 on allowing ansible 2.0 to fail. If we already have compatibility we should just enforce it. I don't see a downside to not enforcing it.

@claco
Copy link
Contributor

claco commented Feb 9, 2016

I agree with @sigmavirus24. If we're already achieved it, and that's where we're going, let's enforce now. WE can always shut it off in the rare circumstance we must do something in 1.9 in a 2.x incompatible way.

This commit adds a new tox environment for linting playbooks and roles
against Ansible 2.x. It also modifies the linting-ansible.sh script so
that it is compatible with both the 1.x and 2.x series.

To support easy removal of the job in the future, the version of ansible used
is implemented as an environment variable that is substituted by tox. Thus,
making ansible 2.x the default in the future is as simple as removing
the line in .travis.yml that sets the environment variable to >=2.0 and
updating the default value on the requirement in tox.ini.

Also, the requirements files were changed from referencing the
openstack-ansible submodule to using the test-requirements.txt file
in-tree.

This commit is not intended to provide full Ansible 2.x support. Rather,
it is to serve as an early warning system so that the playbooks and
roles aren't written in an incompatible manner prior to actually
switching.

Fixes: #754
@nrb
Copy link
Contributor Author

nrb commented Feb 10, 2016

Fair enough. I've pushed new changes that keep the ansible 2 job voting based on feedback.

@sigmavirus24
Copy link
Contributor

👍 I somehow doubt that the ceph failure is related to this.

@prometheanfire
Copy link
Contributor

recheck

tests must pass, no exceptions

@hughsaunders
Copy link
Contributor

recheck - failed on tempest/neutronportnotfound

@prometheanfire
Copy link
Contributor

yay, tests passed

👍

prometheanfire added a commit that referenced this pull request Feb 12, 2016
Add Ansible linting under Ansible 2.x
@prometheanfire prometheanfire merged commit c8be047 into rcbops:master Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants