Sunday, March 04, 2018

Ansible Nested With_Items in Debug module

Use srvctl to list and display all Oracle DB instance status on the host

tasks:
   - name: display databases in the GI via srvctl
     shell: /u01/app/11.2.0.4/grid/bin/srvctl config database
     register: dblist
   - debug: msg="{{ dblist.stdout_lines }}"

   - name: display status of databases in the GI via srvctl
     shell:  /u01/app/11.2.0.4/grid/bin/srvctl status database -d  "{{ item }}"
     register: dbstatus
     with_items:
        - "{{ dblist.stdout_lines }}"
   - debug: msg="{{ item.stdout_lines }}"
     with_items:
        - "{{ dbstatus.results }}"

No comments: