2018-03-14 Ansible Playbook for Software NFS

Overview

Before I can install the Grid Infrastructure (GI) software, I need to mount the installation software via NFS as described in Use NFS for Oracle Software.

References

Procedure

Create Playbook

The playbook, oracle_software_src.yml, is created with the following:

--- - name: Mount NFS for Oracle Installation Software hosts: redfern1.yaocm.id.au become: yes tasks: - name: Install NFS Utilities Software yum: name: nfs-utils state: present - name: Create Mount Point for Oracle Installation Software file: path: /opt/share/Software state: directory - name: Mount NFS Share for Oracle Installation Software mount: path: /opt/share/Software src: narrabri.yaocm.id.au:/data/Software fstype: nfs4 opts: ro,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=4,timeo=600 state: mounted ...

Execute Playbook

The playbook, oracle_software_src.yml, is executed as follows (on AUBURN):

ansible-playbook --ask-become-pass oracle_software_src.yml

The output is:

SUDO password: PLAY [Mount NFS for Oracle Installation Software] ****************************** TASK [Gathering Facts] ********************************************************* ok: [redfern1.yaocm.id.au] TASK [Install NFS Utilities Software] ****************************************** ok: [redfern1.yaocm.id.au] TASK [Create Mount Point for Oracle Installation Software] ********************* changed: [redfern1.yaocm.id.au] TASK [Mount NFS Share for Oracle Installation Software] ************************ changed: [redfern1.yaocm.id.au] PLAY RECAP ********************************************************************* redfern1.yaocm.id.au : ok=4 changed=2 unreachable=0 failed=0

Verify Mount Point

On REDFERN1, I used the following command to see if the software directory was mounted correctly:

ls -l /opt/share/Software

The output is:

total 8754100 drwxrwxrwx. 1 douglas douglas 320 Dec 28 2016 database drwxrwxrwx. 1 douglas douglas 148 Dec 28 2016 grid drwxrwxrwx. 1 98 98 66 Dec 31 2015 OEM drwxrwxrwx. 1 98 98 128 Dec 28 2016 OPatch -rwxrwxrwx. 1 nobody nobody 561949274 Jul 28 2013 OVM_OL6U4_X86_64_12101DBRAC_PVM-1of2.tbz -rwxrwxrwx. 1 nobody nobody 4152969835 Jul 28 2013 OVM_OL6U4_X86_64_12101DBRAC_PVM-2of2.tbz -rw-rw-r--. 1 douglas douglas 364154996 Oct 18 19:38 sqldeveloper-17.3.1.279.0537-1.noarch.rpm -rw-rw-rw-. 1 98 98 3885117440 Jan 3 2014 V41362-01.iso

Verify Playbook is Idempotent

The playbook, oracle_software_src.yml, is executed as follows (on AUBURN):

ansible-playbook --ask-become-pass oracle_software_src.yml

The output is:

SUDO password: PLAY [Mount NFS for Oracle Installation Software] ****************************** TASK [Gathering Facts] ********************************************************* ok: [redfern1.yaocm.id.au] TASK [Install NFS Utilities Software] ****************************************** ok: [redfern1.yaocm.id.au] TASK [Create Mount Point for Oracle Installation Software] ********************* ok: [redfern1.yaocm.id.au] TASK [Mount NFS Share for Oracle Installation Software] ************************ ok: [redfern1.yaocm.id.au] PLAY RECAP ********************************************************************* redfern1.yaocm.id.au : ok=4 changed=0 unreachable=0 failed=0

Because all tasks are green, the playbook is idempotent.