Skip to content

Instantly share code, notes, and snippets.

@roidelapluie
Created January 29, 2017 14:18
Show Gist options
  • Save roidelapluie/da65edcb23419eca203e67cad746a23f to your computer and use it in GitHub Desktop.
Save roidelapluie/da65edcb23419eca203e67cad746a23f to your computer and use it in GitHub Desktop.
From what I understand, munging is taking user input and transforming it.
Let's say Yum repos.
yum {
'puppetlabs':
enable => true,
}
But then, the yumrepo accepts true, false, 0, 1.
The provider says that it has:
yum {
'puppetlabs':
enable => 1,
}
How would Puppet know that this is the same, without trying to change the resource?
What am I missing?
@DavidS
Copy link

DavidS commented Jan 29, 2017

The data type for enable is Variant[Integer[0,1], Enum[true, false]]

implementation:

case target_state[:enable]
when 1, 'true'
  if missing create_and_log
  else return
when 0, 'false'
  if exists remove_and_log
  else return
end

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