Skip to content

Commit

Permalink
Bump Ansible version_tested_max to 2.4.3.0 (#945)
Browse files Browse the repository at this point in the history
Also fix `replace_item_with_key()` custom output method to handle
tasks that use `with_dict` and `no_log`. Prevents errors such as:
 [WARNING]: Failure using method (v2_runner_item_on_skipped) in callback plugin
(<ansible.plugins.callback.output.CallbackModule object at 0x7f9cd2039150>):
'item'
  • Loading branch information
fullyint authored Feb 1, 2018
1 parent a48c0c5 commit c8515b3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### HEAD
* Bump Ansible `version_tested_max` to 2.4.3.0 ([#945](https://github.com/roots/trellis/pull/945))
* Update wp-cli to 1.5.0 ([#944](https://github.com/roots/trellis/pull/944))
* Update `vagrant_box_version` to `>= 201801.02.0` ([#939](https://github.com/roots/trellis/pull/939))
* Bump Ansible `version_tested_max` to 2.4.2.0 ([#932](https://github.com/roots/trellis/pull/932))
Expand Down
2 changes: 1 addition & 1 deletion lib/trellis/plugins/vars/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
display = Display()

version_requirement = '2.4.0.0'
version_tested_max = '2.4.2.0'
version_tested_max = '2.4.3.0'

if not ge(LooseVersion(__version__), LooseVersion(version_requirement)):
raise AnsibleError(('Trellis no longer supports Ansible {}.\n'
Expand Down
10 changes: 8 additions & 2 deletions lib/trellis/utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ def reset_task_info(obj, task=None):

# Display dict key only, instead of full json dump
def replace_item_with_key(obj, result):
if not obj._display.verbosity and 'label' not in result._task._ds.get('loop_control', {}):
item = '_ansible_item_label' if '_ansible_item_label' in result._result else 'item'
item = '_ansible_item_label' if '_ansible_item_label' in result._result else 'item'
should_replace = (
not obj._display.verbosity
and 'label' not in result._task._ds.get('loop_control', {})
and item in result._result
)

if should_replace:
if 'key' in result._result[item]:
result._result[item] = result._result[item]['key']
elif type(result._result[item]) is dict:
Expand Down
2 changes: 1 addition & 1 deletion vagrant.default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ vagrant_cpus: 1
vagrant_memory: 1024 # in MB
vagrant_box: 'bento/ubuntu-16.04'
vagrant_box_version: '>= 201801.02.0'
vagrant_ansible_version: '2.4.2.0'
vagrant_ansible_version: '2.4.3.0'
vagrant_skip_galaxy: false

vagrant_install_plugins: true
Expand Down

0 comments on commit c8515b3

Please sign in to comment.