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

1.1.0+ does not handle database host correctly. #255

Closed
jkroepke opened this issue Mar 12, 2017 · 4 comments
Closed

1.1.0+ does not handle database host correctly. #255

jkroepke opened this issue Mar 12, 2017 · 4 comments
Assignees

Comments

@jkroepke
Copy link
Contributor

Hi,

after upgrade this module from 1.0.2 to 1.1.1 this modules updates my ido mysql config:

Notice: /Stage[main]/Icinga2::Feature::Idomysql/Icinga2::Object[icinga2::object::IdoMysqlConnection::ido-mysql]/Concat[/etc/icinga2/features-available/ido-mysql.conf]/File[/etc/icinga2/features-available/i
do-mysql.conf]/content:
--- /etc/icinga2/features-available/ido-mysql.conf      2017-03-04 14:14:59.181792865 +0100
+++ /tmp/puppet-file20170312-10596-fk1m2m       2017-03-12 02:13:29.812298113 +0100
@@ -3,7 +3,7 @@


 object IdoMysqlConnection "ido-mysql"  {
-  host = "database.int.example.de"
+  host = database.int.example.de
   port = 3306

which results into this error:

root@icinga:~# icinga2 daemon -C
information/cli: Icinga application loader (version: r2.6.0-1)
information/cli: Loading configuration file(s).
information/ConfigItem: Committing config item(s).
critical/config: Error: Invalid field access (for value of type 'String'): 'int'
Location: in /etc/icinga2/features-enabled/ido-mysql.conf: 6:10-6:21
/etc/icinga2/features-enabled/ido-mysql.conf(4):
/etc/icinga2/features-enabled/ido-mysql.conf(5): object IdoMysqlConnection "ido-mysql"  {
/etc/icinga2/features-enabled/ido-mysql.conf(6):   host = database.int.example.de
                                                          ^^^^^^^^^^^^
/etc/icinga2/features-enabled/ido-mysql.conf(7):   port = 3306
/etc/icinga2/features-enabled/ido-mysql.conf(8):   user = "icinga"

critical/config: 1 error
@lbetz lbetz self-assigned this Mar 12, 2017
@lbetz lbetz added the bug label Mar 12, 2017
@lbetz
Copy link
Contributor

lbetz commented Mar 12, 2017

#246 considers all attributes to be not quoted in values. "database" is an attribute of object type IdoMysqlConnection, but must not include database*.

@lbetz
Copy link
Contributor

lbetz commented Mar 12, 2017

Depends on that database is an attribute and can be a hash maybe. And so it has to be possible to access a key of the hash like 'vars.os' or in this case database.whatever.

@lbetz
Copy link
Contributor

lbetz commented Mar 12, 2017

Quick fix for you, use the ip address instead of the fqdn. Sorry.

@bobapple bobapple added this to the v1.2.0 milestone Mar 13, 2017
@lbetz lbetz closed this as completed Mar 14, 2017
@lbetz
Copy link
Contributor

lbetz commented Mar 15, 2017

Please, try the current master branch.

Now database.* is interpreted as hash if database is a hash as object attribute or constant.

Now it's also possible to use
host => '-:"database.int.example.de"'
to disable the parsing for host.

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

No branches or pull requests

3 participants