Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.1.0 #383

Merged
merged 12 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ skip_list:
# ansible-oracle has lot of internal used variables...
- var-naming[no-role-prefix]
- name[casing]
- meta-runtime[unsupported-version]

exclude_paths:
- .github
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v2

- name: Lint roles
uses: ansible-community/ansible-lint-action@v6.17.0
uses: ansible/ansible-lint@v6.20.3
with:
targets: |
inventory/*
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ repos:
entry: ansible-doctor -r -f roles

- repo: https://github.com/ansible-community/ansible-lint.git
rev: v6.17.0
rev: v6.20.3
hooks:
- id: ansible-lint
entry: ansible-lint --force-color -p
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,43 @@ opitzconsulting.ansible_oracle Release Notes
.. contents:: Topics


v4.1.0
======

Release Summary
---------------

This is a BETA Release of ansible-oracle. Do not use it in production environments!

Minor Changes
-------------

- ansible-lint V6.20.3 (oravirt#383)
- molecule: new stage download to prepare dbfs stage (oravirt#383)
- molecule: new stage golden to create golden images (oravirt#383)
- oiraswgi: Added Support for gridSetup.sh -applyRU for 19c and 21c (oravirt#383)
- oraasm_manage_diskgroups: Refactoring and bugfixes for 4.0 (oravirt#383)
- oracle_opatch: replace sqlplus -V with oraversion for newer releases (oravirt#383)
- oraswdb_golen_image: Rename created archive to fixed name (oravirt#383)
- oraswgi_golen_image: Rename created archive to fixed name (oravirt#383)

Breaking Changes / Porting Guide
--------------------------------

- oraswdb_golen_image: New variable oraswdb_golen_image_create: false (oravirt#383)
- oraswgi_golen_image: New variable oraswgi_golen_image_create: false (oravirt#383)

Bugfixes
--------

- Bugfix for state=absent in oracle_databases with CDB (oravirt#383)
- molecule: Use shared inventory with download scenario (oravirt#383)
- oracle_opatch: fix wrong rolling parameter definition, fix broken opatch opatchauto rollback (oravirt#383)
- oradb_datapatch: allow execution of role with empty oracle_databases and oracle_pdbs (oravirt#383)
- oradb_manage_db: Regather oradb_facts after database change (oravirt#383)
- oradb_manage_statspack: Bugfix for nonCDB setups (oravirt#383)
- orahost: Do not set NOZEROCONF on SuSE platform (oravirt#383)

v4.0.0
======

Expand Down
2 changes: 1 addition & 1 deletion changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ plugins:
strategy: {}
test: {}
vars: {}
version: 4.0.0
version: 4.1.0
39 changes: 39 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -551,3 +551,42 @@ releases:
- playbooks.yml
- shellcheck.yml
release_date: '2023-09-24'
4.1.0:
changes:
breaking_changes:
- 'oraswdb_golen_image: New variable oraswdb_golen_image_create: false (oravirt#383)'
- 'oraswgi_golen_image: New variable oraswgi_golen_image_create: false (oravirt#383)'
bugfixes:
- Bugfix for state=absent in oracle_databases with CDB (oravirt#383)
- 'molecule: Use shared inventory with download scenario (oravirt#383)'
- 'oracle_opatch: fix wrong rolling parameter definition, fix broken opatch
opatchauto rollback (oravirt#383)'
- 'oradb_datapatch: allow execution of role with empty oracle_databases and
oracle_pdbs (oravirt#383)'
- 'oradb_manage_db: Regather oradb_facts after database change (oravirt#383)'
- 'oradb_manage_statspack: Bugfix for nonCDB setups (oravirt#383)'
- 'orahost: Do not set NOZEROCONF on SuSE platform (oravirt#383)'
minor_changes:
- ansible-lint V6.20.3 (oravirt#383)
- 'molecule: new stage download to prepare dbfs stage (oravirt#383)'
- 'molecule: new stage golden to create golden images (oravirt#383)'
- 'oiraswgi: Added Support for gridSetup.sh -applyRU for 19c and 21c (oravirt#383)'
- 'oraasm_manage_diskgroups: Refactoring and bugfixes for 4.0 (oravirt#383)'
- 'oracle_opatch: replace sqlplus -V with oraversion for newer releases (oravirt#383)'
- 'oraswdb_golen_image: Rename created archive to fixed name (oravirt#383)'
- 'oraswgi_golen_image: Rename created archive to fixed name (oravirt#383)'
release_summary: This is a BETA Release of ansible-oracle. Do not use it in
production environments!
fragments:
- ansible-lint.yml
- assert.yml
- diskgroup.yml
- golden.yml
- manage_db.yml
- molecule1.yml
- nozeroconf.yml
- oracle_opatch.yml
- oraswgi.yml
- release_410.yml
- statspack.yml
release_date: '2023-11-08'
2 changes: 1 addition & 1 deletion changelogs/fragments/galaxy.aml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
minor_changes:
- "added missing dependencies in galay.yml and removed requirements.yml (oravirt#318)"
- "added missing dependencies in galay.yml and removed requirements.yml (oravirt#383)"
8 changes: 0 additions & 8 deletions changelogs/fragments/golden.yml

This file was deleted.

8 changes: 0 additions & 8 deletions changelogs/fragments/molecule1.yml

This file was deleted.

2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace: opitzconsulting
name: ansible_oracle
description: "Impoartant! This is a beta release! This is the collection of ansible-oracle from https://github.com/oravirt/ansible-oracle"
version: 4.0.0
version: 4.1.0
repository: https://github.com/oravirt/ansible-oracle.git
readme: README.md
authors:
Expand Down
29 changes: 23 additions & 6 deletions plugins/modules/oracle_opatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,30 @@ def get_version(module, msg, oracle_home):
Returns the DB server version
'''

command = '%s/bin/sqlplus -V' % (oracle_home)
(rc, stdout, stderr) = module.run_command(command)
if rc != 0:
msg = 'Error - STDOUT: %s, STDERR: %s, COMMAND: %s' % (stdout, stderr, command)
module.fail_json(msg=msg, changed=False)
def loc_exec_command(command):
(rc, stdout, stderr) = module.run_command(command)
if rc != 0:
msg = 'Error - STDOUT: %s, STDERR: %s, COMMAND: %s' % (
stdout,
stderr,
command,
)
module.fail_json(msg=msg, changed=False)
return rc, stdout

# 18c+ has a simpel way to detect the RDBMS Release
# We need this for gridSetup.sh -applyRU, because sqlplus
# is not executable at this stage!
oscommand = '%s/bin/oraversion' % (oracle_home)
if os.path.exists(oscommand):
(rc, stdout) = loc_exec_command('%s -baseVersion' % (oscommand))
if rc == 0:
return stdout[0:4]
else:
return stdout.split(' ')[2][0:4]
# Oracle < 18c do not have oraversion command!
(rc, stdout) = loc_exec_command('%s/bin/sqlplus -V' % (oracle_home))
if rc == 0:
return stdout.split(' ')[2][0:4]


def get_opatch_version(module, msg, oracle_home):
Expand Down
34 changes: 0 additions & 34 deletions roles/oraasm_manage_diskgroups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ Do not set them in inventory!
## Table of content

- [Requirements](#requirements)
- [Default Variables](#default-variables)
- [_oraasm_manage_diskgroups_asmdevice_list](#_oraasm_manage_diskgroups_asmdevice_list)
- [_oraasm_manage_diskgroups_attr_name](#_oraasm_manage_diskgroups_attr_name)
- [_oraasm_manage_diskgroups_attr_value](#_oraasm_manage_diskgroups_attr_value)
- [Discovered Tags](#discovered-tags)
- [Open Tasks](#open-tasks)
- [Dependencies](#dependencies)
- [License](#license)
- [Author](#author)
Expand All @@ -27,39 +22,10 @@ Do not set them in inventory!
- Minimum Ansible version: `2.9.0`


## Default Variables

### _oraasm_manage_diskgroups_asmdevice_list

#### Default value

```YAML
_oraasm_manage_diskgroups_asmdevice_list: internal use only
```

### _oraasm_manage_diskgroups_attr_name

#### Default value

```YAML
_oraasm_manage_diskgroups_attr_name: internal use only
```

### _oraasm_manage_diskgroups_attr_value

#### Default value

```YAML
_oraasm_manage_diskgroups_attr_value: internal use only
```

## Discovered Tags

**_diskgroup_**

## Open Tasks

- (bug): missing loop_control

## Dependencies

Expand Down
17 changes: 11 additions & 6 deletions roles/oraasm_manage_diskgroups/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
---
# @todo bug: missing loop_control

- name: oraasm_manage_diskgroups | Manage diskgroups
- name: Manage diskgroups
opitzconsulting.ansible_oracle.oracle_asmdg:
un: sys
pw: "{{ sysasmpassword }}"
sn: +ASM
host: "{{ oracle_hostname }}"
oh: "{{ oracle_home_gi }}"
name: "{{ item.diskgroup }}"
name: "{{ ad_loop.diskgroup }}"
disks: "{{ _oraasm_manage_diskgroups_asmdevice_list }}"
redundancy: "{{ item.redundancy | default(omit) }}"
redundancy: "{{ ad_loop.properties | map(attribute='redundancy') | first | default(omit) }}"
attribute_name: "{{ _oraasm_manage_diskgroups_attr_name | default(omit) }}"
attribute_value: "{{ _oraasm_manage_diskgroups_attr_value | default(omit) }}"
state: "{{ item.state }}"
state: "{{ ad_loop.state }}"
environment: "{{ _grid_env }}"
run_once: "{{ _oraswgi_meta_configure_cluster }}"
become: true
become_user: "{{ _grid_install_user }}"
with_items: "{{ asm_diskgroups }}"
loop_control:
loop_var: ad_loop
label: >-
diskgroup: {{ ad_loop.diskgroup | default('') }}
redundancy: {{ ad_loop.properties | map(attribute='redundancy') | first | default('') }}
state: {{ ad_loop.state | default('') }}
tags: diskgroup
49 changes: 31 additions & 18 deletions roles/oraasm_manage_diskgroups/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
---
# @var _oraasm_manage_diskgroups_asmdevice_list: $ "internal use only"
_oraasm_manage_diskgroups_asmdevice_list: "{% if device_persistence | lower == 'asmlib' %}\
{%- for disk in item.disk -%}{{ oracle_asm_disk_prefix }}{{ disk.asmlabel | upper }}\
{%- if not loop.last -%},{%- endif -%}\
{%- endfor %}\
{%- elif device_persistence | lower == 'asmfd' %}\
{%- for disk in item.disk -%}AFD:{{ disk.asmlabel | upper }}\
{%- if not loop.last -%},{%- endif -%}\
{%- endfor %}\
{%- elif device_persistence | lower == 'udev' %}\
{%- for disk in item.disk -%}{{ oracle_asm_disk_prefix }}{{ disk.asmlabel }}\
{%- if not loop.last -%},{%- endif -%}\
{%- endfor %}\
{%- endif %}"
_oraasm_manage_diskgroups_asmdevice_list: |-
{% if device_persistence == 'asmlib' %}
{%- for disk in ad_loop.disk %}{{ _oracle_asm_disk_prefix }}{{ disk.asmlabel | upper }}
{%- if not loop.last -%},{%- endif %}
{%- endfor %}
{%- elif device_persistence == 'asmfd' %}
{%- for disk in ad_loop.disk -%}AFD:{{ disk.asmlabel | upper }}
{%- if not loop.last -%},{%- endif -%}
{%- endfor %}
{%- elif device_persistence == 'udev' %}
{%- for disk in ad_loop.disk -%}{{ _oracle_asm_disk_prefix }}{{ disk.asmlabel }}
{%- if not loop.last -%},{%- endif -%}
{%- endfor %}
{%- endif %}

# @var _oraasm_manage_diskgroups_attr_name: $ "internal use only"
_oraasm_manage_diskgroups_attr_name: "{% if item.attributes is defined %}{{ item.attributes | default(omit) | map(attribute='name') | list }}{% else %}None{% endif %}"
_oraasm_manage_diskgroups_attr_name: |-
{% if ad_loop.attributes is defined %}
{{- ad_loop.attributes | default(omit) | map(attribute='name') | list }}
{%- else %}None{% endif %}

# @var _oraasm_manage_diskgroups_attr_value: $ "internal use only"
_oraasm_manage_diskgroups_attr_value: "{% if item.attributes is defined %}{{ item.attributes | default(omit) | map(attribute='value') | list }}{% else %}None{% endif %}"
_oraasm_manage_diskgroups_attr_value: |-
{% if ad_loop.attributes is defined %}
{{- ad_loop.attributes | default(omit) | map(attribute='value') | list }}
{%- else %}None{% endif %}

_oracle_asm_disk_prefix: |-
{%- if device_persistence == 'asmlib' %}
{%- if oracle_asm_disk_string.endswith('*') %}{{ oracle_asm_disk_string[:-1] }}
{%- else %}{{ oracle_asm_disk_string }}
{%- endif %}
{%- elif device_persistence == 'udev' %}{{ oracle_asm_disk_string }}
{%- else %}
{%- endif %}
2 changes: 2 additions & 0 deletions roles/oradb_datapatch/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
ansible.builtin.shell: "export PATH=${ORACLE_HOME}/bin:${PATH}; lsnrctl start {{ lsnrinst.listener_name }} /dev/null; exit 0"
# noqa no-changed-when
environment: "{{ oracle_env_lsnrctl }}"
become: true
become_user: "{{ oracle_user }}"
with_items: "{{ listener_installed }}"
loop_control:
Expand All @@ -22,6 +23,7 @@
db_unique_name: "{{ odb.oracle_db_unique_name | default(omit) }}"
sid: "{{ odb.oracle_db_instance_name | default(omit) }}"
state: started
become: true
become_user: "{{ oracle_user }}"
with_items: "{{ oracle_databases | selectattr('state', 'match', 'present') }}"
loop_control:
Expand Down
5 changes: 5 additions & 0 deletions roles/oradb_manage_db/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,8 @@
when: psout is defined
tags:
- psout

- name: Regather facts for Databases
ansible.builtin.import_role:
name: oradb_facts
allow_duplicates: true
1 change: 1 addition & 0 deletions roles/oradb_manage_db/tasks/manage-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
output: verbose
state: "{{ odb.state }}"
run_once: "{{ _oraswgi_meta_configure_cluster }}"
become: true
become_user: "{{ oracle_user }}"
when: odb.state == 'absent'
register: dbca_remove
Expand Down
10 changes: 10 additions & 0 deletions roles/oradb_manage_grants/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- odb.0.state == 'present'
- (odb.1.grants is defined or odb.1.object_privs is defined)
run_once: "{{ _oraswgi_meta_configure_cluster }}"
become: true
become_user: "{{ oracle_user }}"
loop_control:
loop_var: odb
Expand Down Expand Up @@ -62,7 +63,11 @@
- opdb.0 is defined
- opdb.0.state == 'present'
- (opdb.1.grants is defined or opdb.1.object_privs is defined)
- >-
oracle_databases | selectattr('oracle_db_name', 'match', opdb.0.cdb)
| map(attribute='state') | list | first == 'present'
run_once: "{{ _oraswgi_meta_configure_cluster }}"
become: true
become_user: "{{ oracle_user }}"
loop_control:
loop_var: opdb
Expand Down Expand Up @@ -103,6 +108,7 @@
- odb.0.state == 'present'
- (odb.1.grants is defined or odb.1.object_privs is defined)
run_once: "{{ _oraswgi_meta_configure_cluster }}"
become: true
become_user: "{{ oracle_user }}"
loop_control:
loop_var: odb
Expand Down Expand Up @@ -140,7 +146,11 @@
- opdb.0 is defined
- opdb.0.state == 'present'
- (opdb.1.grants is defined or opdb.1.object_privs is defined)
- >-
oracle_databases | selectattr('oracle_db_name', 'match', opdb.0.cdb)
| map(attribute='state') | list | first == 'present'
run_once: "{{ _oraswgi_meta_configure_cluster }}"
become: true
become_user: "{{ oracle_user }}"
loop_control:
loop_var: opdb
Expand Down
Loading
Loading