chrnie / ansible-role-icinga2

install icinga2 on rhel or debian
Apache License 2.0
2 stars 6 forks source link

IDO Setup: Import icinga2 schema #3

Open cstegm opened 6 years ago

cstegm commented 6 years ago

The Task "Import icinga2 schema" and maybe other mysql related tasks cannot be executed when the mysql users are setup with "REQUIRE SSL"

TinajaLabs commented 5 years ago

I'm having the same issue:

fatal: [mon]: FAILED! => {"msg": "The conditional check 'table_exists.stdout == \"\"' failed.

The error was:

error while evaluating conditional (table_exists.stdout == \"\"):
 'dict object' has no attribute 'stdout'\n\n
The error appears to have been in 
../roles/chrnie.icinga2/tasks/feature_ido-mysql.yml': 
line 49, column 3, but maybe elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:\n\n\n- name: Import icinga2 schema\n  ^ here\n"}

Seems it is a problem with TASK [chrnie.icinga2 : Check IDO schema version in MySQL (no ssl)]

That task is supposed to register a variable, table_exists. There is another task, Check IDO schema version in MySQL (ssl), which is skipped because icinga2_ido_options.ssl_key is defined as false.

I think, if TASK [chrnie.icinga2 : Check IDO schema version in MySQL (ssl)] does not execute, it does not create, or overwrites table_exists.stdout.

I tested this by creating a differently named variable, table_exists_nossl and testing for that one in TASK [chrnie.icinga2 : Import icinga2 schema] and it worked. So need to rework the Import icinga2 schema to work with either of the check schema routines.