Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Puppet Camp Dallas 2014: Replacing Simple Puppet Modules with Providers
1. Replacing simple modules with
Custom Types and Providers
Or Stop managing templates, and start managing your configs
2. 2
Greg Swift
Linux Admin/Engineer ~ 12 yrs
Red Hat Certified Engineer ~ 6 yrs
Augeas user ~6 yrs
Puppet user ~ 3 yrs
greg.swift@{rackspace.com,nytefyre.net}
google.com/+GregSwift
linkedin.com/gregoryswift
github.com/{gregswift,rackergs}
xaeth on Fedora, FreeNode, Twitter, and Ingress
3. 3
Bit of time travel...
•Past
–An unpleasant reminder of configs past
•Present
–Tools available today that help
•Future
–What's next?
6. 6
Lets change that value
sed i 's/^(kernel.msgmnb = )([09]*)$/## Changing
for db configuration. Was:n## 12n199999/'
sysctl.conf
7. 7
Looks good so far...
# Controls the default maximum size of a message queue
## Changing for db configuration. Was:
## kernel.msgmnb = 65536
kernel.msgmnb = 99999
8. 8
But the next run?
# Controls the default maximum size of a message queue
## Changing for db configuration. Was:
## ## Changing for db configuration. Was:
## kernel.msgmnb = 65536
kernel.msgmnb = 99999
## Changing for db configuration. Was:
## kernel.msgmnb = 99999
kernel.msgmnb = 99999
15. 15
What is it?
•An API provided by a C library
•A domain-specific language to describe configuration file
formats, presented as lenses
•Canonical tree representations of configuration files
•A command line tool to manipulate configuration from
the shell and shell scripts
•Language bindings to do the same from your favorite
scripting language
24. 24
Introducing AugeasProviders
•Collection of custom types and providers
•Written in native Ruby rather than Puppet's DSL
•Utilizes bindings directly for flexibility
•Heavily tested
25. 25
And that example on AugeasProviders
sysctl { 'kernel.msgmnb':
value => '99999',
comment => 'recommended by db vendor'
}
26. 26
And the more complex example
$sshd_default_groups = ['engineers', 'admins']
$sshd_allowed_groups = $::env ? {
/prod/ => $sshd_default_groups,
default => concat($sshd_default_groups, ['devs']),
}
sshd_config { 'AllowGroups':
value => $sshd_allowed_groups,
notify => Service['sshd'],
}
36. 36
Augeas training
•Provided by camptocamp
•http://camptocamp.com
– Solutions->Infrastructure->Training
•Fundamentals
–Using augtool, XPath Augeas language, Augeas type
in Puppet
•Advanced
– Develop using augeas libraries and advanced tree
manipulation
•Extending Augeas
–Writing lenses and providers