Skip to content

Instantly share code, notes, and snippets.

View evrardjp's full-sized avatar

Jean-Philippe Evrard evrardjp

View GitHub Profile
@evrardjp
evrardjp / user_pipfix.yml
Last active April 2, 2018 15:59
User overrides for temporarily workaround the pip error: "You must give at least one requirement to install" (Pike/Queens)
---
pip_packages:
- pip==9.0.1
- setuptools==38.5.1
- wheel==0.30.0
@evrardjp
evrardjp / openstack_user_config.yml
Last active February 12, 2018 11:29
working user config
---
cidr_networks:
container: 10.40.100.0/22
storage: 10.40.244.0/22
tunnel: 10.40.240.0/22
used_ips:
- "10.40.100.2,10.40.100.50"
- "10.40.240.1,10.40.240.50"
- "10.40.244.1,10.40.244.50"
- name: Load required variables
include_vars:
file: defaults/required.yml
name: "{{ testing | bool | ternary(omit,'required') }}"
- fail:
msg: "{{ item.key }} is not defined"
when:
- "vars[item.key] is not defined"
- not testing
@evrardjp
evrardjp / virtualenv_tools.py
Last active January 7, 2018 10:18
virtualenv_tools.py fork with a print.
#!/usr/bin/env python
"""
move-virtualenv
~~~~~~~~~~~~~~~
A helper script that moves virtualenvs to a new location.
It only supports POSIX based virtualenvs and Python 2 at the moment.
:copyright: (c) 2012 by Fireteam Ltd.
fullmetal: TASK [pip_install : Install pip packages (fall back mode)] *********************
fullmetal: Friday 01 December 2017 12:50:04 +0000 (0:00:58.485) 0:01:39.357 *******
fullmetal: FAILED - RETRYING: Install pip packages (fall back mode) (5 retries left).
fullmetal: FAILED - RETRYING: Install pip packages (fall back mode) (4 retries left).
fullmetal: FAILED - RETRYING: Install pip packages (fall back mode) (3 retries left).
fullmetal: FAILED - RETRYING: Install pip packages (fall back mode) (2 retries left).
fullmetal: FAILED - RETRYING: Install pip packages (fall back mode) (1 retries left).
fullmetal: fatal: [aio1]: FAILED! => {"attempts": 5, "changed": false, "cmd": "/usr/local/bin/pip2 install -U --isolated --constraint http://172.29.236.100:8181/os-releases/master/ubuntu-16.04-x86_64/requirements_absolute_requirements.txt ", "failed": true, "msg": "\n:stderr: Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConn
@evrardjp
evrardjp / 00-setup.sh
Created November 17, 2017 12:59 — forked from odyssey4me/00-setup.sh
Setup a basic nodepool host using a single VM and localhost
# prep host
apt update
apt purge nano
apt install git vim tmux fail2ban
# prep ssh key
key_path="${HOME}/.ssh"
key_file="${key_path}/id_rsa"
mkdir -p ${key_path}
chmod 700 ${key_path}
@evrardjp
evrardjp / who-is-in-play.yml
Last active March 15, 2021 02:38
block/rescue removes host from ansible_play_hosts when block fails, even when rescued!
---
- hosts: all
connection: local
gather_facts: no
tasks:
- debug:
var: ansible_play_hosts
- block:
- fail:
- name: Run py_pkg_separately
hosts: repo_all[0]
gather_facts: no
vars:
pkg_locations:
vars:
# - "{{ playbook_dir }}/../"
# - /etc/ansible/roles
- /etc/openstack_deploy
tasks:
@evrardjp
evrardjp / user_cors.yml
Last active December 5, 2017 07:17
CORS using OSA. Chose the one you prefer!
# Please define external_horizon_fqdn below
#external_horizon_fqdn:
cors_overrides:
cors:
# Logan said: i mean as long as headers like 'origin' aren't missing from service defaults you should be in good shape
# Only the first "allow_headers" entry, origin, is an override. See LP bug
# 1680062 for why this is necessary. The rest of the headers are defined in
# glance's code base but must be included to avoid removing them with the
# override.
@evrardjp
evrardjp / generate_inventory.py
Last active September 8, 2017 15:58
Static/Dynamic Inventory generation tool to see how they scale
#!/usr/bin/env python
'''
Example custom dynamic inventory script for Ansible, in Python.
'''
import os
import sys
import argparse
from jinja2 import Template