Skip to content

Instantly share code, notes, and snippets.

View mgagne's full-sized avatar

Mathieu Gagné mgagne

View GitHub Profile
#
# puppet_module_version.rb
#
require 'puppet/parser/functions'
Puppet::Parser::Functions.newfunction(:puppet_module_version,
:type => :rvalue,
:doc => <<-EOS
This function parses the module version from Modulefile or metadata.json.
require 'json'
require 'puppet/util/package'
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'rabbitmqctl'))
Puppet::Type.type(:rabbitmq_policy).provide(:rabbitmqctl, :parent => Puppet::Provider::Rabbitmqctl) do
defaultfor :feature => :posix
# cache policies
def self.policies(name, vhost)
class nova (
$ensure_package => 'present',
) {
anchor { 'nova::common::package::begin': } ->
package { 'nova-common':
ensure => $ensure_package,
name => $nova::params::common_package_name,
} ->
anchor { 'nova::common::package::end': } ->
@mgagne
mgagne / Gemfile
Created November 14, 2014 19:29
Using librarian-puppet-simple to read Puppetfile for your rspec-puppet fixtures
# Don't forget to add librarian-puppet-simple to your Gemfile
# From git
gem 'librarian-puppet-simple',
:git => 'git://github.com/bodepd/librarian-puppet-simple.git'
# From rubygems
gem 'librarian-puppet-simple', '~> 0.0.3'
class nova (
$database_connection = false,
) {
# backward compat stuff
# include ::nova::database
}
class nova::scheduler {
include ::nova::database
}
@mgagne
mgagne / nova-flavor-slots.py
Created January 15, 2015 17:20
Nova flavor slots
#!/usr/bin/env python
import argparse
import os
import prettytable
from novaclient.v1_1 import client as novaclient
OS_USERNAME = os.environ['OS_USERNAME']
OS_PASSWORD = os.environ['OS_PASSWORD']
commit 0bd7f478a5d9cee815d07c93ca6e77715a6b6a62
Author: Mathieu Gagné <mgagne@iweb.com>
Date: Thu Jan 29 11:36:55 2015 -0500
Don't create block device mappings in the API cell
The child cell will create it and propagate it up to the parent cell.
Change-Id: Icc6270d4fc41a6bbac3a29843e5f949d9d894b29
@mgagne
mgagne / libvirt-1.2.2_Support-incoming-migration-from-13.10-hosts.patch
Created March 2, 2015 18:44
Migration fails between QEMU 1.5 and QEMU 2.0
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2109,6 +2109,13 @@
VIR_STRDUP(def->os.machine, "pc-1.0-precise") < 0)
goto cleanup;
}
+ if (STREQ_NULLABLE(vm->def->os.machine, "pc-i440fx-1.5")) {
+ VIR_FREE(vm->def->os.machine);
+ VIR_FREE(def->os.machine);
+ if (VIR_STRDUP(vm->def->os.machine, "pc-i440fx-1.5-saucy") < 0 ||
From: =?UTF-8?q?Mathieu=20Gagn=C3=A9?= <mgagne@iweb.com>
Date: Thu, 10 Jul 2014 14:22:01 -0400
Subject: Add ability to still use Nova firewall with Neutron security group
We need the Nova firewall to add anti-spoofing rules and for Ceilometer
to indirectly set the correct resource id for Nova network samples.
---
nova/tests/virt/libvirt/test_libvirt_vif.py | 8 --------
nova/virt/libvirt/vif.py | 2 --
2 files changed, 10 deletions(-)
@mgagne
mgagne / gist:c3d87f63853a66e18448
Created April 1, 2015 17:13
puppet_module_version.rb
#
# puppet_module_version.rb
#
require 'puppet/parser/functions'
Puppet::Parser::Functions.newfunction(:puppet_module_version,
:type => :rvalue,
:doc => <<-EOS
This function parses the module version from Modulefile or metadata.json.