-
Notifications
You must be signed in to change notification settings - Fork 1
/
site.yml
50 lines (45 loc) · 1.49 KB
/
site.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
# ####################################################################################
# This is the main playbook, which is used to call all the roles that will allow the
# installation of an Oracle Database 12c using an RSP file
# ####################################################################################
- hosts: database
remote_user: oracle
tasks:
# This task is used to load the variables, which are defined outside roles directories
# The variable called environment is passed as extra-vars parameter when ansible-playbook
# command is executed
- name: Loading variables according to the environment you are working on
include_vars: "{{ item }}"
with_fileglob:
- "inventories/{{ environment_chosen }}/group_vars/*.yml"
- include_role:
name: os_settings
- include_role:
name: install_oracle_db
- hosts: database
remote_user: oracle
become: yes
become_user: root
tasks:
# Here we will call the role to create Linux Services for Oracle database
- include_role:
name: create_db_service
- hosts: database
remote_user: oracle
tasks:
- name: Stopping the database
command: "{{ oracle_home }}/bin/dbshut {{ oracle_home }}"
- hosts: database
remote_user: oracle
become: yes
become_user: root
tasks:
- name: Starting Oracle database listener
service:
name: oracledblistener
state: started
- name: Starting Oracle database
service:
name: oracledb
state: started