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

Setting redis_port other than 6379 with variable results in an error #150

Open
kimamula opened this issue Feb 22, 2017 · 5 comments
Open

Comments

@kimamula
Copy link

kimamula commented Feb 22, 2017

Using ansible 2.2.1.0.

While the following playbook works,

- name: Redis master
  hosts: redis-master
  vars:
    redis_port: 6389
  roles:
    - role: DavidWittman.redis

the next one results in an error, saying ERROR! The requested handler 'restart redis 6389' was not found in either the main handlers list nor in the listening handlers list while executing the create redis config file task.

- name: Redis master
  hosts: redis-master
  vars:
    redis_port: "{{ redis_master_port }}" # redis_master_port is set to be 6389 in group_vars
  roles:
    - role: DavidWittman.redis

Also note that the second playbook succeeds if the redis_master_port variable is set to be 6379.

Any idea?

@DavidWittman
Copy link
Owner

That's... strange. This seems like an Ansible bug. I was able to reproduce it on all the versions which this role supports. I'll have to find some time to look more closely at this unless you've since found a resolution.

@oolongtea
Copy link

I ran into a similar issue where the redis_sentinel boolean set in the playbook's vars section wasn't being picked up by the DavidWittman.redis role.

I also tried moving any variables from group_vars or host_vars directly into the role similar to this:
- { role: Community/DavidWittman.redis, redis_sentinel: true, redis_sentinel_port: 26379 }

I downgraded from Ansible 2.2.1.0 to 2.1.4.0 as a workaround.

@brad
Copy link

brad commented Apr 17, 2017

Also running into this error. When I specify the variable as part of the role item, it fails even when the port is 6379:

- name: Redis master
  hosts: redis-master
  roles:
    - role: DavidWittman.redis
      redis_port: "{{ redis_master_port }}"

@dsemba
Copy link

dsemba commented May 17, 2017

I've managed to get rid of the error when I changed handlers/main.yml file from this:

 ---
 - name: "restart redis {{ redis_port }}"
   service:
     name: "{{ redis_service_name }}"
     state: restarted
   when: redis_as_service

to:

 ---
 - name: "restart redis {{ redis_port }}"
   service:
     name: redis_{{ redis_port }}
     state: restarted
   when: redis_as_service

@nikathone
Copy link

nikathone commented Apr 7, 2018

Was having RUNNING HANDLER [DavidWittman.redis : restart redis {{ redis_port }}] ********** fatal: [192.168.33.10]: FAILED! => {"changed": false, "failed": true, "msg": "Unable to restart service redis_6379: Failed to restart redis_6379.service: Interactive authentication required.\nSee system logs and 'systemctl status redis_6379.service' for details.\n"}
and I got rid of the error by making the change as suggested above.

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

6 participants