Skip to content

Instantly share code, notes, and snippets.

View ody's full-sized avatar

Cody Herriges ody

  • Puppet Labs
  • Oregon, United States of America
View GitHub Profile
plan ntp(
TargetSpec $nodes
) {
apply($nodes, _catch_errors => true, _run_as => root) {
class { 'ntp':
servers => [ 'ntp1.example.com', 'ntp2.example.com' ],
}
}
[cody@pe-mom1-prod ~]$ puppet job run --environment test_application --concurrency 1 "Openstack[slice-pdx1-test]"
Starting deployment of Openstack[slice-pdx1-test] ...
+-------------------+----------------------------+
| Job ID | 27 |
| Environment | test_application |
| Target | Openstack[slice-pdx1-test] |
| Concurrency Limit | 1 |
| Nodes | 9 |
+-------------------+----------------------------+
##
#
define foo(
$a,
$b = "a is ${a}",
) {
notify { $b: }
}
##
#
class openstacklib::params {
$servicedefault = '<SERVICE DEFAULT>'
}
##
#
class nova::params inherits ::openstacklib::params {
[root@megacon1 yum.repos.d]# openstack help project list
usage: openstack project list [-h] [-f {csv,table}] [-c COLUMN]
[--max-width <integer>]
[--quote {all,minimal,none,nonnumeric}] [--long]
List projects
optional arguments:
-h, --help show this help message and exit
--long List additional fields in output
$dns_hosts = [{
'title' => 'test-1a-record.testme.puppetlabs.net',
'parameters' => {
"domain"=>"testme.puppetlabs.net",
"ddns_key"=>"/etc/bind/keys.d/dhcp_updater",
"customername"=>"puppetlabs",
"ttl"=>"4800", "provider"=>"bind",
"username"=>"puppetlabs",
"content"=>"172.16.100.150",
"type"=>"A",
input {
s3 {
bucket => 'example-cloudtrail'
codec => cloudtrail {}
credentials => "/opt/aws_creds"
region_endpoint => "us-west-2"
type => "cloudtrail"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<statsfeeder>
<numberOfThreads>10</numberOfThreads>
<frequency unit="second">600</frequency>
<feeder>true</feeder>
<csvOutput>true</csvOutput>
<receivers>
<receiver>
<name>csvOutput</name>
<class>com.vmware.ee.statsfeeder.CSVFileStatsReceiver</class>
vim = RbVmomi::VIM.connect(:host => 'vcenter.puppetlabs.net', :user => 'cody@puppetlabs.com', :password => 'foo', :insecure => true)
vim.searchIndex.FindByInventoryPath(:inventoryPath => 'pdx_office/vm/Business Development/cody/infrastructure/pm1').name
@ody
ody / gist:5846573
Last active December 18, 2015 21:19
Equivalent to `puppet cert list`
[root@puppetmaster ~]# curl --cert /etc/puppetlabs/puppet/ssl/certs/puppetmaster.local.puppetlabs.net.pem --key /etc/puppetlabs/puppet/ssl/private_keys/puppetmaster.local.puppetlabs.net.pem --cacert /etc/puppetlabs/puppet/ssl/ca/ca_crt.pem -H 'Accept: yaml' https://puppetmaster.local.puppetlabs.net:8140/production/certificate_requests/all
---
- !ruby/object:Puppet::SSL::CertificateRequest
name: foo.local.puppetlabs.net
content: !ruby/object:OpenSSL::X509::Request {}
expiration: 2013-06-23 14:22:46.306077 -07:00