why does this not work?
this is my play;
- name: install PG HA
hosts: dbs6
gather_facts: True
any_errors_fatal: True
vars:
postgres_ha_cluster_master_host: dbs03.prodea-int.net
postgres_ha_cluster_vip: 172.24.2.241
postgres_ha_pg_repl_pass: Pr0d3aDdbsRep
postgres_ha_cluster_ha_password: Pr0d3aOps
postgres_ha_cluster_ha_password_hash: ‘$6$random_salt$oOZNTHqP.FhvKCx80X61rfbB3evBPVlnGYxcjJi82gNSLbJY3hNaMipUpNdVBGnFz1uy1UuwWZ0Mcmq/j04c2.’
pre_tasks: - name: disable firewall
service: name=iptables state=stopped enabled=no
roles: - postgres-ha6
in the role I have several task that i want performed on specific host and that host is define as variable
- name: init DB dir on master if necessary
shell: ‘{{ postgres_ha_pg_bindir }}/pg_ctl initdb’
become: yes
become_user: postgres
args:
creates: “{{ postgres_ha_pg_data }}/PG_VERSION”
when: inventory_hostname == postgres_ha_cluster_master_host