-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #574 from ministryofjustice/oracle-db-housekeeping…
…-job Created Oracle db housekeeping job and added role in ec2 db instance …
- Loading branch information
Showing
26 changed files
with
352 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Overview | ||
|
||
Role for configuring scheduled oracle Database server housekeeping. | ||
|
||
# Pre-requisite for scheduled db server housekeeping | ||
|
||
In group_vars add details for audit housekeeping | ||
# Oracle database housekeeping | ||
audit_housekeeping_period: 60 | ||
db_housekeeping_script: db_server_housekeeping.sh | ||
housekeeping_cron: | ||
db_server_housekeeping: | ||
- name: database_server_housekeeping | ||
weekday: "0" | ||
minute: "30" | ||
hour: "08" | ||
# job: command generated in | ||
|
||
Example: | ||
no_proxy="*" ansible-playbook site.yml --limit test-oem-a -e force_role=oracle-db-housekeeping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
# Oracle database housekeeping | ||
audit_housekeeping_period: 60 | ||
db_housekeeping_script: db_server_housekeeping.sh | ||
housekeeping_cron: | ||
db_server_housekeeping: | ||
- name: database_server_housekeeping | ||
weekday: "0" | ||
minute: "30" | ||
hour: "08" | ||
# job: command generated in |
34 changes: 34 additions & 0 deletions
34
ansible/roles/oracle-db-housekeeping/tasks/db-server-housekeeping.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: Generate Housekeeping command parameters for scheduler | ||
ansible.builtin.set_fact: | ||
housekeeping_command: "/home/oracle/admin/scripts/{{ db_housekeeping_script }} -a {{ audit_housekeeping_period }}" | ||
|
||
- name: create script directory | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
owner: oracle | ||
group: oinstall | ||
state: directory | ||
recurse: yes | ||
loop: | ||
- /home/oracle/admin/scripts | ||
|
||
- name: copy scripts | ||
ansible.builtin.template: | ||
src: "{{ item }}.j2" | ||
dest: "/home/oracle/admin/scripts/{{ item }}" | ||
owner: oracle | ||
group: oinstall | ||
mode: "0700" | ||
loop: | ||
- "{{ db_housekeeping_script }}" | ||
|
||
- name: setup oracle housekeeping job | ||
ansible.builtin.cron: | ||
name: "{{ item.name }}" | ||
weekday: "{{ item.weekday }}" | ||
minute: "{{ item.minute }}" | ||
hour: "{{ item.hour }}" | ||
user: root | ||
job: "su oracle -c '{{ housekeeping_command }}' 2>&1 | logger -p local3.info -t db_server_housekeeping" | ||
loop: "{{ housekeeping_cron.db_server_housekeeping | list }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- import_tasks: db-server-housekeeping.yml | ||
tags: | ||
- ec2provision |
Oops, something went wrong.