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

Comments

@kimamula
Copy link

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

This comment has been minimized.

Copy link
Owner

commented Mar 9, 2017

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

This comment has been minimized.

Copy link

commented Mar 20, 2017

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

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
Projects
None yet
6 participants
You can’t perform that action at this time.