Deploying Oracle GoldenGate 21c with Ansible

        Fame

        Deploying Oracle GoldenGate 21c with Ansible

        Ansible has become a standard configuration tool for many enterprises and is used is many CI/CD pipelines to build standard implementations with the organizations.  Ansible is a very powerful tool that leveraged secure shell (ssh) to make connect to target hosts and push to the modules needed to build the platform.  Like any tool, Ansible is very flexible and lends itself to the usage of the user.  Software packages like Oracle Database and Oracle GoldenGate can be baked into playbooks providing a standard installation process.

        With the latest release of Oracle GoldenGate 21c, RheoData has built a standard template that allows its consultants to quickly build Oracle GoldenGate 21c into any environment.  This blog post, we will look at the playbook and see how Oracle GoldenGate 21c is installed on a Linux host.

        Variable File

        The first thing that has to be defined is the variables that are going to be used within playbook.  There are different ways of defining variables, but for simplify we used the sub-folder structure (defaults) which house the file main.yml.  Within this main.yml file, all variables needed are defined.  Below is the current consturct of our variables file:

        stage_dir: /opt/software/
        stage_ogg: /opt/software/ogg19cma
        oracle_base: /opt/app/oracle
        oracle_inventory: /opt/app/oraInventory
        oracle_home_client: /opt/app/oracle/product/client
        ogg_home: /opt/app/oracle/product/19.1.0/oggcore_21c
        ogg_deployment_home: /opt/app/oracle/gg_deployment
        ora_group: oinstall
        oracle_user: oracle
        root_user: root
        ggsoft19c_rsp: oggcore_21c.rsp
        installation: Oracle GoldenGate

        zip_files: /Users/bocurtis/Build_Software/zip_files/
        response_files: /Users/bocurtis/Build_Software/response_files/
        script_files: /Users/bocurtis/Build_Software/scripts/

        oracle_client_lite_19c: instantclient-basiclite-linux.x64-19.5.0.0.0dbru.zip
        oracle_client_lite_18c: instantclient-basiclite-linux.x64-18.5.0.0.0dbru.zip
        oracle_client_12c: instantclient-basic-linux.x64-12.2.0.1.0.zip
        gg_services_software: 213000_fbo_ggs_Linux_x64_services_shiphome.zip

        set_passwords: set_passwd.sh
        self_sign: ggSelfSignCerts.py
        nginx_setup: configureNginx.sh
        sm_start: startServiceManager.sh
        sm_stop: stopServiceManager.sh

        As you review the list of variables that are needed for installing Oracle GoldenGate 21c (above), notice that some of these variables reference scripts that can be used to make managing Oracle GoldenGate 21c a bit easier.  These scripts do not come with Oracle GoldenGate 21c.

        Tasks

        With the variables defined, the next thing to do is define the tasks that must be done in order to install Oracle GoldenGate 21c.  Just like the variables file, the tasks are provided in a sub-folder structure (tasks).  Within this folder, we only needed another main.yml file, but for step purposes we broke the tasks down further.  With the current tasks, we have a main.yml, copy.yml, and install.yml.  These three file cover all the steps needed to install Oracle GoldenGate 21c within a single host.  Lets take a look at these now:

        main.yml

        The main.yml file for Tasks, is the main file that will drive all of the installation.  This file uses all variables that was defined earlier.

        ---
        - name: Display Pre-Install Message
        remote_user: ""
        become: yes
        debug:
        msg:
        - ' Installation started at :'
        - name: Update RPM Packages
        remote_user: ""
        become: yes
        yum:
        name: "*"
        state: latest
        - name: Install Oracle Pre-Requistes
        remote_user: ""
        become: yes
        yum:
        name: oracle-database-preinstall-19c
        state: latest
        - name: Create required directories
        remote_user: ""
        become: yes
        file: path="{{item}}" state=directory owner="" group="" mode=0755
        with_items:
        - ""
        - ""
        - ""
        - ""
        - ""
        - ""
        - ""
        - ""
        tags:
        - ogg19c_directories
        - name: tasks/copy.yaml instead of 'main'
        import_role:
        name: gg19cSetup
        tasks_from: copy
        - name: tasks/install.yaml instead of 'main'
        import_role:
        name: gg19cSetup
        tasks_from: install
        - name: Display Post-Install Message
        remote_user: ""
        become: yes
        debug:
        msg:
        - ' Installation finished at :'
        ...
        copy.yml

        The copy task is called from the main.yml file and used to copy the needed binaries and files to the target host.  At the same time set the permissions needed on these files.

        ---
        - name: Coping required files
        remote_user: ""
        become: yes
        copy:
        src: "{{item}}"
        dest: ""
        owner: ""
        group: ""
        mode: 0555
        with_items:
        - ""
        - ""
        - ""
        - ""
        - ""
        - ""
        - ""
        - ""
        - ""
        - ""
        ...
        install.yml

        The install task is called from the main.yml file and begins to perform the install Oracle GoldenGate 21c.  The task does everything from unzipping the Oracle Client libraries and Oracle GoldenGate 21c, through configuring the .bashrc environment.

        ---
        - name: Unzipping/Installing Oracle Database Client 19c
        remote_user: ""
        become: yes
        become_user: ""
        unarchive:
        src: ""
        dest: ""
        extra_opts: 
        - --j
        remote_src: true
        - name: Unzipping/Installing Oracle Database Client 18c
        remote_user: ""
        become: yes
        become_user: ""
        unarchive:
        src: ""
        dest: ""
        extra_opts:
        - --j
        remote_src: true
        - name: Unzipping Oracle GoldenGate 21c
        remote_user: ""
        become: yes
        become_user: ""
        unarchive:
        src: ""
        dest: ""
        remote_src: true
        - name: Installing Oracle GoldenGate 21c for Oracle Database 21c
        remote_user: ""
        become: yes
        become_user: ""
        shell: 
        cmd: "/fbo_ggs_Linux_x64_services_shiphome/Disk1/runInstaller -silent -showProgress -ignoreSysPrereqs -waitForCompletion -responseFile  >> /tmp/ggInstall.log"
        ignore_errors: true
        - name: Running root script
        remote_user: ""
        become: yes
        shell:
        cmd: /opt/app/oraInventory/orainstRoot.sh >> /tmp/ggInstall.log
        - name: Setting Passwords
        remote_user: ""
        become: yes
        shell:
        cmd: ""
        - name: Setting .bashrc
        remote_user: ""
        become: yes
        blockinfile:
        dest: /home/oracle/.bashrc
        block: |
        export OGG_HOME=
        export ORACLE_HOME=
        export ORACLE_BASE=
        export LD_LIBRARY_PATH=/lib
        export PATH=$OGG_HOME/bin:$LD_LIBRARY_PATH:$PATH
        insertbefore: BOF
        create: yes
        backup: no
        ...

        Once the playbook is done, a fully functioning Oracle GoldenGate 21 environment is installed and ready to use.  Aft this point, other Oracle GoldenGate 21c components can be created using either the command line (AdminClient), the HTML pages, or REST api.

        Summary

        Through this post, we were showing you how you can use Ansible to install Oracle GoldenGate 21c.  Using this process, Oracle GoldenGate 21c can be installed on any platform in an automated fashion.

        Recent posts

        Related Posts

        Oracle GoldenGate Response Files: Understanding the Evolution from 12c to 23ai

        Clear Objectives. Team Success.

        If you’ve been deploying Oracle GoldenGate using response files...

        Read more

        Replicating PostgreSQL data using Oracle GoldenGate

        Something that has been brewing for years – since late 2017 – is the constant request from Oracle...

        Read more

        Silent install for Oracle GoldenGate 21c (Big Data – Microservices edition) – Step 1 of 2

        Been awhile since I did a post on installing Oracle GoldenGate. The last post I did was back in...

        Read more