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

fix for re global flags expression #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

talek
Copy link
Contributor

@talek talek commented Nov 7, 2024

Hello,

When trying to provision a new Oracle setup, the following error is raised:

TASK [opitzconsulting.ansible_oracle.orahost_meta : Extract SGA parameters, choose sga_max_size over sga_target if both are definied] ***
task path: /Users/talek/.ansible/collections/ansible_collections/opitzconsulting/ansible_oracle/roles/orahost_meta/tasks/main.yml:41 
Thursday 07 November 2024  18:43:16 +0200 (0:00:00.029)       0:00:12.053 *****                                                                                                                                                                                         
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: re.error: global flags not at the start of the expression at position 1
fatal: [mol-main-abc]: FAILED! => {"msg": "Unexpected failure during module execution: global flags not at the start of the expression at position 1", "stdout": ""}

It seems that Ansible/Python is picky and expects that the global (?i) option to be specified at the very beginning of the regex:

talek@MacBookPro ~ % ansible -m debug localhost -a "msg='{{ 'SGA_target' | regex_search('^(?i)sga_target$') }}'"
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: re.error: global flags not at the start of the expression at position 1
localhost | FAILED! => {
    "changed": false
}
talek@MacBookPro ~ % ansible -m debug localhost -a "msg='{{ 'SGA_target' | regex_search('(?i)^sga_target$') }}'"
localhost | SUCCESS => {
    "msg": "SGA_target"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant