-
How to separate nodes, platforms and drivers when writing a test plan? See https://groups.google.com/a/puppet.com/d/msg/dept-quality-engineering-archive/r7q179wG-s0/q51jJmeqEwAJ for background
-
declarativesystems/puppet_vagrant is a good starting point for vagrant support
- how to extract connection info from resource?
-
See this example and this function to check out how more nodes can be added to the inventory dynamically.
-
The core
get_targets
call traces through to inventory.rb#L85 and creates [bolt's target.rb](https://github.com/puppet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
david@davids:~/tmp$ pdk new module --template-url https://github.com/DavidS/modulesync_config/ --template-ref test --skip-interview foo-foo | |
pdk (INFO): Creating new module: foo-foo | |
[✔] Installing missing Gemfile dependencies. | |
pdk (INFO): Module 'foo' generated at path '/home/david/tmp/foo', from template 'https://github.com/DavidS/modulesync_config/'. | |
pdk (INFO): In your module directory, add classes with the 'pdk new class' command. | |
david@davids:~/tmp$ find foo/ | |
foo/ | |
foo/metadata.json | |
foo/templates | |
foo/manifests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'something' do | |
let(:route) { instance_double('Net::IP::Route', 'route') } | |
before(:each) do | |
allow(Net::IP::Route).to receive(:new).with({ test: 'data' }).and_return(route) | |
end | |
it 'doesn't suck' do | |
expect(Net::IP).to receive(:routes).with(route) | |
provider.create(context, name, {input: 'foo'}) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'puppet/resource_api' | |
Puppet::ResourceApi.register_type( | |
name: 'file_test', | |
docs: <<-EOS, | |
This type provides Puppet with the capabilities to manage ... | |
EOS | |
features: [], | |
title_patterns: [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file was automatically generated on 2017-08-01 17:47:49 +0100. | |
# Use the 'puppet generate types' command to regenerate this file. | |
# This type provides Puppet with the capabilities to manage GPG keys needed | |
# by apt to perform package validation. Apt has it's own GPG keyring that can | |
# be manipulated through the `apt-key` command. | |
# | |
# apt_key { '6F6B15509CF8E59E6E469F327F438280EF8D349F': | |
# source => 'http://apt.puppetlabs.com/pubkey.gpg' | |
# } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deb http://deb.debian.org/debian stretch main | |
deb http://deb.debian.org/debian stretch-updates main | |
deb http://security.debian.org/ stretch/updates main |
Draft for new type and provider API
Hi *,
The type and provider API has been the bane of my existence since I started writing native resources. Now, finally, we'll do something about it. I'm currently working on designing a nicer API for types and providers. My primary goals are to provide a smooth and simple ruby developer experience for both scripters and coders. Secondary goals were to eliminate server side code, and make puppet 4 data types available. Currently this is completely aspirational (i.e. no real code has been written), but early private feedback was encouraging.
To showcase my vision, this gist has the apt_key type and provider ported over to my propo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Puppet::SimpleResource.define( | |
name: 'iis_application_pool', | |
docs: 'Manage an IIS application pool through a powershell proxy.', | |
attributes: { | |
ensure: { | |
type: 'Enum[present, absent]', | |
docs: 'Whether this ApplicationPool should be present or absent on the target system.' | |
}, | |
name: { | |
type: 'String', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $resources = hiera_hash('resources') | |
$resources = { | |
'postgresql::database' => { | |
'db1' => { db1 params }, | |
}, | |
# ... | |
} | |
create_create_resources($resources) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@localhost:~/tmp$ cat case.pp | |
warning("\$::kernel == '${::kernel}'") | |
case $::kernel { | |
default: { warning('default/Linux - default matched') } | |
Linux: { warning('default/Linux - Linux matched') } | |
} | |
case $::kernel { | |
default: { warning('default/\'Linux\' - default matched') } |
NewerOlder