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

[DO NOT MERGE] Show CI failure #77

Closed
wants to merge 1 commit into from
Closed

[DO NOT MERGE] Show CI failure #77

wants to merge 1 commit into from

Conversation

lucafavatella
Copy link
Contributor

No description provided.

@lucafavatella
Copy link
Contributor Author

Travis CI fails on branch develop (this PR has no changes from develop):

TASK [ansible-riak : install riak_shell.config with templated configuration] ***

fatal: [riak-test]: FAILED! => {"failed": true, "msg": "The conditional check 'riak_package == \"riak-ts\" and riak_shell_nodes is defined' failed. The error was: error while evaluating conditional (riak_package == \"riak-ts\" and riak_shell_nodes is defined): {{ riak_shell_nodes_list.split() }}: {% for host in groups[riak_shell_group] %}riak@{{ hostvars[host][riak_shell_interface]['ipv4']['address'] }} {% endfor %}: 'dict object' has no attribute u'riak'\n\nThe error appears to have been in '/home/travis/build/basho-labs/ansible-riak/tasks/main.yml': line 40, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: install riak_shell.config with templated configuration\n  ^ here\n"}

@lucafavatella lucafavatella changed the title [WIP] Empty commit in order to create PR showing CI failure [DO NOT MERGE] Empty commit in order to create PR showing CI failure Mar 29, 2017
@lucafavatella lucafavatella changed the title [DO NOT MERGE] Empty commit in order to create PR showing CI failure [DO NOT MERGE] Show CI failure Mar 29, 2017
@lucafavatella
Copy link
Contributor Author

I have same issue in my development and staging scripts :(

@lucafavatella
Copy link
Contributor Author

It may be a minor syntax change in Ansible 2.2.2.0 as compared to 2.2.1.0.

@lucafavatella
Copy link
Contributor Author

lucafavatella commented Apr 6, 2017

@lucafavatella
Copy link
Contributor Author

I see the test places riak-test in /etc/ansible/hosts. And this bit did not change in the test recently.
I see the test does not override the default riak_shell_group: 'riak'. And this bit did not change in the test recently.

So I see two explanations:

  • Ansible 2.2.2.0 changed from 2.2.1.0 the "short-circuitness" semantics of and; or
  • Ansible 2.2.2.0 changed from 2.2.1.0 the behaviour when a dict is looked up by an inexistent key (as ingroups[riak_shell_group]) - at least in a for template loop.

@lucafavatella
Copy link
Contributor Author

So I see two explanations:

Ansible 2.2.2.0 changed from 2.2.1.0 the "short-circuitness" semantics of and; or
Ansible 2.2.2.0 changed from 2.2.1.0 the behaviour when a dict is looked up by an inexistent key (as ingroups[riak_shell_group]) - at least in a for template loop.

Regardless of the explanation, I am attempting the following patch

 -riak_shell_nodes_list: "{% for host in groups[riak_shell_group] %}riak@{{ hostvars[host][riak_shell_interface]['ipv4']['address'] }} {% endfor %}"
 +riak_shell_nodes_list: "{% for host in groups[riak_shell_group]|default([]) %}riak@{{ hostvars[host][riak_shell_interface]['ipv4']['address'] }} {% endfor %}"

mainly based on https://stackoverflow.com/questions/28885184/default-value-for-dictionary-in-jinja2-ansible#28885760

@lucafavatella
Copy link
Contributor Author

Looks working, preparing PR.

@lucafavatella
Copy link
Contributor Author

PR #78 fixes this.

@lucafavatella lucafavatella deleted the ci-fails branch April 6, 2017 15:20
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.

None yet

1 participant