Skip to content

Instantly share code, notes, and snippets.

View mgagne's full-sized avatar

Mathieu Gagné mgagne

View GitHub Profile
@mgagne
mgagne / create_admin_account.sql.j2
Created June 10, 2016 23:14
Create admin account in Gerrit
-- Insert the base values for the initial Gerrit user. This user will
-- become the administrator of the server. As this user is a local
-- user it will not be able to login through the web UI.
START TRANSACTION;
SET @gerrit_admin_account_id = {{ gerrit_admin_account_id }};
SET @gerrit_admin_group_id = 1;
-- Create a local user, we need to insert for this.
@mgagne
mgagne / ubuntu_trusty.patch
Created April 12, 2016 17:16
cloud-init network_info.json
From: =?utf-8?q?Mathieu_Gagne=CC=81?= <mgagne@iweb.com>
Date: Wed, 4 Nov 2015 13:37:57 -0500
Subject: Add support for network_data.json from configdrive
---
cloudinit/distros/__init__.py | 12 +++
cloudinit/distros/debian.py | 92 ++++++++++++++++++++-
cloudinit/distros/net_util.py | 34 ++++++++
cloudinit/distros/rhel.py | 127 +++++++++++++++++++++++++++++
cloudinit/distros/ubuntu.py | 5 +-
@mgagne
mgagne / check-hiera-certificates.py
Created February 11, 2016 23:20
Check Hiera certificates
#!/usr/bin/env python
import argparse
from datetime import datetime
import fnmatch
import os
import prettytable
import yaml
from OpenSSL import crypto
@mgagne
mgagne / new-token-same-project-user.sql
Last active January 25, 2016 21:35
Keystone Fernet Token Validation
SELECT 1;
SELECT trust.id AS trust_id,
trust.trustor_user_id AS trust_trustor_user_id,
trust.trustee_user_id AS trust_trustee_user_id,
trust.project_id AS trust_project_id,
trust.impersonation AS trust_impersonation,
trust.deleted_at AS trust_deleted_at,
trust.expires_at AS trust_expires_at,
trust.remaining_uses AS trust_remaining_uses,
trust.extra AS trust_extra
@mgagne
mgagne / gist:dc269e31818e5354a8a4
Created October 30, 2015 02:27
Nova Kilo patches
Add ability to filter cells by instance type class
Change-Id: Ie0e29524505018793ff67469fd6f0f009855a1a7
Add ability to inject routes in interfaces.template
Change-Id: Ic22c8af721d539c8180b5caa7ba348e834ddbb56
Add ability to override network templace from Instan
Change-Id: Ide9b1529632b1a262ffd20dddf8a8632d596db50
Add aggregate name validation with cells
@mgagne
mgagne / aggregate_image_os_type_isolation.py
Created October 27, 2015 02:35
AggregateImageOsTypeIsolationFilter
# nova/scheduler/filters/aggregate_image_os_type_isolation.py
from oslo_config import cfg
from oslo_log import log as logging
from nova import db
from nova.scheduler import filters
isolated_opts = [
cfg.ListOpt('isolated_image_os_type',
default=[],

For windows support libguestfs 1.17.17 or above is needed. Ubuntu 12.10 (Quantal Quetzal) or above is required.

A patch written by the CERN is also required for Windows customization support: https://twiki.cern.ch/twiki/bin/view/Sandbox/LuisFernandezAlvarezSandbox

def customize(self, libvirt_xml):
    def is_generalize():
        g_handle = self._guestfs_handle_setup(libvirt_xml)

try:

@mgagne
mgagne / deploy.yaml
Last active October 1, 2015 23:01
Optional synchronize
---
- name: "Deploy project"
hosts: all
gather_facts: false
vars:
artifacts:
- src: "./repository/"
dest: "/target/repository"
- src: "./manifests/"
@mgagne
mgagne / default.xml
Created September 29, 2015 23:06
OpenStack repo manifest
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="openstack"
fetch="https://git.openstack.org/"
review="https://review.openstack.org/" />
<default revision="master"
remote="openstack"
sync-j="4" />
<!-- puppet -->
@mgagne
mgagne / generate-manifest.py
Last active September 29, 2015 23:32
Generation a repo manifest from projects.yaml
#!/usr/bin/env python
import argparse
import gerritlib.gerrit as gerrit
import jinja2
import os
import requests
import yaml