Skip to content

Instantly share code, notes, and snippets.

View dmsimard's full-sized avatar

David Moreau Simard dmsimard

View GitHub Profile
{
"links": [
{
"ethernet_mac_address": "fa:16:3e:ed:9a:59",
"id": "tap1a81968a-79",
"mtu": null,
"type": "bridge",
"vif_id": "1a81968a-797a-400f-8a80-567f997eb93f"
}
],
[root@n12 ~]# openstack server list
+--------------------------------------+-------------+--------+---------------------------------------------+
| ID | Name | Status | Networks |
+--------------------------------------+-------------+--------+---------------------------------------------+
| 08717da2-6d8f-4879-909a-e15da1834284 | test-server | ACTIVE | publicnet=172.19.1.35; othernet=192.168.0.5 |
+--------------------------------------+-------------+--------+---------------------------------------------+
[root@n12 ~]# openstack network list
+--------------------------------------+-----------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+-----------+--------------------------------------+
for node in $(cico inventory 2>&1 |tail -n+5 |awk {'print $6'} |sort |tail -n+3)
do
if ssh $node "ls -al /etc/ansible/facts.d >/dev/null" &>/dev/null; then
cico inventory 2>&1 |grep " ${node} "
fi
done
@app.template_filter('pathtruncate')
def jinja_pathtruncate(path):
'''Truncates a path to less than ARA_PATH_MAX characters.
We prepend an ellipsis when we return a truncated path.'''
if path is None:
return
if len(path) < app.config['ARA_PATH_MAX']:
return path
self = <test_cli.TestCLI testMethod=test_playbook_list_complete>
def test_playbook_list_complete(self):
ctx = ansible_run()
cmd = ara.cli.playbook.PlaybookList(None, None)
parser = cmd.get_parser('test')
args = parser.parse_args(['--complete'])
res = cmd.take_action(args)
@dmsimard
dmsimard / ssh_agent_start.fish
Created June 18, 2016 12:06 — forked from rsff/ssh_agent_start.fish
ssh agent for fish
#this script can never fail
#i use it in the fish_config
#call it with start_agent
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
if [ -n "$SSH_AGENT_PID" ]
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null
@dmsimard
dmsimard / designate-beaker.sh
Last active July 6, 2016 02:13
puppet-designate reproducer
#!/bin/bash
change="${1}"
echo "Testing change ${change}"
echo
echo "Installing dependencies"
echo
yum -y install git "@Development tools" ruby-devel rubygems openssl-devel \
libffi-devel libxml2-devel libxslt-devel wget epel-release
gem install bundler
@dmsimard
dmsimard / beaker.sh
Last active July 6, 2016 14:49
puppet-designate avc reproducer
#!/bin/bash
# Install dependencies and checkout a puppet-designate code review that exhibits the problem
yum -y install git "@Development tools" ruby-devel rubygems openssl-devel libffi-devel libxml2-devel libxslt-devel
setenforce 0
git clone https://github.com/openstack/puppet-designate
cd puppet-designate
git fetch https://git.openstack.org/openstack/puppet-designate refs/changes/51/337951/1 && git checkout FETCH_HEAD
sudo gem install bundler --no-rdoc --no-ri --verbose
mkdir .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
@dmsimard
dmsimard / weirdo-with-patch.sh
Last active July 20, 2016 21:21
weirdo-with-patch
#!/bin/bash
# Run WeIRDO on localhost from a fresh CentOS installation with a specified patch
# ./weirdo-with-patch.sh project-scenarioxxx.yml refs/changes/60/337860/17
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
yum -y install centos-release-openstack-mitaka
yum -y install wget
wget https://kojipkgs.fedoraproject.org//work/tasks/8987/15158987/python2-XStatic-tv4-1.2.7.0-1.fc26.noarch.rpm
wget https://kojipkgs.fedoraproject.org//work/tasks/8987/15158987/xstatic-tv4-common-1.2.7.0-1.fc26.noarch.rpm
wget https://kojipkgs.fedoraproject.org//work/tasks/8882/15158882/python2-XStatic-Angular-Schema-Form-0.8.13.0-1.fc26.noarch.rpm
wget https://kojipkgs.fedoraproject.org//work/tasks/8882/15158882/xstatic-angular-schema-form-common-0.8.13.0-1.fc26.noarch.rpm
wget https://kojipkgs.fedoraproject.org//work/tasks/8917/15158917/python2-XStatic-objectpath-1.2.1.0-1.fc26.noarch.rpm
wget https://kojipkgs.fedoraproject.org//work/tasks/8917/15158917/xstatic-objectpath-common-1.2.1.0-1.fc26.noarch.rpm
yum install *.rpm