Skip to content

Commit

Permalink
Run Setup for the Central Agent
Browse files Browse the repository at this point in the history
Include the oracle-oem-agent-setup role during OMS setup in order to ensure that the EMREP database is available as a target for subsequent setting of named credentials.
  • Loading branch information
bill-buchan committed Mar 7, 2024
1 parent 552f9be commit 9a2a314
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
state: directory
recurse: yes

- name: Remove previous download of emcli to allow download
file:
path: "{{ app_dir }}/emcli/emclikit.jar"
state: absent

- name: Get emcli from OMS server
ansible.builtin.shell: |
set -eo pipefail
Expand Down
19 changes: 19 additions & 0 deletions ansible/roles/oracle-oms-setup/tasks/apply_oms_patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,25 @@
path: "{{ omspatcher_stage }}/oms_property_file"
state: absent

- name: Check status of OMS
ansible.builtin.shell: |
export ORACLE_HOME={{ oem_mw_home }}
{{ oem_mw_home }}/bin/emctl status oms | grep -c "^Oracle Management Server is Up" | cat
changed_when: false
register: oms_running

- name: Re-Start OMS After Patching
ansible.builtin.shell: |
set -eo pipefail
main() {
export ORACLE_HOME={{ oem_mw_home }}
{{ oem_mw_home }}/bin/emctl start oms
}
main 2>&1 | logger -p local3.info -t ansible-oracle-oem
async: 86400
poll: 60
when: oms_running.stdout == '0'

# block
become: true
become_user: oracle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@
- import_incident_rule_set.sh
- rule_set.xml

# Ignore error re-importing the same rule set more than once
- name: Run Incident Rule Set Import
become_user: oracle
ansible.builtin.shell: |
echo "running emcli_login.sh"
{{ stage }}/emcli_login.sh
echo "running import_incident_rule_set.sh"
{{ stage }}/import_incident_rule_set.sh
register: run_incident_rule_set_import
failed_when:
- run_incident_rule_set_import.rc > 0
- not run_incident_rule_set_import.stderr is search('.*HMPPS OEM Rule Set.*already exists.*')

- pause:
seconds: 30
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/oracle-oms-setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
- ec2provision
- oracle_oem_patch_upgrade

- name: Run Setup for the Central Agent
import_role:
name: oracle-oem-agent-setup

- import_tasks: create_group.yml
tags:
- amibuild
Expand Down

0 comments on commit 9a2a314

Please sign in to comment.