Cloning Oracle grid infrastructure using Ansible

Sometimes your organization may decide to move to new hardware, to new data center and you, as an Oracle DBA, would need to be involved in preparation and configuration of new servers at new location. It is very often that such rare opportunity can be considered as possibility to upgrade OS, Grid infrastructure, standardize environment. If there are several servers and a lot of time for preparation and execution it can be done manually without any automation. However it is a rare case and if you are dealing with dozens of servers and timeline is strict then you need to plan and automate routine tasks which you would perform for new installations. Ansible is a great tool for it. It connects to servers and simplifies routine tasks with great flexibility and enhancement allowing to code different conditions. My colleague
Fred Denis already blogged about it recently
here and you can see it is a tool that's very easy to manage. So certainly it can be a good choice to simplify and repeat routine DBA tasks like cloning of oracle software during preparation for the migration to new environment. Considering the case I described before, it's likely that there are system administrators in the organization who would perform OS installation for you and might even perform prerequisites such as installing packages, changing kernel parameters, etc. There is high chance they use automation tools like Chef, Puppet, etc. even Ansible, but can be busy with other tasks. You also definitely want to keep something for yourself and shine as well to see how easy and quick an environment can be configured when it is automated. Going further close to the task, let’s automate Grid Infrastructure 12.1 cloning for standalone server configured with ASM. Ansible operates by tasks, so software cloning can be presented as list of actions:
- Copy (make available) prepared a clone image to a new server
- Unpack the image
- Perform clone operation
- Execute root.sh
- Configure Grid Infrastructure
- Configure disk devices
- Configure listener
- Configure ASM
- Create disk group