And got error “Unrecognized option or bad number of args for: ‘–user admin’” which is a redis-cli error.
After some experimenting I found out that if I pass the variables in a separate line some of them work. So this task works and returns info about server.
name: Get server info
ansible.builtin.command:
argv:
/usr/bin/redis-cli
–user
“{{ redis_admin_user }}”
–pass
“{{ redis_admin_password }}”
info
So the username and password are recognized be redis-cli, but, unfortunately not the “redis_cluster_members”. The following task:
name: Create Redis cluster
ansible.builtin.command:
argv:
/usr/bin/redis-cli
–user
“{{ redis_admin_user }}”
–pass
“{{ redis_admin_password }}”
–cluster create
“{{ redis_cluster_members }}”
–cluster-replicas
“{{ redis_cluster_replicas }}”
–cluster-yes
returns error “Unrecognized option or bad number of args for: ‘–cluster create’”
I wonder if I’m missing some syntax error or misread the documentation and trying to use argv not the way it’s supposed to be used?
So I did a workaround constructing the command as a variable in vars/main.yml and then passing it to the module (I’m going to post it on stackoverflow).
четверг, 9 февраля 2023 г. в 17:06:24 UTC+3, Rowe, Walter P. (Fed):