Skip to content

Instantly share code, notes, and snippets.

View dmsimard's full-sized avatar

David Moreau Simard dmsimard

View GitHub Profile
@dmsimard
dmsimard / opstools.sh
Created July 13, 2017 14:57
Sensu opstools
#!/bin/bash
yum -y install "@Development Tools" python-devel python-setuptools libffi-devel libxml2-devel libxslt-devel openssl-devel ruby-devel
easy_install pip
pip install setuptools --upgrade
pip install ansible
git clone https://github.com/centos-opstools/opstools-ansible
cd opstools-ansible
cat << EOF > hosts
- ara_record:
key: "something"
value: "nothing for now"
register: record
- debug:
var: record
@dmsimard
dmsimard / tag_filter.py
Created June 1, 2017 02:01
k8s image tag filter
#!/usr/bin/env python
# Copyright Red Hat, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@dmsimard
dmsimard / failures.sh
Created May 24, 2017 19:20
ARA failures
#!/bin/bash
# Iterate through failed tasks with ignore_errors False
IFS=$'\n'
for result in $(ara result list --all -f value -c ID -c Action -c Status -c "Ignore Errors" | grep "failed False")
do
id=$(echo $result | awk '{print $1}')
action=$(echo $result | awk '{print $2}')
echo "$action task failure: http://url/result/${id}/"
done
@dmsimard
dmsimard / playbook.yml
Created May 17, 2017 12:51
reproducer
---
- name: Reproducer
hosts: localhost
gather_facts: no
tasks:
- set_fact:
foo: bar
- debug:
msg: "{{ foo }}"
@dmsimard
dmsimard / callback_race.py
Last active May 2, 2017 13:34
callback race condition
from __future__ import (absolute_import, division, print_function)
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'notification'
CALLBACK_NAME = 'callback_race'
@dmsimard
dmsimard / test.sh
Last active July 13, 2017 14:57
opstools
#!/bin/bash
yum -y install "@Development Tools" python-devel python-setuptools libffi-devel libxml2-devel libxslt-devel openssl-devel ruby-devel
easy_install pip
pip install setuptools --upgrade
pip install ansible
git clone https://github.com/centos-opstools/opstools-ansible
cd opstools-ansible
cat << EOF > hosts
@dmsimard
dmsimard / test.sh
Last active April 28, 2017 19:24
test-sensu
#!/bin/bash
yum -y install "@Development Tools" python-devel python-setuptools libffi-devel libxml2-devel libxslt-devel openssl-devel ruby-devel
easy_install pip
pip install setuptools --ugprade
pip install ansible
mkdir roles
pushd roles
git clone https://github.com/rdo-infra/ansible-role-rdomonitoring monitoring
cd monitoring
git fetch https://review.rdoproject.org/r/rdo-infra/ansible-role-rdomonitoring refs/changes/06/6406/6 && git checkout FETCH_HEAD
@dmsimard
dmsimard / test.sh
Created April 25, 2017 15:40
p-o-i with ansible
#!/bin/bash
yum -y install "@Development Tools" python-devel python-setuptools libffi-devel libxml2-devel libxslt-devel openssl-devel ruby-devel
easy_install pip
pip install setuptools --upgrade
git clone https://github.com/openstack/puppet-openstack-integration
cd puppet-openstack-integration
git fetch https://git.openstack.org/openstack/puppet-openstack-integration refs/changes/71/404471/36 && git checkout FETCH_HEAD
./run_tests.sh
/home/dmsimard/dev/dlrn/venv/bin/python2.7 /home/dmsimard/dev/ara/treeview.py
{
"home": {
"jenkins": {
"workspace": {
"gate-openstack-ansible-openstack-ansible-aio-ubuntu-xenial": {
"playbooks": [
{
"roles": {
"system_crontab_coordination": {