DavidWittman / ansible-redis

Highly-configurable Ansible role to install Redis and Redis Sentinel from source
MIT License
663 stars 288 forks source link

Check mode is broken, add redis binaries to alternatives fail no attribute stdout_lines #223

Closed HugoPoi closed 3 years ago

HugoPoi commented 5 years ago

With Ansible version 2.8.4 in check mode the task add redis binaries to alternatives failed with a 'dict object' has no attribute 'stdout_lines'.

TASK [DavidWittman.redis : list redis binaries to add to alternatives] *********
skipping: [dev] => {"changed": false, "msg": "skipped, running in check mode"}
TASK [DavidWittman.redis : add redis binaries to alternatives] *****************
fatal: [dev]: FAILED! => {"msg": "'dict object' has no attribute 'stdout_lines'"}

https://github.com/DavidWittman/ansible-redis/blob/98bef17f323438dec378527e459e7fd72d27e31f/tasks/install.yml#L63-L74

I think the task list redis binaries to add to alternatives can have check_mode: no because it's read-only stuff. And a | default([]) in the with_items.

HugoPoi commented 5 years ago

After investigating a little more, this role doesn't handle well the check mode. I see https://github.com/DavidWittman/ansible-redis/pull/202 fix some stuff and go in the right direction I think.

camjay commented 3 years ago

I addressed this specific issue in #264 which has been merged.

If you use the current master version by adding this to your requirements you should find this is resolved:

  - src: https://github.com/DavidWittman/ansible-redis
    version: 'b1edec047232c3f226677fb89a0bbdc4670701fa'
    name: davidwittman.redis
DavidWittman commented 3 years ago

Closed by #264