Skip to content

Conversation

@oraculix
Copy link
Contributor

@oraculix oraculix commented Mar 7, 2025

There is an issue when you run Playbooks that call the role "oradb_manage_pdb", when these are run on non-CDB databases.

  • The task manage pdb(s) enters the with_nested: loop, despite the condition when: oracle_pdbs is defined.
  • The reason is that the when part is evaluated after parsing the loop variables. This results in the error:
    msg: '''oracle_pdbs'' is undefined. ''oracle_pdbs'' is undefined'
  • This is expected behaviour of Ansible. See Using Conditionals in Loops in the Ansible docs.
  • Workarounds:
    • Use --skip-tags "pdb" when running affected playbooks (e.g. "opatch.yml").
    • Remove or comment out the calls to "oradb_manage_pdb". But this isn't viable when running playbooks in a mixed CDB / non-CDB environment.
  • Fix: Define an empty list as a default for oracle_pdbs in the with_nested: clause.

I filed it as a "minor change"; feel free to classify it as a bugfix.

@Rendanic Rendanic self-assigned this Mar 7, 2025
@Rendanic Rendanic added the bug label Mar 7, 2025
@Rendanic Rendanic merged commit 8eaa242 into oravirt:master Mar 17, 2025
6 checks passed
Rendanic added a commit to Rendanic/ansible-oracle that referenced this pull request Mar 30, 2025
v4.13.0
=======

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

- Added a guide on how to install Ansible-Oracle manually on a server without Internet access. (oravirt#506)
- Fix typo for sql_zauberkasten (oravirt#509)
- ansible-lint: more excludes (oravirt#505)
- create OMF enabled databases using dbca's -useOMF flag (oravirt#507)
- manage_pdb: Enter nested loop only when oracle_pdbs has an entry (oravirt#507)
- oraapex: Added missing option to copy source from remote or local host (oravirt#512)
- oradb_manage_db: make hard coded folder .Scripts configurable (oravirt#511)
- oradb_tzupgrade: Add orasw_meta_internal as a dependent role (oravirt#510)

Bugfixes
--------

- orahost_meta: move scripts_folder variable from common to orahost_meta (oravirt#504)
@Rendanic Rendanic mentioned this pull request Mar 30, 2025
Rendanic added a commit that referenced this pull request Mar 30, 2025
v4.13.0
=======

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

- Added a guide on how to install Ansible-Oracle manually on a server without Internet access. (#506)
- Fix typo for sql_zauberkasten (#509)
- ansible-lint: more excludes (#505)
- create OMF enabled databases using dbca's -useOMF flag (#507)
- manage_pdb: Enter nested loop only when oracle_pdbs has an entry (#507)
- oraapex: Added missing option to copy source from remote or local host (#512)
- oradb_manage_db: make hard coded folder .Scripts configurable (#511)
- oradb_tzupgrade: Add orasw_meta_internal as a dependent role (#510)

Bugfixes
--------

- orahost_meta: move scripts_folder variable from common to orahost_meta (#504)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants