Skip to content

Instantly share code, notes, and snippets.

View michaeltchapman's full-sized avatar

Michael Chapman michaeltchapman

View GitHub Profile
# DEPRECATED. The libvirt VIF driver to configure the
# VIFs.This option is deprecated and will be removed in the
# Juno release. (string value)
# Deprecated group;name - DEFAULT;libvirt_vif_driver
#vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver
network_controller:
- "%{network_service}"
- "%{network_service}::server"
- "%{network_service}::server::notifications"
- "%{network_service}::agents::metadata"
- "%{network_service}::agents::l3"
- "%{network_service}::agents::lbaas"
- "%{network_service}::agents::vpnaas"
- "%{network_service}::agents::dhcp"
- "%{network_service}::agents::%{network_plugin}"
$my_hash = { 'foo1' => {'user' => 'a', 'pass' => 'p', 'ip' => '1.2.3.4'}, 'foo2' => {'user' => 'b', 'pass' => 'p', 'ip' => '4.5.6.7'}}
create_resources(do_thing, $my_hash)
define do_thing(user, pass, ip) {
exec {'do_something':
command => "ssh -l ${user} ${ip} < ${pass}"
}
}
@michaeltchapman
michaeltchapman / output.pp
Created August 8, 2014 15:55
puppet face that pulls out yumrepos and packages and makes a manifest (for building images)
[root@compute1 face]# puppet partial select compute1
Notice: Scope(Node[default]): my scenario is stacktira
Notice: Scope(Node[default]): my role is compute
Notice: Scope(Node[default]): class groups: cinder_volumeceilometer_computenova_compute_ml2firewall_compute
Notice: Scope(Node[default]): Including node classes : openstacklib::repo openstacklib::hosts openstacklib::openstack::netns openstacklib::compat::nova mysql::bindings openstacklib::firewall::compute
Notice: Scope(Class_group[cinder_volume]): including cinder cinder::volume cinder::config cinder::volume::iscsi
Notice: Scope(Class_group[ceilometer_compute]): including ceilometer ceilometer::agent::auth ceilometer::agent::compute
Notice: Scope(Class_group[nova_compute_ml2]): including nova nova::compute nova::config nova::compute::libvirt nova::network::neutron nova::compute::neutron neutron::agents::ml2::ovs neutron neutron::plugins::ml2
Notice: Scope(Class_group[firewall_compute]): including openstacklib::firewall openstacklib::firewall::base openst
@michaeltchapman
michaeltchapman / redhat.pp
Last active August 29, 2015 14:05
prototype for generic yumrepo handling in openstack_extras
class openstack_extras::repo::redhat::redhat(
$release = 'icehouse',
$manage_rdo = true,
$repo_hash = {},
$repo_defaults = { 'enabled' => '1',
'gpgcheck' => '1',
'notify' => "Exec['yum_refresh']",
'mirrorlist' => 'absent',
'require' => "Anchor['openstack_extras_redhat']"
},
@michaeltchapman
michaeltchapman / logstash_config.rb
Last active August 29, 2015 14:05
puppet function for making logstash config from a hash
# logstash configuration format production function
def logstash_config(obj, depth=0)
d = depth
white = ' '
case obj
when String, Fixnum, Float, TrueClass, FalseClass, NilClass
return " => #{obj.to_s}\n"
when NilClass
return " { }\n"
when Array
2014-09-08 03:10:45.500 19865 DEBUG nova.servicegroup.api [req-72a0618d-9b4b-417c-bfdf-00b1fe22b343 07c4c5c50ecd4451a0bd1e5297331376 95ed0ee9924f478e914f0e9c70c2fa76] Check if the given member [<nova.objects.service.Service object at 0x6e54950>] is part of the ServiceGroup, is up service_is_up /usr/lib/python2.6/site-packages/nova/servicegroup/api.py:116
2014-09-08 03:10:45.500 19865 DEBUG nova.servicegroup.drivers.db [req-72a0618d-9b4b-417c-bfdf-00b1fe22b343 07c4c5c50ecd4451a0bd1e5297331376 95ed0ee9924f478e914f0e9c70c2fa76] DB_Driver.is_up last_heartbeat = 2014-09-08 03:02:03 elapsed = 522.500493 is_up /usr/lib/python2.6/site-packages/nova/servicegroup/drivers/db.py:71
2014-09-08 03:10:45.500 19865 DEBUG nova.servicegroup.api [req-72a0618d-9b4b-417c-bfdf-00b1fe22b343 07c4c5c50ecd4451a0bd1e5297331376 95ed0ee9924f478e914f0e9c70c2fa76] Check if the given member [<nova.objects.service.Service object at 0x6e54410>] is part of the ServiceGroup, is up service_is_up /usr/lib/python2.6/site-packages/nova/servicegroup
@michaeltchapman
michaeltchapman / haproxy.cfg
Created January 19, 2015 10:58
consul-template is really hard to use :(
global
chroot /var/lib/haproxy
daemon
group haproxy
maxconn 4000
pidfile /var/run/haproxy.pid
stats socket /var/lib/haproxy/stats
user haproxy
class consul_profile::openstack::compute {
if ! hiera('mysql_Address', false) {
runtime_fail { 'novadbdep':
fail => true,
message => 'novadbdep: requires mysql_Address',
}
} else {
Consul_profile::Discovery::Consul::Multidep<| title == 'novamultidep' |> {
response +> 'novadbdep'
}
@michaeltchapman
michaeltchapman / gist:e22a9aa40a9d67299dbe
Created January 20, 2016 01:49
Super informative tripleo error messages
+ openstack overcloud deploy --templates --libvirt-type qemu -e /usr/share/openstack-tripleo-heat-templates/environments/opendaylight.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml --control-scale 3 --compute-scale 2 -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e network-environment.yaml --ntp-server pool.ntp.org
Deploying templates in the directory /usr/share/openstack-tripleo-heat-templates
Stack failed with status: Resource CREATE failed: resources.ControllerServicesBaseDeployment_Step2: resources.ControllerNodesPostDeployment.Error: resources[2]: Deployment to server failed: deploy_status_code: Deployment exited with non-zero status code: 6
Heat Stack create failed.