Skip to content

Commit 2b673f3

Browse files
authored
Merge pull request #272 from Rendanic/prvagrant
Vagrantfiles and Ansible Inventory
2 parents 4dae3be + 2abb0a9 commit 2b673f3

File tree

16 files changed

+457
-14
lines changed

16 files changed

+457
-14
lines changed

.ansible-lint

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use_default_rules: true
33

44
skip_list:
55
- name[casing]
6-
- name[play]
76

87
exclude_paths:
98
- .github

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
vagrant/*/.vagrant
3+
vagrant/*/*pub
4+
vagrant/*/*zip
5+
vagrant/*/*ZIP

README.adoc

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ cd vagrant/dbfs
6464
VAGRANT_EXPERIMENTAL=disks vagrant up
6565
----
6666

67-
IMPORTANT: Copy `LINUX.X64_190000_db_home.zip` into `/tmp` on Vagrantbox
67+
IMPORTANT: Copy `LINUX.X64_193000_grid_home.zip` into `/vagrant` in same directory as the Vagrantfile.
6868

6969

7070
#### Start Playbook
@@ -77,6 +77,42 @@ The `playbook/os_vagrant.yml` fixes that.
7777
ansible-playbook -e hostgroup=all -i inventory/dbfs/hosts.yml playbooks/os_vagrant.yml playbooks/single-instance-fs.yml
7878
----
7979

80+
### Single Instance with Oracle Restart (HAS) in Vagrantbox
81+
82+
83+
#### Vagrantbox for Database Server
84+
85+
Requirements::
86+
8500 MB RAM: +
87+
20 GB Diskspace:
88+
89+
The Inventory from has expects a 2nd disk at `/dev/sdb`.
90+
See `host_fs_layout` as example.
91+
92+
The Vagrantfile is in `vagrant/has` of `ansible-oracle`.
93+
94+
IMPORTANT: The `VAGRANT_EXPERIMENTAL=disks` is very important.
95+
It adds the 2nd disk for LVM and 2 ASM-Disks to the VM during the startup.
96+
97+
.Start Vagrantbox
98+
----
99+
cd vagrant/has
100+
VAGRANT_EXPERIMENTAL=disks vagrant up
101+
----
102+
103+
IMPORTANT: Copy `LINUX.X64_193000_grid_home.zip` and `LINUX.X64_190000_db_home.zip` into `/vagrant` in same directory as the Vagrantfile.
104+
105+
106+
#### Start Playbook
107+
108+
IMPORTANT: The used Vagrantbox does not configure the `/etc/hosts` for Oracle correctly.
109+
The `playbook/os_vagrant.yml` fixes that. +
110+
111+
.execute playbook
112+
----
113+
ansible-playbook -e hostgroup=all -i inventory/has/hosts.yml playbooks/os_vagrant.yml playbooks/single-instance-asm.yml
114+
----
115+
80116
= Roles
81117

82118
== common
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
minor_changes:
3+
- "vagrant: Vagrantfile for dbfs & has (#272)"
4+
- "inventory: New Inventory for has (#272)"
5+
removed_features:
6+
- "desupported leftover racattackl-install.yml (#272)"
7+
bugfixes:
8+
- "ansible-lint: removed name[play] from execptions (#272)"

inventory/dbfs/group_vars/all/software_src.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ oracle_sw_copy: false
44
oracle_sw_unpack: false
55

66
# Directory for Installation-Media
7-
oracle_stage_remote: /tmp
7+
oracle_stage_remote: /vagrant
88

99
# Example for Remote NFS
1010
# install_from_nfs: true # Mount NFS-Share?
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
oracle_install_version_gi: 19.3.0.0
3+
apply_patches_gi: false
4+
5+
oracle_asm_init_dg: data # 1st diskgroup
6+
7+
asm_diskgroups: # ASM Diskgroups used for DB-storage. Should map to dict asm_storage_layout.
8+
- diskgroup: data
9+
state: present
10+
properties:
11+
- {redundancy: external, ausize: 4}
12+
attributes:
13+
- {name: compatible.rdbms, value: "19.0.0.0.0"}
14+
- {name: compatible.asm, value: "19.0.0.0.0"}
15+
disk:
16+
- {device: /dev/sdc, asmlabel: data01}
17+
- diskgroup: fra
18+
state: present
19+
properties:
20+
- {redundancy: external, ausize: 4}
21+
attributes:
22+
- {name: compatible.rdbms, value: "19.0.0.0.0"}
23+
- {name: compatible.asm, value: "19.0.0.0.0"}
24+
disk:
25+
- {device: /dev/sdd, asmlabel: fra01}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
# This is an example for 1 Instance on 1 Host.
3+
# Please look at ansible-oracle-inventory for more complex configurations:
4+
# https://github.com/opitzconsulting/ansible-oracle-inventory
5+
#
6+
oracle_databases:
7+
- home: &db_config_home 19300-base
8+
oracle_db_name: &oracle_db_name ORCL
9+
oracle_db_type: SI # Type of database (RAC,RACONENODE,SI)
10+
is_container: true
11+
storage_type: ASM # Database storage to be used. ASM or FS.
12+
oracle_db_mem_totalmb: 1536 # Amount of RAM to be used for SGA
13+
oracle_database_type: MULTIPURPOSE # MULTIPURPOSE|DATA_WAREHOUSING|OLTP
14+
redolog_size: 75M
15+
redolog_groups: 3
16+
datafile_dest: +DATA
17+
recoveryfile_dest: +FRA
18+
# listener_name: LISTENER # This home will have a listener configured
19+
listener_port: &cdb_listener_port 1521
20+
# *local_listener is used in initparam as an achor
21+
local_listener: &local_listener "'{{ ansible_hostname }}:1521'"
22+
archivelog: false
23+
flashback: false
24+
force_logging: true
25+
state: present
26+
statspack:
27+
purgedays: 14
28+
snaplevel: 5
29+
state: present
30+
tablespaces:
31+
- {name: system, size: 10M, autoextend: true, next: 50M, maxsize: 4G, content: permanent, state: present, bigfile: false}
32+
- {name: sysaux, size: 10M, autoextend: true, next: 50M, maxsize: 4G, content: permanent, state: present, bigfile: false}
33+
- {name: undotbs1, size: 10M, autoextend: true, next: 50M, maxsize: 8G, content: permanent, state: present, bigfile: false}
34+
- {name: users, size: 10M, autoextend: true, next: 50M, maxsize: 2G, content: permanent, state: present, bigfile: false}
35+
- {name: temp, size: 10M, autoextend: true, next: 50M, maxsize: 4G, content: permanent, state: present, bigfile: false}
36+
init_parameters:
37+
- {name: audit_trail, value: 'NONE', scope: spfile, state: present}
38+
- {name: processes, value: '400', scope: spfile, state: present, dbca: false}
39+
# - {name: local_listener, value: *local_listener, scope: both, state: present}
40+
- {name: archive_lag_target, value: '900', scope: both, state: present}
41+
- {name: control_management_pack_access, value: 'NONE', scope: both, state: present}
42+
- {name: control_file_record_keep_time, value: '30', scope: both, state: present}
43+
- {name: db_files, value: '200', scope: spfile, state: present}
44+
- {name: deferred_segment_creation, value: 'false', scope: both, state: present}
45+
- {name: filesystemio_options, value: 'setall', scope: spfile, state: present}
46+
- {name: job_queue_processes, value: '10', scope: both, state: present}
47+
# Disable forcing hugepages on really small systems
48+
# - {name: use_large_pages ,value: 'ONLY', scope: spfile, state: present}
49+
- {name: log_archive_dest_1, value: 'location=USE_DB_RECOVERY_FILE_DEST', scope: both, state: present}
50+
- {name: log_buffer, value: '64M', scope: spfile, state: present}
51+
- {name: pga_aggregate_target, value: '200M', scope: both, state: present, dbca: false}
52+
- {name: sga_target, value: '1800M', scope: spfile, state: present, dbca: false}
53+
- {name: shared_pool_size, value: '768M', scope: both, state: present, dbca: true}
54+
- {name: recyclebin, value: 'off', scope: spfile, state: present}
55+
- {name: standby_file_management, value: 'AUTO', scope: both, state: present}
56+
- {name: streams_pool_size, value: '152M', scope: spfile, state: present}
57+
- {name: "_cursor_obsolete_threshold", value: '1024', scope: spfile, state: present}
58+
- {name: max_pdbs, value: '3', scope: both, state: present}
59+
- {name: clonedb, value: 'true', scope: spfile, state: present, dbca: false}
60+
- {name: db_create_file_dest, value: '+DATA', scope: both, state: present}
61+
- {name: db_create_online_log_dest_1, value: '+DATA', scope: both, state: present}
62+
- {name: db_recovery_file_dest_size, value: '10G', scope: both, state: present, dbca: false}
63+
64+
profiles:
65+
- name: DEFAULT
66+
state: present
67+
attributes:
68+
- {name: password_life_time, value: unlimited}
69+
70+
users:
71+
- schema: dbsnmp
72+
state: unlocked
73+
update_password: always
74+
75+
rman_jobs:
76+
- {name: parameter}
77+
- {name: offline_level0, disabled: false, weekday: "0", hour: "01", minute: "10", day: "*"}
78+
79+
oracle_pdbs:
80+
- home: *db_config_home
81+
listener_port: *cdb_listener_port
82+
cdb: *oracle_db_name
83+
pdb_name: ORCLPDB
84+
state: present
85+
profiles: "{{ oracle_default_profiles }}"
86+
statspack:
87+
purgedays: 14
88+
snaplevel: 7
89+
state: present
90+
91+
tablespaces:
92+
- {name: system, size: 10M, autoextend: true, next: 50M, maxsize: 4G, content: permanent, state: present, bigfile: false}
93+
- {name: sysaux, size: 10M, autoextend: true, next: 50M, maxsize: 4G, content: permanent, state: present, bigfile: false}
94+
- {name: undotbs1, size: 10M, autoextend: true, next: 50M, maxsize: 8G, content: permanent, state: present, bigfile: false}
95+
- {name: users, size: 10M, autoextend: true, next: 50M, maxsize: 2G, content: permanent, state: present, bigfile: false}
96+
- {name: temp, size: 10M, autoextend: true, next: 50M, maxsize: 4G, content: permanent, state: present, bigfile: false}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
# Oracle gets problems, when root processes are not visible
3+
hidepid_option: 0
4+
5+
os_security_kernel_enable_module_loading: true
6+
7+
sysctl_overwrite:
8+
network_ipv6_enable: false
9+
fs.protected_regular: 0 # needed for opatchauto ...
10+
11+
# ssh settings
12+
ssh_print_last_log: true
13+
ssh_allow_agent_forwarding: false
14+
ssh_permit_tunnel: false
15+
ssh_allow_tcp_forwarding: 'no'
16+
ssh_max_auth_retries: 3
17+
18+
ssh_allow_users: vagrant ansible
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
configure_public_yum_repo: false
3+
configure_motd: false
4+
5+
configure_hugepages_by: memory
6+
7+
# disable hugepages on small systems
8+
# don't forget to enable use_large_pages in oracle parameter
9+
# size_in_gb_hugepages: 2
10+
size_in_gb_hugepages: 0
11+
12+
13+
configure_host_disks: true
14+
15+
host_fs_layout:
16+
- vgname: vgora
17+
state: present
18+
filesystem:
19+
- {mntp: /u01, lvname: orabaselv, lvsize: 40G, fstype: xfs}
20+
- {mntp: swap, lvname: swaplv, lvsize: 16g, fstype: swap}
21+
disk:
22+
- {device: /dev/sdb, pvname: /dev/sdb1}
23+
- vgname: rootvg
24+
state: present
25+
filesystem:
26+
- {mntp: /tmp, lvname: tmplv, lvsize: 1200m, fstype: ext4}
27+
disk:
28+
- {device: /dev/sda, pvname: /dev/sda2}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
is_sw_source_local: true
3+
oracle_sw_copy: false
4+
oracle_sw_unpack: false
5+
6+
# Directory for Installation-Media
7+
oracle_stage_remote: /vagrant
8+
9+
# Example for Remote NFS
10+
# install_from_nfs: true # Mount NFS-Share?
11+
# nfs_server_sw: 192.168.56.99 # NFS-Server
12+
# nfs_server_sw_path: /sw # NFS-Share
13+
# oracle_stage_remote: /u01/se # local mount point for NFS share

0 commit comments

Comments
 (0)