To check Oracle primary-standby database configuration via ansible playbook, you can use playbook as explained in “Ansible – Oracle : How to check Oracle Primary – Standby (dgmgrl) sync status with Ansible

 

———————————————————————-

Ansible Playbook to check Oracle Primary – Standby (dgmgrl) configuration

 

 

– name: ” Execute dgmgrl show configuration command”
shell: runuser -l “{{ora_user}}” -c “dgmgrl / ‘show configuration’ |grep ‘database’ | awk -F- ‘{print \$1 }’ ”
register: dgmgrl_conf

– debug:
msg: “{{ dgmgrl_conf }}”

– set_fact:
db_list: “{{ dgmgrl_conf.stdout_lines|map(‘trim’)|list }}”
when: dgmgrl_conf.rc == 0|int

– debug:
var: db_list

– set_fact”
primarydb: “{{ db_list.0 }}”
standbydb: “{{ db_list.1 }}”
– debug:
msg: “{{ Primary database – {{ primarydb }}, Standby database – {{ standbydb }} “

Ansible – Oracle : How to check Oracle Primary – Standby (dgmgrl) configuration with Ansible
Tagged on: