postgresql - ansible using passed in variable in a task's when clause -
my latest playbook designed setup postgresql streaming replica database primary database. works except handful of tasks need variable decide if need run or not.
my ansible-playbook command:
ansible-playbook -v -i environments/sandbox replica.yaml -e "primary_server=server-a replica=sync"
i'm trying use replica
variable in when clause. i've tried couple of different attempts , when looks like:
when: - inventory_hostname == primary_server - replica == "sync"
that doesn't seem working though that's how described in documentation. should note first item in when clause working, not replica == "sync"
clause.
any ideas, jay
Comments
Post a Comment