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

Allow dots in data structures of object attributes #509

Closed
dagobert opened this issue Jan 1, 2019 · 4 comments
Closed

Allow dots in data structures of object attributes #509

dagobert opened this issue Jan 1, 2019 · 4 comments
Assignees
Labels
Milestone

Comments

@dagobert
Copy link

dagobert commented Jan 1, 2019

I have setup a host object as follows. The problem is that `bond1.50 is translated wrongly to the icinga2 configuration file.

  icinga2::object::host { 'myhost':
    target => '/etc/icinga2/conf.d/host__myhost.conf',
    import => [ 'generic-host', ],
    display_name         => 'myhost',
    address         => '10.1.0.1',
    groups               => [ 'routers', ],
    vars => {
      ip_addresses     => {
        'bond1.50' => '10.1.0.1',
      },
      general_services => [ 'ssh', ],
    },
  }

It is double quoted twice.

object Host "myhost"  {
  import "generic-host"

  address = "10.1.0.1"
  groups = [ "routers",  ]
  display_name = "myhost"
  vars.ip_addresses[""bond1.50""] = "10.1.0.1"
  vars.general_services = [ "ssh", ]
}

Expected Behavior

The correct behaviour should be only double quoted once.

Possible Solution

I have tried to use the '-:"abc" method but it did not work as I also already expected.
Not using single quotes in the puppet configuration also does not work since there is a dot in the key name.

Your Environment

  • Module version (puppet module list):
    ├── dwerder-graphite (v7.3.0)
    ├── example42-dhcpd (v2.0.16)
    ├── example42-firewall (v2.1.3)
    ├── example42-iptables (v2.1.15)
    ├── example42-logrotate (v2.0.19)
    ├── example42-monit (v2.0.18)
    ├── example42-monitor (v2.0.4)
    ├── example42-mysql (v2.1.8)
    ├── example42-network (v3.5.0)
    ├── example42-nrpe (v2.0.18)
    ├── example42-ntp (v2.0.16)
    ├── example42-openssh (v2.0.11)
    ├── example42-postfix (v2.0.22)
    ├── example42-puppi (v2.2.6)
    ├── example42-rsyslog (v2.0.15)
    ├── example42-snmpd (v2.0.16)
    ├── example42-sudo (v2.0.19)
    ├── example42-timezone (v2.0.16)
    ├── example42-tinydata (v0.3.1)
    ├── example42-tp (v2.3.1)
    ├── icinga-icinga2 (v1.3.7)
    ├── icinga-icingaweb2 (v2.2.0)
    ├── mybase (???)
    ├── puppetlabs-apt (v6.2.1)
    ├── puppetlabs-concat (v4.2.1)
    ├── puppetlabs-stdlib (v4.25.1)
    ├── puppetlabs-translate (v1.2.0)
    └── puppetlabs-vcsrepo (v2.4.0)

  • Puppet version (puppet -V): 5.5.8

  • Operating System and version: Debian 9

@lbetz lbetz self-assigned this Jan 2, 2019
@lbetz lbetz added this to the v1.4.0 milestone Jan 2, 2019
@lbetz lbetz changed the title Bug when using a dot in vars => { 'key.key' => 'myvalue' } Allow dots in object attributes Jan 2, 2019
@lbetz
Copy link
Contributor

lbetz commented Jan 2, 2019

That's not a bug. At the moment just a string of a-zA-Z0-9_ is permitted as attribute or custom attribute names.

-: only works for values of attributes or custom attributes not for itself.

@lbetz lbetz added bug and removed enhancement labels Jan 2, 2019
@lbetz
Copy link
Contributor

lbetz commented Jan 2, 2019

Sorry, my answer was too fast. You describe an error outside of any attribute or custom attribute.

Please checkout the related branch and test your config.

@lbetz lbetz changed the title Allow dots in object attributes Allow dots in data structures of object attributes Jan 2, 2019
@dagobert
Copy link
Author

dagobert commented Jan 2, 2019

I would be happy to test the fix. I have installed the module using puppet module install. Can you tell me which --version I have to specify to install the fix / branch?

@lbetz
Copy link
Contributor

lbetz commented Jan 2, 2019

The branch is only available on github.

cd modules
git clone https://github.com/Icinga/puppet-icinga2.git icinga2
cd icinga2
git checkout bug/Allow-dots-in-data-structures-of-object-attributes-509

what's all

@lbetz lbetz closed this as completed in 6d283f3 Jan 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants