Skip to content

Instantly share code, notes, and snippets.

OpenStack

In this document I describe the steps to setup OpenStack cloud on Fedora 19

Setup

First, install OpenStack on Fedora 19

RDO Quick Start -

@UshF
UshF / gist:7219872
Created October 29, 2013 18:18
chefspec failure with sync_git
There should be a matcher following the pattern ACTION_RESOURCE(NAME) for sync_git(repo)
http://rubydoc.info/github/acrmp/chefspec/ChefSpec/API/GitMatchers:sync_git
I'm trying to run rspec for the following recipe
case node["swift"]["swauth-source"]
when "package"
package platform_options["swauth_packages"] do
@UshF
UshF / gist:7325033
Created November 5, 2013 19:50
hmmm
chefspec | 51: case node["swift"]["swauth-source"]
chefspec | 52: when "package"
chefspec | 53>> platform_options["swauth_packages"].each do |pkg|
chefspec | 54: package pkg do
chefspec | 55: action :install
chefspec | 56: only_if { node["swift"]["authmode"] == "swauth" }
chefspec | 57: end
chefspec | 58: end
chefspec | 59: when "git"
chefspec | 60: git "#{Chef::Config[:file_cache_path]}/swauth" do
@UshF
UshF / gist:7753214
Created December 2, 2013 17:33
python-2.7 virtual env. Running tox unittests fails for swsync
(swiftsync)[ush@rabelais swiftsync (master)]$ tox
GLOB sdist-make: /home/ush/ATTWorkspace/GitRepos/swiftsync/swiftsync/setup.py
py27 create: /home/ush/ATTWorkspace/GitRepos/swiftsync/swiftsync/.tox/py27
py27 installdeps: -r/home/ush/ATTWorkspace/GitRepos/swiftsync/swiftsync/tools/pip-requires, -r/home/ush/ATTWorkspace/GitRepos/swiftsync/swiftsync/tools/test-requires
py27 sdist-inst: /home/ush/ATTWorkspace/GitRepos/swiftsync/swiftsync/.tox/dist/swsync-4523c3a.zip
py27 runtests: commands[0]
running testr
running=${PYTHON:-python} -m subunit.run discover -t ./ ./tests/units/ --list
running=${PYTHON:-python} -m subunit.run discover -t ./ ./tests/units/ --load-list /tmp/tmpn0J1kZ
running=${PYTHON:-python} -m subunit.run discover -t ./ ./tests/units/ --load-list /tmp/tmpfqhkh_
@UshF
UshF / gist:8739290
Created January 31, 2014 18:28
o4r3.dfw3 infra-monitoring role install errors with nslcd. Initial chef-run may have been partial. Creating /etc/nslcd.conf by hand and re-running gets us here
[2014-01-31T18:02:15+00:00] INFO: Processing service[nslcd] action enable (infra-auth::client line 96)
================================================================================
Error executing action `enable` on resource 'service[nslcd]'
================================================================================
Chef::Exceptions::Exec
----------------------
/usr/sbin/update-rc.d nslcd defaults returned 1, expected 0
@UshF
UshF / gist:9351527
Created March 4, 2014 17:35
find out what mode a rabbit cluster is in
root@o1r3.dfw3 17:32:19:~# rabbitmqctl list_policies
Listing policies ...
/ HA all .* {"ha-mode":"all"} 0
...done.
@UshF
UshF / gist:9510320
Created March 12, 2014 16:17
trying to find chef representation of field updated_at for a specific recipe
knife exec -E '(api.get "/cookbooks/rsyslog/").each { |response| pp response }'
["rsyslog",
{"url"=>"https://192.168.112.11/cookbooks/rsyslog",
"versions"=>
[{"version"=>"1.10.2",
"url"=>"https://192.168.112.11/cookbooks/rsyslog/1.10.2"},
{"version"=>"1.9.1",
"url"=>"https://192.168.112.11/cookbooks/rsyslog/1.9.1"}]}]
#!/usr/bin/env bash
#
# Copyright 2011, AT&T Services, Inc.
#
# All rights reserved - Do Not Redistribute
#
# Next we have to fix udev. Since all of our hardware is the same, we can do it this way to make sure all deviceds are always the same
cat <<EOF >/etc/udev/rules.d/70-persistent-net.rules
# This file was generated by cede.
require 'fog'
require 'net/ssh'
require 'net/scp'
def upload_file(host, user, password, source, dest, print_progress = true)
Net::SSH.start(host, user, :password => password) do |ssh|
puts "Uploading file... (#{File.basename(source)})"
ssh.scp.upload!(source, dest) do |ch, name, sent, total|
if print_progress
yum --enablerepo=rpmforge,epel,remi -y install gcc make zlib zlib-devel openssl-devel zsh
cd /usr/local
git clone git://github.com/sstephenson/rbenv.git rbenv
mkdir rbenv/shims rbenv/versions
chgrp -R groupname rbenv
chmod -R g+rwxXs rbenv
git clone git://github.com/sstephenson/ruby-build.git ruby-build
cd ruby-build
./install.sh