I try to automate MongoDB installation with Ansible, but i can’t create a replica set members automatically.
I want to get automatically 3 host’s hostnames and add to members. I tried to use setup module and with ansible_hostname and registered to variables but I failed.
Thanks in advance
name: get hostname
setup:
filter: ansible_hostname
I try to automate MongoDB installation with Ansible, but i can't create a replica set members automatically.
I want to get automatically 3 host's hostnames and add to members. I tried to use setup module and with ansible_hostname
and registered to variables but I failed.
Thanks in advance
Hello Azir,
it is unclear to me where these hostnames are coming from. And as far as I know you can only register one variable with
register: