Skip to content

Instantly share code, notes, and snippets.

View dmsimard's full-sized avatar

David Moreau Simard dmsimard

View GitHub Profile
@dmsimard
dmsimard / .gitignore
Created March 21, 2016 20:40
Prepare Puppet modules before upload to Puppetlabs forge
puppet-*
puppetforge
git clone https://github.com/openstack/packstack
cd packstack
git checkout stable/mitaka
git tag -s 8.0.0.0rc1 -m 8.0.0.0rc1
git review -s
git push gerrit 8.0.0.0rc1
@dmsimard
dmsimard / weirdo-localhost.sh
Last active August 30, 2017 08:00
WeIRDO on localhost
#!/bin/bash
DELOREAN_URL="https://trunk.rdoproject.org/centos7-master/consistent/delorean.repo"
# How to run WeIRDO on localhost from a fresh CentOS installation
yum -y install git python-setuptools python-devel libffi-devel openssl-devel "@Development Tools"
easy_install pip
pip install tox
git clone https://github.com/rdo-infra/weirdo.git
cd weirdo
cat <<EOF >hosts
#!/bin/bash
yum -y install yum-plugin-priorities
# Add Mitaka release equivalent repositories
curl https://dmsimard.com/rdo-mitaka-deps.repo |tee /etc/yum.repos.d/rdo-mitaka-deps.repo
curl https://dmsimard.com/rdo-mitaka-release.repo |tee /etc/yum.repos.d/rdo-mitaka-release.repo
yum -y install puppet \
iproute \
dstat \
#!/usr/bin/env python
import yaml
# Copy/paste from projects.yaml but only after the dist-git update part
with open('projects.yaml', 'r') as f:
text=f.read()
def template(template):
print " template:"
print " - name: {0}".format(template)
@dmsimard
dmsimard / packstack.sh
Last active July 19, 2016 15:20
packstack 308357
#!/bin/bash
export MANAGE_REPOS="false"
export SCENARIO="scenario002"
yum -y install git yum-plugin-priorities
# Set trunk repositories
curl http://trunk.rdoproject.org/centos7-master/delorean-deps.repo |tee /etc/yum.repos.d/delorean-deps.repo
curl http://trunk.rdoproject.org/centos7-master/consistent/delorean.repo |tee /etc/yum.repos.d/delorean.repo
#!/bin/bash
# Adds the rdo-core group to a list of projects
GIT_BASE_URL="ssh://admin@review.rdoproject.org:29418"
BASE_DIR="/tmp/sfaccess"
PROJECT_FILE="/tmp/projects"
export GIT_COMMITTER_NAME="SF initial configurator"
export GIT_COMMITTER_EMAIL="admin@review.rdoproject.org"
export GIT_AUTHOR_NAME="SF initial configurator"
export GIT_AUTHOR_EMAIL="admin@review.rdoproject.org"
tasks = (models.Task.query
.join(models.Play)
.join(models.Playbook)
.filter(models.Task.playbook_id == models.Playbook.id)
.filter(models.Task.play_id == models.Play.id))
for task in tasks:
print(task.playbook_path)
def take_action(self, parsed_args):
tasks = (models.Task.query
.join(models.Play)
.join(models.Playbook)
.filter(models.Task.playbook_id == models.Playbook.id)
.filter(models.Task.play_id == models.Play.id))
return (('ID', 'Name', 'Path', 'Playbook', 'Play', 'Action', 'Line', 'Handler', 'Time Start', 'Time End'),
[(task.id,
task.name,
{% macro display_result(result, hdr) %}
{% if result is mapping %}
{% if 'item' in result %}
<{{hdr}}>Item</{{hdr}}>
<pre>{{result.item|to_nice_json}}</pre>
{% endif %}
{% for attr in result.keys()|sort
if attr not in ['item', 'changed', 'stdout_lines'] %}