Skip to content

Instantly share code, notes, and snippets.

@mwhahaha
mwhahaha / debug.log
Created December 9, 2013 22:47
vagrant_1.4.0_error
INFO global: Vagrant version: 1.4.0
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/destroy/plugin.rb
INFO manager: Registered plugin: destroy command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.0/plugins/commands/help/plugin.rb
@mwhahaha
mwhahaha / gist:df649fa9e687acff3d6d
Created January 29, 2015 04:10
yum exclude task
---
- hosts: all
sudo: yes
remote_user: root
tasks:
- name: "update all"
yum: name=* exclude=kernel state=latest
#!/bin/bash
# This is a quick hack to try and extract variables from puppet file
# and prints out a doc string, only works if the parameters are only
# have 2 spaces in front
egrep '^ \$(.*)\s+=\s+(.*)$' file.pp | \
sed -e 's/^ \$\([a-zA-Z0-9_]*\).*= \(.*\)$/# [*\1*]=# Default value is \2/g' | \
tr "=" "\n"
@mwhahaha
mwhahaha / ovb-overcloud-basics.sh
Last active February 15, 2017 20:02
ovb-helpers
#!/bin/bash
set -ex
source ~/stackrc
export NODE_DIST=centos7
export USE_DELOREAN_TRUNK=1
export DELOREAN_TRUNK_REPO="http://buildlogs.centos.org/centos/7/cloud/x86_64/rdo-trunk-master-tripleo/"
export DELOREAN_REPO_FILE="delorean.repo"
export DIB_YUM_REPO_CONF=/etc/yum.repos.d/delorean*
#!/bin/bash
# run beaker tests on a xenial vm for a specific puppet openstack module.
set -xe
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -N '' -f ~/.ssh/id_rsa
sudo mkdir -p /root/.ssh
sudo chmod 700 /root/.ssh
sudo cat ~/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
fi
echo 'APT::Get::AllowUnauthenticated "true";' > /etc/apt/apt.conf.d/99gpgdisable
# install puppetlabs puppet
wget http://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
dpkg -i puppetlabs-release-pc1-xenial.deb
apt-get install puppet-agent
# disable verification for ceph packages
echo 'APT::Get::AllowUnauthenticated "true";' >> /etc/apt/apt.conf.d/99disableverification
# get p-o-i
git clone https://github.com/openstack/puppet-openstack-integration
cd puppet-openstack-integration
#!/usr/bin/env python
from __future__ import print_function
import argparse
import lazr.restfulclient.errors
import os
import sys
# import sqlite3
from launchpadlib import launchpad
@mwhahaha
mwhahaha / loop.yml
Created August 15, 2018 23:15
ansible array appending with set_fact
---
- name: looping
shell: >
echo "{{ loop_input }}"
register: foo
- set_fact:
loop_var: []
when: loop_var is not defined
- name: Async pull images from remote mirror and push into local registry
docker_image:
name: "{{ async_item.imagename }}"
repository: "localhost:8787/{{ async_item.imagename | regex_replace('docker.io/') }}"
push: yes
debug: yes
async: 1500
poll: 0
loop: "{{ images }}"
loop_control: