Page MenuHomePhabricator

Labs puppet ENC scrambles booleans
Closed, ResolvedPublic

Description

I have the use_dnsmasq setting set to true in ldap, but after passing through the ENC it is read as a string, 'true'. That has a different value from the boolean (because puppet is terrible) and breaks a bunch of things.

Event Timeline

Andrew assigned this task to yuvipanda.
Andrew raised the priority of this task from to Needs Triage.
Andrew updated the task description. (Show Details)
Andrew subscribed.

Apparently even if something is set as use_dnsmasq: true in the hiera file the ENC reads it as a string.

Change 202278 had a related patch set uploaded (by Yuvipanda):
base: Allow hiera to override ldap use_dnsmasq variable

https://gerrit.wikimedia.org/r/202278

Change 202278 merged by Yuvipanda:
base: Allow hiera to override ldap use_dnsmasq variable

https://gerrit.wikimedia.org/r/202278

Nope but dnsmasq errors fixed for now. I'll take a look at the underlying
issue today.

FWIW puppet's internal ldap isn't that sophisticated:

Grabs all puppetvar values and splits them on '=' (just like the python enc):
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/indirector/node/ldap.rb#L96-L111

Then runs everything through a "convert" function:
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/indirector/node/ldap.rb#L166-L174

Change 202613 had a related patch set uploaded (by Yuvipanda):
puppetmaster: Guess int/bool types from ldap variable values

https://gerrit.wikimedia.org/r/202613

Change 202613 merged by Yuvipanda:
puppetmaster: Guess int/bool types from ldap variable values

https://gerrit.wikimedia.org/r/202613

root@staging-palladium:/var/lib/git/operations/puppet# /usr/local/bin/ldap-yaml-enc.py $(facter -p ec2id).$(facter -p domain)
classes: [base, 'role::labs::instance', 'puppetmaster::autosigner', 'role::ipmi',
  'salt::master', 'role::deployment::salt_masters', 'role::puppet::self']
parameters: {instancename: staging-palladium, instanceproject: staging, realm: labs,
  use_dnsmasq: true}

(Note the boolean true for use_dnsmasq). All good now? :)