Skip to content

Commit 4b1bc89

Browse files
committed
Merge branch 'oraswdb-loop-control'
2 parents df0df23 + bfa400f commit 4b1bc89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+647
-482
lines changed

README.md

Lines changed: 105 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,38 @@
1+
# ansible-oracle
12

3+
- Installs Oracle RAC, RAC One Node and normal single instances.
4+
- Start with one or more clean machine(s), end up with a fully configured RAC Cluster.
25

3-
<b> Requirements:
46

5-
- Ansible >= 1.6
6-
- Oracle Linux (or any RHEL-based Linux System) >= 6.4
7-
- Oracle Database/Grid Infrastructure 12.2.0.1, 12.1.0.1, 12.1.0.2, 11.2.0.4, 11.2.0.3
7+
By default, installs a single instance 12.2.0.1 database on filesystem. Just put the following file in /tmp on the control-machine
8+
9+
- `linuxx64_12201_database.zip`
810

9-
</b>
1011

11-
At the moment you can install Oracle RAC, RAC One Node and normal single instances.
12-
You can take a freshly installed machine and configure it from ground up. It'll configure users, profiles, kernel parameters, storage and install the database server and create one or more databases.
13-
It also supports role separation when installing Grid Infrastructure, meaning a 'grid' user owns and runs the GI and the 'oracle' user owns and runs the databases.
1412

15-
By default, you can install a single instance 12.1.0.2 database on filesystem, without having to change any parameters. Just put the following files in /tmp on the control-machine:
16-
- linuxamd64_12102_database_1of2.zip
17-
- linuxamd64_12102_database_2of2.zip
13+
### Getting started
1814

19-
I'm creating a bunch of examples which illustrates how to use/run the different roles. They can be found here: http://oravirt.wordpress.com/category/ansible-oracle.
15+
Pre-requisites:
16+
17+
- Ansible >= 2.1
18+
- Oracle Linux (or any RHEL-based Linux System) >= 6.4
19+
- Oracle Database/Grid Infrastructure 12.2.0.1, 12.1.0.1, 12.1.0.2, 11.2.0.4, 11.2.0.3
2020

21-
As this is based on the EL6 platform the lowest supported Oracle version will be 11.2.0.3, as per Oracle's certification matrix.
2221

23-
<b>Note: </b>
24-
- You'll need to manually download the Oracle software and make it available to the control-machine (either locally or on a web-server, or through a nfs-share) before running the playbook. By default the
25-
path to the software is /tmp on the control-machine.
26-
- All roles are built on Oracle Linux 6, but should work with any EL6-based system.
27-
- Storage options only supports block devices at the moment (FS & ASM). Will add support for NFS
22+
### Roles
2823

29-
<b>The different roles are:</b>
24+
**common**
3025

31-
<b> common: </b>
3226
This will configure stuff common to all machines
33-
- Install some generic packages
34-
- Configure ntp
35-
- Possibly add a default/deploy user.
27+
- Install some generic packages
28+
- Configure ntp
29+
30+
31+
**orahost**
3632

37-
<b>orahost:</b>
3833
This will configure the host specific Oracle stuff:
3934
- Add a user & group
4035
- Create directory structures
41-
- Generate ssh-keys and set up passwordless ssh between clusternodes in case of RAC/RAC One node
4236
- Handle filesystem storage (partition devices, creates vg/lv and a filesystem (ext4, xfs, btrfs) etc). If you want to create your database on a filesystem (instead of ASM) this is where you define the layout.
4337
- Install required packages
4438
- Change kernel paramemeters
@@ -47,66 +41,123 @@ This will configure the host specific Oracle stuff:
4741
- Disables transparent hugepages
4842
- Disables NUMA (if needed)
4943
- Configures the interconnect network (if needed)
50-
- Configures Oracle ASMLib
44+
- Configures Oracle ASMLib
45+
46+
47+
**orahost-ssh**
48+
49+
Configures passwordless ssh between clusternodes if setting up RAC (`configure_cluster=True`)
50+
- Uses existing ssh-keys
51+
52+
53+
**orahost-storage**
5154

52-
<b>orahost-storage:</b>
5355
This role configures storage that shoud be used by ASM.
5456
- Partitions devices (using parted)
5557
- Create ASMlib labels or sets up udev-rules for device name persistence
5658

57-
<b>oraswgi-install:</b>
58-
This role will install and configure Oracle Grid Infrastructure. Tested with 12.1.0.1/12.1.0.2 & 11.2.0.4/11.2.0.3
59+
60+
**oraswgi-install**
61+
62+
This role will install and configure Oracle Grid Infrastructure (RAC/SI)
5963
- Adds a .profile_grid to the oracle user
6064
- Sets up directory structures
6165
- Copies the install-files to the servers, or installs from a remote location (e.g nfs share)
6266
- Install Oracle Grid Infrastructure
6367

6468

69+
**oraasm-createdg**
6570

66-
<b>oraasm-configureasm:</b>
67-
This role will create and configure the ASM-instance with an initial diskgroup.
71+
This role will create the diskgroup(s) that should be used for database storage. Uses asmca to create diskgroups.
72+
- Generates a shellscript that uses asmca to create the diskgroups.
6873

69-
- Generates a shellscript that uses asmca to create the ASM instance
7074

71-
<b>oraasm-createdg:</b>
72-
This role will create the diskgroup(s) that should be used for database storage. Uses asmca to create diskgroups.
73-
- Generates a shellscript that uses asmca to create the diskgroups.
75+
**oraswdb-install**
7476

75-
<b>oraswdb-install:</b>
7677
This role will install the oracle database server(s). It is possible to run more than 1 database from each home. It performs both Single Instance/RAC installations.
77-
- Creates a .profile_databasename
78+
- Creates a .profile with the correct environment
7879
- Creates directory structures
79-
- Transfers installfiles to server(s)
8080
- Installs the database-server(s)
8181

82-
<b>oradb-create:</b>
82+
83+
**oradb-manage-db**
84+
85+
This role creates/deletes databases
86+
- Generates a responsefile to be used by dbca
87+
- Creates the db using dbca
88+
89+
90+
_**oradb-create (deprecated - use oradb-manage-db instead)**_
91+
8392
This role creates the databases (RAC/RAC One Node, Single Instance). Possible to create container databases. Performs a dbca silent run to create the database.
84-
Note:
85-
At the moment there is no listener configured when creating a database on a filesystem (i.e no grid infrastructure present). Will be added later though.
8693
- Generates a responsefile to be used by dbca
8794
- Creates the db using dbca
8895
- Changes parameters based on input.
8996

9097

91-
<b>oraswgi-opatch:</b>
92-
This role will use opatch to apply a patch to a Grid Infrastructure home. At the moment it is basically written to apply PSU's, not one-off patches. It'll probably work but it is not designed for that.
98+
_**oradb-delete (deprecated - use oradb-manage-db instead)**_
99+
100+
This role deletes a database
101+
102+
103+
**oraswgi-opatch**
104+
105+
This role will use opatch to apply a patch to a Grid Infrastructure home. At the moment it is basically written to apply PSU's, not one-off patches. It'll probably work but it is not designed for that at the moment.
93106
Does an initial check to see if the patches are already applied, and skips through all steps if they are.
94107

95108

96-
<b>*** THE FOLLOWING ROLES ARE NOT FINISHED/NOT WORKING PROPERLY YET ****</b>
109+
**cxoracle**
110+
111+
Installs cx_Oracle in preparation for using [ansible-oracle-modules](https://github.com/oravirt/ansible-oracle-module)
112+
113+
114+
**orahost-cron**
115+
116+
Configures cron schedules if needed
117+
118+
119+
**orahost-logrotate**
120+
121+
By default sets up logrotate for alert logs and listener logs
122+
123+
124+
125+
### Note
97126

98-
<b>oraswgi-clone:</b>
99-
This role will use a previously installed/patched Grid Infrastructure installation to perform a new Grid Infrastructure installation using the clone method
127+
These are the Oracle binaries that are pre-configured to be used. They have to be manually downloaded and made available (either locally, from a web endpoint or through a nfs-share)
100128

101-
<b>oraswracdb-clone:</b>
102-
This role will take a previously installed/patched Oracle Database Server installation to perform a new database server installation using the clone method.
129+
For 12.2.0.1:
130+
```
131+
linuxx64_12201_database.zip
132+
linuxx64_12201_grid_home.zip
133+
```
103134

135+
For 12.1.0.2
136+
```
137+
linuxamd64_12102_database_1of2.zip
138+
linuxamd64_12102_database_2of2.zip
139+
linuxamd64_12102_grid_1of2.zip
140+
linuxamd64_12102_grid_2of2.zip
141+
```
104142

143+
For 12.1.0.1:
144+
```
145+
linuxamd64_12c_database_1of2.zip
146+
linuxamd64_12c_database_2of2.zip
147+
linuxamd64_12c_grid_1of2.zip
148+
linuxamd64_12c_grid_2of2.zip
149+
```
105150

106-
<b>TODO</b>
107-
- Add service to database as part of db-creation
108-
- Add support for NFS storage
109-
- Cleanup
110-
- .........
151+
For 11.2.0.4:
152+
```
153+
p13390677_112040_Linux-x86-64_1of7.zip
154+
p13390677_112040_Linux-x86-64_2of7.zip
155+
p13390677_112040_Linux-x86-64_3of7.zip
156+
```
111157

112-
********************************
158+
For 11.2.0.3:
159+
```
160+
p10404530_112030_Linux-x86-64_1of7.zip
161+
p10404530_112030_Linux-x86-64_2of7.zip
162+
p10404530_112030_Linux-x86-64_3of7.zip
163+
```

full-rac-install-dc1.yml

100755100644
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,40 @@
44
- name: Host configuration
55
hosts: orarac-dc1
66
user: ansible
7-
sudo: yes
7+
become: yes
88
roles:
99
- common
1010
- orahost
1111
- orahost-storage
1212

13+
- name: ssh configuration
14+
hosts: vbox-rac-dc1
15+
user: vagrant
16+
become: yes
17+
serial: 1
18+
roles:
19+
- {role: orahost-ssh, when: configure_cluster and not old_ssh_config}
20+
1321
- name: Oracle Grid Infrastructure installation & ASM Configuration
1422
hosts: orarac-dc1
1523
user: ansible
16-
sudo: yes
24+
become: yes
1725
roles:
1826
- oraswgi-install
1927
- oraasm-createdg
2028

2129
- name: Database Server Installation & Database Creation
2230
hosts: orarac-dc1
2331
user: ansible
24-
sudo: yes
32+
become: yes
2533
roles:
2634
- oraswdb-install
2735
- oradb-create
2836

2937
- name: Tweaks
3038
hosts: orarac-dc1
3139
user: ansible
32-
sudo: yes
40+
become: yes
3341
roles:
3442
- cxoracle
3543
- orahost-logrotate

group_vars/vbox-rac-dc1/vbox-rac-dc1.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
hostgroup: vbox-rac-dc1
3-
role_separation: false
3+
role_separation: True
44
device_persistence: asmlib
55

66

@@ -21,10 +21,11 @@
2121
configure_epel_repo: True
2222
configure_public_yum_repo: True
2323
disable_selinux: true
24+
old_ssh_config: False
2425

2526
################ Grid Infrastructure specifics ################
26-
configure_cluster: true
27-
oracle_install_version_gi: 12.1.0.2
27+
configure_cluster: True
28+
oracle_install_version_gi: 12.2.0.1
2829
oracle_gi_cluster_type: STANDARD
2930
oracle_home_gi: "/u01/app/grid/product/{{ oracle_install_version_gi}}/grid"
3031

@@ -40,7 +41,7 @@
4041

4142
oracle_databases: # Dictionary describing the databases to be installed
4243
- home: db1 # 'Last' directory in ORACLE_HOME path (e.g /u01/app/oracle/12.1.0.2/racdb)
43-
oracle_version_db: 12.1.0.2 # Oracle versiono
44+
oracle_version_db: 12.2.0.1 # Oracle versiono
4445
oracle_edition: EE # The edition of database-server (EE,SE,SEONE)
4546
oracle_db_name: orclcdb # Database name
4647
oracle_db_type: RAC # Type of database (RAC,RACONENODE,SI)

group_vars/vbox-rac-dc2/vbox-rac-dc2.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
configure_epel_repo: false
2525
configure_public_yum_repo: false
2626
disable_selinux: true
27+
old_ssh_config: False
2728

2829
################ Grid Infrastructure specifics ################
2930
configure_cluster: true

group_vars/vbox-si-asm/passwords.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ dbpasswords:
1111
sys: Oracle_123
1212
dbsnmp: Oracle_123
1313
pdbadmin: Oracle_456
14-

group_vars/vbox-si-asm/vbox-si-asm.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
hostgroup: vbox-si-asm
33
role_separation: True
4-
device_persistence: udev
4+
device_persistence: asmlib
55
storage_type: ASM
66
#multipath: dm-multipath
77

@@ -10,8 +10,11 @@
1010
oracle_group: oinstall
1111

1212
install_from_nfs: false
13-
oracle_sw_copy: false
14-
oracle_sw_unpack: true
13+
oracle_sw_copy: False
14+
oracle_sw_unpack: True
15+
is_sw_source_local: false
16+
#oracle_sw_source_www: http://192.168.0.24/orasw/
17+
#oracle_sw_source_local: /Users/miksan/Downloads/oracle/
1518
oracle_stage: /u01/stage
1619
oracle_stage_remote: /media/swrepo
1720

@@ -21,7 +24,7 @@
2124
configure_ssh: true
2225
configure_host_disks: true
2326

24-
install_os_packages: False
27+
install_os_packages: True
2528
configure_epel_repo: true
2629
configure_public_yum_repo: True
2730
disable_selinux: false
@@ -62,7 +65,7 @@
6265
# redolog_size_in_mb: 100
6366
# datafile_dest: '+DATA'
6467
# recoveryfile_dest: '+FRA'
65-
# state: present
68+
# state: absent
6669
## The following will install a new ORACLE_HOME with version 11.2.0.4 and a database called running out of that home
6770
# - home: db1 # 'Last' directory in ORACLE_HOME path (e.g /u01/app/oracle/12.2.0.1/db1)
6871
# oracle_version_db: 11.2.0.4 # Oracle versiono (12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4,11.2.0.3)

group_vars/vbox-si-fs/vbox-si-fs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
hostgroup: vbox-si-fs
33

4-
oracle_user: oracle
4+
oracle_user: oracle
55
oracle_group: oinstall
66

77
install_from_nfs: false
@@ -23,7 +23,7 @@
2323

2424
oracle_databases: # Dictionary describing the databases to be installed
2525
- home: db1 # 'Last' directory in ORACLE_HOME path (e.g /u01/app/oracle/12.2.0.1/db1)
26-
oracle_version_db: 12.1.0.2 # Oracle versiono (12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4,11.2.0.3)
26+
oracle_version_db: 12.2.0.1 # Oracle versiono (12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4,11.2.0.3)
2727
oracle_edition: EE # The edition of database-server (EE,SE,SEONE)
2828
oracle_db_name: orclcdb # Database name
2929
oracle_db_passwd: Oracle123 # Passwords (sys/system/dbsnm etc)
@@ -45,7 +45,7 @@
4545
# - home: db1 # 'Last' directory in ORACLE_HOME path (e.g /u01/app/oracle/12.2.0.1/db1)
4646
# oracle_version_db: 12.2.0.1 # Oracle versiono (12.2.0.1,12.1.0.2,12.1.0.1,11.2.0.4,11.2.0.3)
4747
# oracle_edition: EE # The edition of database-server (EE,SE,SEONE)
48-
# oracle_db_name: # Database name
48+
# oracle_db_name: blergh # Database name
4949
# oracle_db_type: SI # Type of database (RAC,RACONENODE,SI)
5050
# is_container: false # (true/false) Is the database a container database
5151
# pdb_prefix: shit

0 commit comments

Comments
 (0)