Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

"msg": "The conditional check 'master_node' failed. with multiple warning #9

Open
amrutharaod opened this issue Jul 24, 2020 · 3 comments

Comments

@amrutharaod
Copy link

Dear CruGlobal,

I am getting below warnings and errors, could you please help me to troubleshoot this.

[oracle@pluto1226 ar_scripts]$ ansible-playbook 12c_1_pre_upgrade.yml [WARNING]: * Failed to parse /home/oracle/ar_scripts/12c_1_pre_upgrade.yml with yaml plugin:
YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/12c_1_pre_upgrade.yml with ini plugin:
/home/oracle/ar_scripts/12c_1_pre_upgrade.yml:2: Expected key=value host variable assignment, got:
hosts:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/12c_1_pre_upgrade.yml with auto plugin:
'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/12c_1_pre_upgrade.yml as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/my_name.yml with yaml plugin: YAML
inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/my_name.yml with ini plugin:
/home/oracle/ar_scripts/my_name.yml:2: Expected key=value host variable assignment, got: hosts:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/my_name.yml with auto plugin:
'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/my_name.yml as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/myphy/airandom.py with script plugin:
problem running /home/oracle/ar_scripts/myphy/airandom.py --list ([Errno 8] Exec format error)

[WARNING]: * Failed to parse /home/oracle/ar_scripts/myphy/airandom.py with ini plugin:
/home/oracle/ar_scripts/myphy/airandom.py:1: Expected key=value host variable assignment, got:
random

[WARNING]: Unable to parse /home/oracle/ar_scripts/myphy/airandom.py as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/myphy/cards.py with ini plugin:
/home/oracle/ar_scripts/myphy/cards.py:1: Expected key=value host variable assignment, got:
unicards

[WARNING]: Unable to parse /home/oracle/ar_scripts/myphy/cards.py as an inventory source

[WARNING]: Unable to parse /home/oracle/ar_scripts/myphy as an inventory source

[WARNING]: Skipping 'upgrade_tzv' as this is not a valid group definition

[WARNING]: Skipping 'upgrade' as this is not a valid group definition

[WARNING]: Skipping 'upgrade_final' as this is not a valid group definition

[WARNING]: Skipping 'pre_upgrade' as this is not a valid group definition

[WARNING]: Skipping 'oracle_stage_base' as this is not a valid group definition

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/files/upg_tzv_apply.sql
with script plugin: problem running /home/oracle/ar_scripts/roles/db-
upgrade/files/upg_tzv_apply.sql --list ([Errno 8] Exec format error)

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/files/upg_tzv_apply.sql
with ini plugin: /home/oracle/ar_scripts/roles/db-upgrade/files/upg_tzv_apply.sql:2: Expected
key=value host variable assignment, got: Copyright

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/files/upg_tzv_apply.sql as an
inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/files/upg_tzv_check.sql
with script plugin: problem running /home/oracle/ar_scripts/roles/db-
upgrade/files/upg_tzv_check.sql --list ([Errno 8] Exec format error)

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/files/upg_tzv_check.sql
with ini plugin: /home/oracle/ar_scripts/roles/db-upgrade/files/upg_tzv_check.sql:2: Expected
key=value host variable assignment, got: Copyright

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/files/upg_tzv_check.sql as an
inventory source

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/files as an inventory source

[WARNING]: Skipping 'dependencies' as this is not a valid group definition

[WARNING]: Skipping unexpected key (company) in group (galaxy_info), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping unexpected key (min_ansible_version) in group (galaxy_info), only "vars",
"children" and "hosts" are valid

[WARNING]: Skipping unexpected key (description) in group (galaxy_info), only "vars", "children"
and "hosts" are valid

[WARNING]: Skipping unexpected key (license) in group (galaxy_info), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping unexpected key (author) in group (galaxy_info), only "vars", "children" and
"hosts" are valid

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/2 with yaml plugin:
YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/2 with ini plugin:
/home/oracle/ar_scripts/roles/db-upgrade/tasks/2:2: Expected key=value host variable assignment,
got: name:

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/2 as an inventory
source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/get_unique_name.yml
with yaml plugin: YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/get_unique_name.yml
with ini plugin: /home/oracle/ar_scripts/roles/db-upgrade/tasks/get_unique_name.yml:3: Expected
key=value host variable assignment, got: name:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/get_unique_name.yml
with auto plugin: 'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/get_unique_name.yml as
an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/main.yml with yaml
plugin: YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/main.yml with ini
plugin: /home/oracle/ar_scripts/roles/db-upgrade/tasks/main.yml:2: Expected key=value host
variable assignment, got: name:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/main.yml with auto
plugin: 'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/main.yml as an
inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_checks.yml with
yaml plugin: YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_checks.yml with
ini plugin: /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_checks.yml:3: Expected key=value
host variable assignment, got: name:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_checks.yml with
auto plugin: 'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_checks.yml as an
inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_upgrade.yml with
yaml plugin: YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_upgrade.yml with
ini plugin: /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_upgrade.yml:2: Expected key=value
host variable assignment, got: name:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_upgrade.yml with
auto plugin: 'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_upgrade.yml as an
inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade.yml with
yaml plugin: YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade.yml with ini
plugin: /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade.yml:4: Expected key=value host
variable assignment, got: name:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade.yml with
auto plugin: 'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade.yml as an
inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_final.yml
with yaml plugin: YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_final.yml
with ini plugin: /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_final.yml:3: Expected
key=value host variable assignment, got: name:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_final.yml
with auto plugin: 'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_final.yml as an
inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_tzv.yml with
yaml plugin: YAML inventory has invalid structure, it should be a dictionary, got: <class
'ansible.parsing.yaml.objects.AnsibleSequence'>

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_tzv.yml with
ini plugin: /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_tzv.yml:5: Expected key=value
host variable assignment, got: name:

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_tzv.yml with
auto plugin: 'AnsibleSequence' object has no attribute 'get'

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks/upgrade_tzv.yml as an
inventory source

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/tasks as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/db_unique_name.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/db_unique_name.j2:1: Expected key=value host variable assignment, got: -s

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/templates/db_unique_name.j2
as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/enable_archivelog.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/enable_archivelog.j2:1: Expected key=value host variable assignment, got: mount;

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/enable_archivelog.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/enable_flashback_database.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/enable_flashback_database.j2:1: Expected key=value host variable assignment,
got: linesize

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/enable_flashback_database.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/final_upgrade_backup_0.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/final_upgrade_backup_0.j2:1: Expected key=value host variable assignment, got:
target

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/final_upgrade_backup_0.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/post_upgrade_tasks.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/post_upgrade_tasks.j2:1: Expected key=value host variable assignment, got:
linesize

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/post_upgrade_tasks.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_0.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_0.j2:1: Expected key=value host variable assignment, got:
target

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_0.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_0_dw.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_0_dw.j2:1: Expected key=value host variable assignment, got:
target

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_0_dw.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_1.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_1.j2:1: Expected key=value host variable assignment, got:
target

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_1.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_1_dw.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_1_dw.j2:1: Expected key=value host variable assignment, got:
target

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_backup_1_dw.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_tasks.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_tasks.j2:1: Expected key=value host variable assignment, got:
linesize

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/pre_upgrade_tasks.j2 as an inventory source

[WARNING]: * Failed to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/upgrade_final_tasks.j2 with ini plugin: /home/oracle/ar_scripts/roles/db-
upgrade/templates/upgrade_final_tasks.j2:1: Expected key=value host variable assignment, got:
RESTORE

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-
upgrade/templates/upgrade_final_tasks.j2 as an inventory source

[WARNING]: Unable to parse /home/oracle/ar_scripts/roles/db-upgrade/templates as an inventory
source

[WARNING]: Skipping unexpected key (PATH) in group (env_old), only "vars", "children" and "hosts"
are valid

[WARNING]: Skipping unexpected key (ORACLE_SID) in group (env_old), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping unexpected key (TNS_ADMIN) in group (env_old), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping unexpected key (ORACLE_BASE) in group (env_old), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping unexpected key (ORACLE_HOME) in group (env_old), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping 'oracle_stage' as this is not a valid group definition

[WARNING]: Skipping 'oracle_home' as this is not a valid group definition

[WARNING]: Skipping 'oracle_home_old' as this is not a valid group definition

[WARNING]: Skipping 'master_node' as this is not a valid group definition

[WARNING]: Skipping 'oracle_version' as this is not a valid group definition

[WARNING]: Skipping unexpected key (PATH) in group (env), only "vars", "children" and "hosts" are
valid

[WARNING]: Skipping unexpected key (ORACLE_SID) in group (env), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping unexpected key (TNS_ADMIN) in group (env), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping unexpected key (ORACLE_BASE) in group (env), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping unexpected key (ORACLE_HOME) in group (env), only "vars", "children" and
"hosts" are valid

[WARNING]: Skipping 'oracle_sid' as this is not a valid group definition

[WARNING]: Skipping 'oracle_version_old' as this is not a valid group definition

PLAY [apps1159] ***********************************************************************************

TASK [Gathering Facts] ****************************************************************************
ok: [apps1159]

TASK [db-upgrade : Create a directory if it does not exist] ***************************************
changed: [apps1159]

TASK [db-upgrade : fail if required variables are not defined] ************************************
fatal: [apps1159]: FAILED! => {"msg": "The conditional check 'master_node' failed. The error was: error while evaluating conditional (master_node): is undefined\n\nThe error appears to have been in '/home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_checks.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: fail if required variables are not defined\n ^ here\n"}
to retry, use: --limit @/home/oracle/ar_scripts/12c_1_pre_upgrade.retry

PLAY RECAP ****************************************************************************************
apps1159 : ok=2 changed=1 unreachable=0 failed=1

[oracle@pluto1226 ar_scripts]$

@mikealbert
Copy link
Contributor

Hi,

We use the master_node flag so some tasks only run against 1 node when we upgrade a RAC database. For example, this block does backups and sets cluster_database=false so it only needs to be run once and not from each node.

https://github.com/CruGlobal/ansible-oracle-db-upgrade/blob/master/tasks/upgrade.yml#L4-L65

You can set this flag in a few different places, but we typically put it in the inventory so something like <my_inventory>/host_vars/<hostname>.

Sorry, looks those details are missing from our readme. We'll try to get that updated or if you want to send in a PR that works too.

@amrutharaod
Copy link
Author

Hi Mike,

Thanks for your reply appreciate it. My bad still I could not able to figure out whats going wrong. I am getting below error, could you please help me on this.

[oracle@pluto1226 ar_scripts]$ cat roles/db-upgrade/vars/main.yml

Variables for db-upgrade ansible role

oracle_stage: "{{ oracle_stage_base }}/{{ oracle_version }}_upgrade/{{ db_name }}"
oracle_sid: "{{ db_name }}{{ host_num |default('') }}"
master_node: true
cluster_database: false

oracle_version: 19.0.0
oracle_home: "/app/oracle/{{ oracle_version }}/dbhome_1"
env:
ORACLE_HOME: "{{ oracle_home }}"
ORACLE_BASE: "{{ oracle_base }}"
ORACLE_SID: "{{ oracle_sid }}"
TNS_ADMIN: "{{ tns_admin }}"
PATH: "{{ oracle_home }}/bin:{{ oracle_home }}/OPatch:$PATH:/bin:/usr/bin::/usr/ccs/bin"

oracle_version_old: 11.2.0.4
oracle_home_old: "/app/oracle/{{ oracle_version_old }}/dbhome_1"
env_old:
ORACLE_HOME: "{{ oracle_home_old }}"
ORACLE_BASE: "{{ oracle_base }}"
ORACLE_SID: "{{ oracle_sid }}"
TNS_ADMIN: "{{ tns_admin }}"
PATH: "{{ oracle_home_old }}/bin:{{ oracle_home_old }}/OPatch:$PATH:/bin:/usr/bin::/usr/ccs/bin"
[oracle@pluto1226 ar_scripts]$

Error:

TASK [Gathering Facts] ****************************************************************************
ok: [apps1159]

TASK [db-upgrade : Create a directory if it does not exist] ***************************************
ok: [apps1159]

TASK [db-upgrade : fail if required variables are not defined] ************************************
[WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {%
%}. Found: {{ item }} is not defined

failed: [apps1159] (item=oracle_install_type) => {"changed": false, "item": "oracle_install_type", "msg": "oracle_install_type is not defined for apps1159"}
skipping: [apps1159] => (item=oracle_version)
skipping: [apps1159] => (item=db_name)
fatal: [apps1159]: FAILED! => {"msg": "The conditional check '{{ item }} is not defined' failed. The error was: error while evaluating conditional ({{ item }} is not defined): 'database_parameters' is undefined\n\nThe error appears to have been in '/home/oracle/ar_scripts/roles/db-upgrade/tasks/pre_checks.yml': line 3, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: fail if required variables are not defined\n ^ here\n"}
to retry, use: --limit @/home/oracle/ar_scripts/12c_1_pre_upgrade.retry

PLAY RECAP ****************************************************************************************
apps1159 : ok=2 changed=0 unreachable=0 failed=1

[oracle@pluto1226 ar_scripts]$

@mikealbert
Copy link
Contributor

Looks like this is due to another variable that needs to be defined - oracle_install_type. The 2 values we use for that are si_asm for single instance databases w/ASM and rac for Oracle RAC databases. There are a bunch of different spots where tasks are run differently depending on if the db is si or rac. We also set some backup threading differently based on that.

Sorry again the documentation is in a poor state. Let me know if you run into any other issues.

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

No branches or pull requests

2 participants