Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
oravirt committed Jun 4, 2018
2 parents 2553c77 + 768d62d commit 11e01ad
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ By default, installs a single instance 12.2.0.1 database on filesystem. Just put

Pre-requisites:

- Ansible >= 2.1
- Ansible >= 2.4
- Oracle Linux (or any RHEL-based Linux System) >= 6.4
- Oracle Database/Grid Infrastructure 12.2.0.1, 12.1.0.1, 12.1.0.2, 11.2.0.4, 11.2.0.3

Expand Down
1 change: 1 addition & 0 deletions customize-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- oradb-manage-pdb
- oradb-manage-tablespace
- oradb-manage-parameters
- oradb-manage-redo
- oradb-manage-roles
- oradb-manage-users
- oradb-manage-grants
Expand Down
4 changes: 3 additions & 1 deletion group_vars/vbox-rac-dc1/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ oracle_databases:
storage_type: ASM
oracle_db_mem_totalmb: 1024
oracle_database_type: MULTIPURPOSE
redolog_size_in_mb: 100
redolog_size: 100M
redolog_groups: 3
datafile_dest: '+DATA'
recoveryfile_dest: '+FRA'
state: present
# tablespaces:
# - { name: users, size: 10M, bigfile: True, autoextend: false , next: 5M, maxsize: 500M, content: permanent, state: present }
init_parameters:
- {name: db_create_file_dest, value: '+DATA', scope: both, state: present}
- {name: db_create_online_log_dest_1, value: '+FRA', scope: both, state: present}
- {name: db_recovery_file_dest, value: '+FRA', scope: both, state: present}
- {name: db_recovery_file_dest_size, value: 20G, scope: both, state: present}
# services:
Expand Down
4 changes: 3 additions & 1 deletion group_vars/vbox-si-asm/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ oracle_databases: # Dictionary des
storage_type: ASM # Database storage to be used. ASM or FS.
oracle_db_mem_totalmb: 1024 # Amount of RAM to be used for SGA
oracle_database_type: MULTIPURPOSE # MULTIPURPOSE|DATA_WAREHOUSING|OLTP
redolog_size_in_mb: 100
redolog_size: 100M
redolog_groups: 3
datafile_dest: '+DATA'
recoveryfile_dest: '+FRA'
state: present
tablespaces:
- { name: users, size: 10M, bigfile: True, autoextend: false , next: 5M, maxsize: 500M, content: permanent, state: present }
init_parameters:
- {name: db_create_file_dest, value: '+DATA', scope: both, state: present}
- {name: db_create_online_log_dest_1, value: '+FRA', scope: both, state: present}
- {name: db_recovery_file_dest, value: '+FRA', scope: both, state: present}
- {name: db_recovery_file_dest_size, value: 20G, scope: both, state: present}
# services:
Expand Down
8 changes: 3 additions & 5 deletions group_vars/vbox-si-asm/vbox-si-asm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@

configure_hugepages: False

install_os_packages: True
configure_epel_repo: true
configure_public_yum_repo: True
install_os_packages: False
configure_epel_repo: False
configure_public_yum_repo: False
disable_selinux: false

################ Grid Infrastructure specifics ################


host_fs_layout:
- vgname: vgora
Expand Down
4 changes: 3 additions & 1 deletion group_vars/vbox-si-fs/databases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ oracle_databases: # Dictionary des
storage_type: FS # Database storage to be used. ASM or FS.
oracle_db_mem_totalmb: 1024 # Amount of RAM to be used for SGA
oracle_database_type: MULTIPURPOSE # MULTIPURPOSE|DATA_WAREHOUSING|OLTP
redolog_size_in_mb: 100
redolog_size: 100M
redolog_groups: 3
datafile_dest: /u02/oradata
recoveryfile_dest: /u02/fra
listener_name: LISTENER # This home will have a listener configured
listener_port: 1521
state: present
init_parameters:
- {name: db_create_file_dest, value: '/u02/oradata', scope: both, state: present}
- {name: db_create_online_log_dest_1, value: '/u02/fra', scope: both, state: present}
- {name: db_recovery_file_dest, value: '/u02/fra', scope: both, state: present}
- {name: db_recovery_file_dest_size, value: 20G, scope: both, state: present}
services:
Expand Down
2 changes: 1 addition & 1 deletion library
Submodule library updated 2 files
+8 −0 README.md
+359 −0 oracle_redo
3 changes: 2 additions & 1 deletion roles/oradb-manage-db/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
oracle_init_params: "" # Specific parameters to be set during installation. Comma-separated list
oracle_db_mem_totalmb: 1024 # Amount of RAM to be used for SGA + PGA
oracle_database_type: MULTIPURPOSE # MULTIPURPOSE|DATA_WAREHOUSING|OLTP
redolog_size_in_mb: 100
redolog_size: 100M
redolog_groups: 3
listener_name: LISTENER
state: present # present | absent
4 changes: 2 additions & 2 deletions roles/oradb-manage-db/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
with_items: "{{ oracle_databases }}"
tags: set_fact

- include: listener.yml
- include_tasks: listener.yml
when: create_listener
tags: listener

Expand All @@ -32,7 +32,7 @@
tags:
- customdbcatemplate

- include: manage-db.yml
- include_tasks: manage-db.yml
with_items:
- "{{ oracle_databases }}"
loop_control:
Expand Down
2 changes: 1 addition & 1 deletion roles/oradb-manage-db/tasks/manage-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
tags: create_db,dbcatemplate

- name: manage-db | create database
shell: "time {{oracle_home_db}}/bin/dbca -createDatabase -responseFile {{ oracle_rsp_stage }}/{{ oracle_dbca_rsp }} -silent {{ dbca_redolog }} {{ dbca_initparams }}{{dbca_initparams_extras}}"
shell: "time {{oracle_home_db}}/bin/dbca -createDatabase -responseFile {{ oracle_rsp_stage }}/{{ oracle_dbca_rsp }} -silent {{ dbca_initparams }}{{dbca_initparams_extras}}"
run_once: "{{ configure_cluster }}"
become_user: "{{ oracle_user }}"
when: create_db is defined and create_db and dbh.state|lower == 'present'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pdbName={% if dbh.is_container and dbh.pdb_prefix is defined %}{{ dbh.pdb_prefix
# Default value : TRUE
# Mandatory : No
#-----------------------------------------------------------------------------
useLocalUndoForPDBs=true
useLocalUndoForPDBs={{ dbh.pdb_local_undo | default (True) }}

#-----------------------------------------------------------------------------
# Name : pdbAdminPassword
Expand Down
19 changes: 19 additions & 0 deletions roles/oradb-manage-redo/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
configure_cluster: false
oracle_base: /u01/app/oracle
oracle_home_db: "{% if dbh is defined %}{% if dbh.oracle_home is defined %}{{ dbh.oracle_home }}{% else %}{{ oracle_base}}/{{ dbh.oracle_version_db }}/{{ dbh.home }}{% endif %}{% elif item.0 is defined %}{% if item.0.oracle_home is defined %}{{ item.0.oracle_home}}{% else %}{{ oracle_base }}/{{ item.0.oracle_version_db }}/{{ item.0.home }}{% endif %}{% elif item is defined %}{% if item.oracle_home is defined %}{{ item.oracle_home}}{% else %}{{ oracle_base }}/{{ item.oracle_version_db }}/{{ item.home }}{% endif %}{% endif %}"
db_user: system
db_mode: normal
#db_password_cdb: "{% if dbpasswords is defined and dbpasswords[item.cdb] is defined and dbpasswords[item.cdb][db_user] is defined%}{{dbpasswords[item.cdb][db_user]}}{% else %}{{ default_dbpass}}{% endif%}"
db_password_cdb: "{% if dbpasswords is defined and dbpasswords[item.oracle_db_name] is defined and dbpasswords[item.oracle_db_name][db_user] is defined%}{{dbpasswords[item.oracle_db_name][db_user]}}{% else %}{{ default_dbpass}}{% endif%}"

# pdbadmin_user: pdbadmin
# pdbadmin_password: "{% if dbpasswords is defined and dbpasswords[item.cdb] is defined and dbpasswords[item.cdb][item.pdb_name] is defined and dbpasswords[item[1].cdb][item[1].pdb_name][pdbadmin_user] is defined%}{{dbpasswords[item[1].cdb][item[1].pdb_name][pdbadmin_user]}}{% else %}{{ default_dbpass}}{% endif%}"

oracle_env:
ORACLE_HOME: "{{ oracle_home_db }}"
LD_LIBRARY_PATH: "{{ oracle_home_db }}/lib"

# oracle_pdbs:
# - pdb_name: orclpdb
# cdb: orclcdb
# state: present
17 changes: 17 additions & 0 deletions roles/oradb-manage-redo/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
- name: Manage redologs
oracle_redo:
hostname={{ ansible_hostname }}
service_name={{ item.oracle_db_name }}
user={{ db_user }}
password={{ db_password_cdb }}
mode={{ db_mode }}
size={{ item.redolog_size }}
groups={{ item.redolog_groups }}
environment: "{{oracle_env}}"
run_once: "{{ configure_cluster}}"
with_items:
- "{{oracle_databases}}"
when: oracle_databases is defined and item.redolog_size is defined and item.redolog_groups is defined
become_user: "{{ oracle_user }}"
register: param_change
tags: initparams
4 changes: 2 additions & 2 deletions vbox-rac-dc1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
- oradb-manage-pdb
- oradb-manage-tablespace
- oradb-manage-parameters
- oradb-manage-services
- oradb-manage-redo
- oradb-manage-roles
- oradb-manage-users
- oradb-manage-grants

- oradb-manage-services
3 changes: 2 additions & 1 deletion vbox-si-asm-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- orahost
- orahost-storage

- name: Oracle Grid Infrastructure installation
- name: Oracle Grid Infrastructure installation
hosts: vbox-si-asm
user: vagrant
become: yes
Expand Down Expand Up @@ -56,6 +56,7 @@
- oradb-manage-pdb
- oradb-manage-tablespace
- oradb-manage-parameters
- oradb-manage-redo
- oradb-manage-roles
- oradb-manage-users
- oradb-manage-grants
Expand Down
1 change: 1 addition & 0 deletions vbox-si-fs-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
- oradb-manage-pdb
- oradb-manage-tablespace
- oradb-manage-parameters
- oradb-manage-redo
- oradb-manage-roles
- oradb-manage-users
- oradb-manage-grants
Expand Down

0 comments on commit 11e01ad

Please sign in to comment.