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

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

Closed
HugoPoi opened this issue Aug 29, 2019 · 3 comments

Comments

@HugoPoi
Copy link

HugoPoi commented Aug 29, 2019

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'"}

- name: list redis binaries to add to alternatives
command: ls -1 {{ redis_install_dir }}/bin
register: redis_binaries
changed_when: false
- name: add redis binaries to alternatives
alternatives:
name: "{{ item }}"
path: "{{ redis_install_dir }}/bin/{{ item }}"
link: "/usr/bin/{{ item }}"
with_items: "{{ redis_binaries.stdout_lines }}"
when: redis_binaries is succeeded

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
Copy link
Author

HugoPoi commented Aug 31, 2019

After investigating a little more, this role doesn't handle well the check mode. I see #202 fix some stuff and go in the right direction I think.

@camjay
Copy link
Contributor

camjay commented May 14, 2021

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
Copy link
Owner

Closed by #264

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

No branches or pull requests

3 participants