Oracle DBA - Automation with Ansible (Setup ASM Cloud File System Oracle 18c )


Oracle DBA - Automation with Ansible (Setup ASM Cloud File System Oracle 18c )


I am running running playbook "racdatabase.yml" which has enabled role "racdb_acfs" - to create ACFS.


Tree structure for this  role "racdb_acfs"

Variables for this role are as below -

Running Playbook with step option




Playbook for this role is as below:
[root@oel75 roles]# cat racdb_acfs/tasks/main.yml
---

- name: List Current ASM diskgroups for ACFS
  become_user: "{{ superuser }}"
  action: shell export GRID_HOME={{ grid_home }}; {{ grid_home }}/bin/srvctl status diskgroup -g {{ acfsdiskgroup }}
  tags: acfs

- name: ACFS/ADVM modules installation
  action: shell export GRID_HOME={{ grid_home }}; {{ grid_home }}/bin/acfsroot install

- name: Start ACFS modules
  become_user: "{{ superuser }}"
  action: shell export GRID_HOME={{ grid_home }}; {{ grid_home }}/bin/acfsload start
  tags: acfs

- name: Create an ASM volume for ACFS on first node with Name and Size
  when: inventory_hostname in groups['racdb01']
  become: yes
  become_user: "{{ grid_user }}"
  become_method: su
  action: shell export GRID_HOME={{ grid_home }}; {{ grid_home }}/bin/asmcmd volcreate -G {{ acfsdiskgroup }} -s {{ acfs_vol_size }} {{ acfs_vol_name }}
  tags: acfs

- name: Determine the device name of the volume that was created
  become: yes
  become_user: "{{ grid_user }}"
  become_method: su
  action: shell export GRID_HOME={{ grid_home }}; {{ grid_home }}/bin/asmcmd volinfo -G {{ asm_dg_name }} {{ acfs_vol_name }} | grep Device | sed 's/.*://'
  register: device_name
  tags: acfs

- name: Create a file system with the Oracle ACFS mkfs command
  become_user: "{{ superuser }}"
  shell: "/sbin/mkfs -t acfs {{ device_name.stdout}}"
  tags: acfs

- name: Create mount point directory to hold the volume
  action: file dest="{{ acfs_mount_name }}" state=directory owner="{{ oracle_user }}" group="{{ grid_group }}" mode=0755
  ignore_errors: True

- name: ACFS autostart setup
  become_user: "{{ superuser }}"
  when: inventory_hostname in groups['racdb01']
  action: shell export GRID_HOME={{ grid_home }}; {{ grid_home }}/bin/srvctl add filesystem -d {{ device_name.stdout }} -m {{ acfs_mount_name }} -u {{ oracle_user }} -fstype {{ acfsdiskgroup }}  -autostart {{ autostarttype }}
  tags: acfs
#N  ignore_errors: True

- name: ACFS status
  become_user: "{{ superuser }}"
  action: shell export GRID_HOME={{ grid_home }}; {{ grid_home }}/bin/srvctl status filesystem -d {{ device_name.stdout }}
  ignore_errors: True

Comments

Popular posts from this blog

Oracle DataGuard – How to resize Redo Log and Standby Redo Log

Exadata - Smart Scan Testing

Exadata Flash Cache - Management