-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
oracluvfy: New role for managing cluvfy
The following patch could be added to oracle_sw_patches for downloading the cluvfy from Oracle. oracle_sw_patches: - filename: cvupack_linux_ol7_x86_64.zip patchid: 30839369 version: 21.0.0.0 description: Latest cluvfy
- Loading branch information
Showing
12 changed files
with
281 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
minor_changes: | ||
- "oracluvfy: New role for managing cluvfy ()" |
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,5 @@ | ||
--- | ||
logging: | ||
level: warning | ||
template: readme | ||
force_overwrite: true |
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,70 @@ | ||
# oracluvfy | ||
|
||
Manage Cluster Verification Utility from Oracle | ||
|
||
## Table of content | ||
|
||
- [Requirements](#requirements) | ||
- [Default Variables](#default-variables) | ||
- [oracluvfy_archive](#oracluvfy_archive) | ||
- [oracluvfy_force_update](#oracluvfy_force_update) | ||
- [oracluvfy_home](#oracluvfy_home) | ||
- [Discovered Tags](#discovered-tags) | ||
- [Dependencies](#dependencies) | ||
- [License](#license) | ||
- [Author](#author) | ||
|
||
--- | ||
|
||
## Requirements | ||
|
||
- Minimum Ansible version: `2.14.0` | ||
|
||
## Default Variables | ||
|
||
### oracluvfy_archive | ||
|
||
ZIP Archive used by the role. | ||
|
||
#### Default value | ||
|
||
```YAML | ||
oracluvfy_archive: cvupack_linux_ol7_x86_64.zip | ||
``` | ||
### oracluvfy_force_update | ||
Force unarchive of cluvfy in `oracluvfy_home`. | ||
|
||
#### Default value | ||
|
||
```YAML | ||
oracluvfy_force_update: false | ||
``` | ||
|
||
### oracluvfy_home | ||
|
||
#### Default value | ||
|
||
```YAML | ||
oracluvfy_home: '{{ oracle_base }}/product/cluvfy' | ||
``` | ||
|
||
## Discovered Tags | ||
|
||
**_always_** | ||
|
||
**_assert_** | ||
|
||
|
||
## Dependencies | ||
|
||
- orasw_meta | ||
|
||
## License | ||
|
||
license (MIT) | ||
|
||
## Author | ||
|
||
[Thorsten Bruhns] |
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,14 @@ | ||
--- | ||
# @var oracluvfy_home:description: > | ||
# @end | ||
oracluvfy_home: "{{ oracle_base }}/product/cluvfy" | ||
|
||
# @var oracluvfy_archive:description: > | ||
# ZIP Archive used by the role. | ||
# @end | ||
oracluvfy_archive: cvupack_linux_ol7_x86_64.zip | ||
|
||
# @var oracluvfy_force_update:description: > | ||
# Force unarchive of cluvfy in `oracluvfy_home`. | ||
# @end | ||
oracluvfy_force_update: false |
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,28 @@ | ||
--- | ||
# @meta description: > | ||
# Manage Cluster Verification Utility from Oracle | ||
# @end | ||
# @meta author: [Thorsten Bruhns] | ||
galaxy_info: | ||
role_name: oracluvfy | ||
author: Thorsten Bruhns | ||
description: Manage cluvfy for Oracle Grid-Infrastructure/Restart | ||
company: Thorsten Bruhns | ||
|
||
license: license (MIT) | ||
|
||
min_ansible_version: 2.14.0 | ||
|
||
platforms: | ||
- name: EL | ||
versions: | ||
- "6" | ||
- "7" | ||
- "8" | ||
|
||
galaxy_tags: | ||
- database | ||
- oracle | ||
|
||
dependencies: | ||
- role: orasw_meta |
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,15 @@ | ||
--- | ||
- name: Assert variables | ||
ansible.builtin.assert: | ||
quiet: true | ||
that: | ||
- oracluvfy_home is defined | ||
- oracle_base is defined | ||
- oracle_stage is defined | ||
|
||
- name: Show variables | ||
ansible.builtin.debug: | ||
msg: | ||
- "oracluvfy_home: {{ oracluvfy_home }}" | ||
- "oracluvfy_archive: {{ oracluvfy_archive }}" | ||
- "oracluvfy_force_update: {{ oracluvfy_force_update }}" |
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,42 @@ | ||
--- | ||
# run cluvfy comp sys ... | ||
- name: execute_cluvfy | Execute cluvfy | ||
block: | ||
- name: execute_cluvfy | Assert parameter | ||
ansible.builtin.assert: | ||
quiet: false | ||
that: | ||
- cluvfy_args is defined | ||
- cluvfy_args | length > 2 | ||
success_msg: >- | ||
Parameter: {{ cluvfy_args }} | ||
- name: execute_cluvfy | Check for executable | ||
ansible.builtin.stat: | ||
path: "{{ _oracluvfy_executable }}" | ||
register: _oracluvfy_executable_stat | ||
|
||
- name: execute_cluvfy | Install cluvfy | ||
ansible.builtin.include_tasks: install_cluvfy.yml | ||
when: | ||
- not _oracluvfy_executable_stat.stat.exists | ||
|
||
- name: execute_cluvfy | Execute cluvfy | ||
ansible.builtin.command: >- | ||
{{ _oracluvfy_executable }} {{ cluvfy_args }} | ||
args: | ||
chdir: "{{ oracluvfy_home }}" | ||
register: cluvfy_execute_res | ||
changed_when: cluvfy_execute_res.rc == 0 | ||
become: true | ||
become_user: "{{ oracle_user }}" | ||
|
||
rescue: | ||
- name: execute_cluvfy | cluvfy failed | ||
ansible.builtin.fail: | ||
msg: See next task for details | ||
|
||
always: | ||
- name: execute_cluvfy | Show result | ||
ansible.builtin.debug: | ||
var: cluvfy_execute_res.stdout_lines |
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,70 @@ | ||
--- | ||
- name: Assert | ||
ansible.builtin.include_tasks: assert.yml | ||
tags: | ||
- assert | ||
- always | ||
|
||
- name: install_cluvfy | Install | ||
become: true | ||
become_user: "{{ oracle_user }}" | ||
vars: | ||
_creates: >- | ||
{{ oracluvfy_force_update | bool | ternary((oracluvfy_home + '/missing_file'), _oracluvfy_executable) }} | ||
block: | ||
- name: install_cluvfy | download cluvfy (copy) | ||
ansible.builtin.copy: | ||
src: "{{ oracle_sw_source_local }}/{{ oracluvfy_archive }}" | ||
dest: "{{ oracle_stage }}" | ||
mode: 0664 | ||
force: false | ||
remote_src: false | ||
when: | ||
- is_sw_source_local | ||
- oracle_sw_copy | ||
- not _oracluvfy_executable_stat.stat.exists | default(false) or oracluvfy_force_update | ||
|
||
- name: install_cluvfy | download cluvfy (www) | ||
ansible.builtin.get_url: | ||
url: "{{ oracle_sw_source_www }}/{{ oracluvfy_archive }}" | ||
dest: "{{ oracle_stage }}" | ||
mode: 0644 | ||
force: false | ||
when: | ||
- not is_sw_source_local | ||
- oracle_sw_copy | ||
- not _oracluvfy_executable_stat.stat.exists | default(false) or oracluvfy_force_update | ||
|
||
- name: install_cluvfy | Create target directory | ||
ansible.builtin.file: | ||
path: "{{ oracluvfy_home }}" | ||
mode: "0755" | ||
recurse: true | ||
state: directory | ||
|
||
- name: install_cluvfy | Unarchive cluvfy archive | ||
ansible.builtin.unarchive: | ||
src: "{{ _oracluvfy_stage }}/{{ oracluvfy_archive }}" | ||
dest: "{{ oracluvfy_home }}" | ||
copy: false | ||
args: | ||
creates: "{{ _creates }}" | ||
|
||
- name: install_cluvfy | Remove local copy of {{ oracluvfy_archive }} | ||
ansible.builtin.file: | ||
path: "{{ _oracluvfy_stage }}/{{ oracluvfy_archive }}" | ||
state: absent | ||
when: | ||
- oracle_sw_copy | ||
|
||
- name: install_cluvfy | Show installed version | ||
ansible.builtin.command: >- | ||
{{ _oracluvfy_executable }} -version | ||
args: | ||
chdir: "{{ oracluvfy_home }}" | ||
register: cluvfy_version_res | ||
changed_when: cluvfy_version_res.rc == 0 | ||
|
||
- name: install_cluvfy | Show version | ||
ansible.builtin.debug: | ||
var: cluvfy_version_res.stdout_lines |
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 @@ | ||
--- |
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,15 @@ | ||
--- | ||
# run cluvfy comp healthcheck ... | ||
- name: run_cluvfy_comp_sys | Execute cluvfy comp healthcheck | ||
ansible.builtin.include_tasks: execute_cluvfy.yml | ||
vars: | ||
cluvfy_args: >- | ||
comp healthcheck | ||
-collect cluster | ||
- name: run_cluvfy_comp_sys | Execute cluvfy comp healthcheck | ||
ansible.builtin.include_tasks: execute_cluvfy.yml | ||
vars: | ||
cluvfy_args: >- | ||
comp healthcheck | ||
-collect asm |
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,13 @@ | ||
--- | ||
# run cluvfy comp sys ... | ||
- name: run_cluvfy_comp_sys | Execute cluvfy comp sys | ||
ansible.builtin.include_tasks: execute_cluvfy.yml | ||
vars: | ||
cluvfy_args: >- | ||
comp sys | ||
-p | ||
{% if oracle_install_option_gi == 'HA_CONFIG' %}ha{% endif %} | ||
-osdba {{ dba_group }} | ||
-osoper {{ oper_group }} | ||
# oracle_install_option_gi: HA_CONFIG |
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,5 @@ | ||
--- | ||
_oracluvfy_executable: "{{ oracluvfy_home }}/bin/cluvfy" | ||
|
||
_oracluvfy_stage: >- | ||
{{ oracle_sw_copy | bool | ternary(oracle_stage, oracle_stage_remote) }} |