This document is currently work in progress!
Breaking Change in July 2022 for ansible
and dbfs161
vagrant box. The boxes were renamed and require a local destory+up.
Ansible 2.9 has incomplete support for Collections.
IMPORTANT: The following steps are only needed, when working with Ansible 2.9.
Please execute install_ansible.sh
once, when developing for ansible-oracle
is planned.
That will install anbsible-lint
and git pre-commit
, who are mandatory for a Pull-Request.
Ansible is started inside a Container. There is no local installation of Ansible in the OS anymore. This allows an easy change between different versions of Ansible.
The Container is started with the following command:
IMPORTANT:
ansible-oracle
is tested with Ansible 2.9-2.12 at the moment.
./ansible.sh
There is a really nice offline downloader:
Due to license restriction, the tool could not be part of this repository. Download it with wget:
wget https://github.com/MarisElsins/getMOSPatch/raw/master/getMOSPatch.jar
Java from openJDK 11 could be used.
Please read the documentation for more details:
Download latest version of AHF for Linux-x86_64
java -jar getMOSPatch.jar MOSUser=<MOS-Login> platform=226P download=all patch=30166242
Download latest version of OPatch for Linux-x86_64. You get asked for the file to download. download=all will download all versions.
java -jar getMOSPatch.jar MOSUser=<MOS-Login> platform=226P patch=6880880
Inventory variable in Ansible:
oracle_stage_remote: /sw/oracle/linux64
The following examples are based on the directory /sw/oracle/linux64
The zip archives for the installation media or Golden-Images areexpected in the upper most directory:
/sw/oracle/linux64/LINUX.X64_193000_db_home.zip /sw/oracle/linux64/LINUX.X64_193000_grid_home.zip /sw/oracle/linux64/db_home_19.11.zip /sw/oracle/linux64/linuxx64_12201_database.zip
The OPatch archive is searched in same directory as the medias:
/sw/oracle/linux64/p6880880_190000_Linux-x86-64.zip
Name | IP | Description |
---|---|---|
dbfs161 |
192.168.56.161 |
Oracle DB 19c |
Name | IP | Description |
---|---|---|
has19c-162 |
192.168.56.162 |
Oracle Restart 19c + DB 19c |
has21c-163 |
192.168.56.163 |
Oracle Restart 21c + DB 21c |
ansible-playbook -i inventory/has/hosts.yml -e hostgroup=has19c playbooks/os_vagrant.yml playbooks/single-instance-asm.yml
Boxname | Cores | RAM | DNS | IP | VIP | Interconnect | Description |
---|---|---|---|---|---|---|---|
collabn1 |
2 |
7GB |
collabn1-192-168-56-171.nip.io |
192.168.56.171 |
192.168.56.181 |
192.168.57.171 |
OracleLinux 7.x + Grid-Infrastructure 19c + DB 19c |
collabn2 |
2 |
7GB |
collabn1-192-168-56-171.nip.io |
192.168.56.172 |
192.168.56.182 |
192.168.57.172 |
OracleLinux 7.x + Grid-Infrastructure 19c + DB 19c |
SCAN | IP |
---|---|
scan-192-168-56-171.nip.io |
192.168.56.171 |
The installation media and patches are directly attached via a vboxsf mouninto the VM. The Vagrantfile use the following environment Variable to point to the local directory on the host.
VAGRANT_ANSIBLE_ORACLE_SW
Make sure that this variable is definedbefore starting the VM; and pointing to a directory on your local machine.
Example:
SET VAGRANT_ANSIBLE_ORACLE_SW=E:\Oracle\sw
Tip: Define the Variable as an evnironment Variable for persistency in Windows .
Vagrant is mostly used on Windows. To install everything as easy as possible the following steps are recommended:
https://chocolatey.org/install Open a powershell.exe with administrative priviledges:
Get-ExecutionPolicy
If it returns Restricted, then run
Set-ExecutionPolicy AllSigned
or
Set-ExecutionPolicy Bypass -Scope Process. Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
The 1st start of a vagrant box needs an environment variable to create the addional disks for Oracle.
VAGRANT_EXPERIMENTAL=disks vagrant up
This feauture is only supported with Virtualbox (July 20121)!
This is only needed once. All other starts could be done with:
vagrant up
The rebuild of VirtualBox Additions sometimes fail during 1st build of Vagrantbox. Try the following command:
/sbin/rcvboxadd quicksetup all
If this fails, the reinstallation from VDROM is needed. Add the cd as device inside VirtualBox, mount it and execute the following command:
mount /dev/cdrom /mnt/ /mnt/VBoxLinuxAdditions.run
The ansible-oracle-inventory
includes an example Workspace configuration for easy usage of VS Code with ansible-oracle.
The following connection is used by VSCode:
The start depends on the SSH setup of youR environment. Do not forget to start an ssh-agent, when dedicated keys are used. Otherwise code could not connect to the VM.
code vscode/aoansible.code-workspace
All configured plugins are automatically installed on the target.