issues with task not working

22 views
Skip to first unread message

Frank Dias

unread,
Aug 26, 2017, 10:50:42 PM8/26/17
to Ansible Project
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
# run only on one node



benno joy

unread,
Aug 27, 2017, 4:12:16 AM8/27/17
to ansible...@googlegroups.com
would be helpful if you could run the playbook in verbose "-vvv" and
paste an output so we know what is not working and why it is not
working.
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f75a7af2-8180-4053-b477-5c40459b25e7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Frank Dias

unread,
Aug 27, 2017, 5:03:19 PM8/27/17
to Ansible Project
I am work with 


if I use centos 7 minimal install, it works mostly a few bugs.

but if I try with centos6 minimal install , need to add libselinux-python to installation.
i am stuck with failures in the task postgresql_sync.yml , from what I am seeing it installs the pkgs but does not execute task on host declared in  postgres_ha_cluster_master_host variable.

I would not think that there would be this much behavioral change in the role between OS version.

currently our env is centos6 and plans are not set for when to go to centos7 as of yet 
Reply all
Reply to author
Forward
0 new messages