Skip to content

Instantly share code, notes, and snippets.

View odyssey4me's full-sized avatar

Jesse Pretorius odyssey4me

  • Red Hat
  • United Kingdom
View GitHub Profile
@odyssey4me
odyssey4me / .zuul.yaml
Last active March 26, 2018 18:41
Desired outcome for get-zuul-job-config.py
---
- job:
name: openstack-ansible-functional
parent: base
description: |
Run functional tests for an OpenStack-Ansible project.
Uses tox with the ``functional`` environment by default,
but the environment name can be changed through the use
of the ``tox_env`` variable.
required-projects:
@odyssey4me
odyssey4me / user_variables.yml
Created February 12, 2018 13:04
Using pike magnum with ocata for the rest
# The py_pkgs lookup will ignore all _git_ variables unless the
# _git_repo variable is present. As we're not wanting to use a
# fork in this case we just have the default value here.
magnum_git_repo: https://git.openstack.org/openstack/magnum
# Now we set the SHA/branch we want to build magnum from.
magnum_git_install_branch: "stable/pike"
# The key change is to allow the build to happen with the
# upstream indexes enabled (which is disabled by default to
@odyssey4me
odyssey4me / opendaylight_config.yml
Last active December 20, 2017 13:59
Suggested approach for ODL/SFC package install
---
# Copyright 2017, Ericsson AB
#
# 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
#
@odyssey4me
odyssey4me / 0-rsync.log
Last active May 28, 2022 13:48
Working with rsync and chown, with rsync and with Ansible's synchronize module. Playbook 1 only works for Ansible<2.3 and Playbook 2 works for Ansible 2.3+. The subtle difference was discovered in https://github.com/ansible/ansible/issues/23575 - for Ansible 2.3+ DO NOT QUOTE the rsync_opts.
root@foo:~# rm -rf test; mkdir test; touch test/test{1,2,3}; chown ubuntu test/test1; chown aptly test/test2; ls -al test/
total 8
drwxr-xr-x 2 root root 4096 Nov 30 10:47 .
drwx------ 11 root root 4096 Nov 30 10:47 ..
-rw-r--r-- 1 ubuntu root 0 Nov 30 10:47 test1
-rw-r--r-- 1 aptly root 0 Nov 30 10:47 test2
-rw-r--r-- 1 root root 0 Nov 30 10:47 test3
root@foo:~# rsync -avz --chown 'nginx:www-data' -e "ssh -i ~/.ssh/my.key" --verbose test root@bar:/tmp/
opening connection using: ssh -i "~/.ssh/my.key" -l root bar rsync --server -vvlogDtprze.iLsfx "--usermap=*:nginx" "--groupmap=*:www-data" . /tmp/ (13 args)
@odyssey4me
odyssey4me / clouds1.yaml
Last active November 20, 2017 19:27
Breaking examples of clouds.yaml
clouds:
_test_cloud_:
auth:
auth_url: https://identity.example.com
password: password
project_name: admin
username: admin
user_domain_name: default
project_domain_name: default
region_name: RegionOne
@odyssey4me
odyssey4me / 00-test-playbook.yml
Created November 20, 2017 14:25
Show difference between static and dynamic include execution
---
- name: Test conditional include (static)
hosts: localhost
connection: local
gather_facts: false
tasks:
- include: 01-included-tasks.yml
when: include_me | bool
- name: Test conditional include (dynamic)
@odyssey4me
odyssey4me / 00-setup.sh
Last active November 2, 2019 03:04
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}
@odyssey4me
odyssey4me / network-interface
Created October 31, 2017 09:08
OSA Single bridge implementation
# Physical interface, could be bond. This only needs to be set once
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0
auto eth1
iface eth1 inet manual
@odyssey4me
odyssey4me / update_github_status.sh
Created October 16, 2017 12:43
Update the status for a github PR
update_gh_status(){
sha="$1"
state="$2"
description="$3"
context="$4"
owner="${5:-rcbops}"
repo="${6:-rpc-openstack}"
oauth_token="${7:-YOUR_PAT}"
if [[ ${#@} < 4 ]]; then
@odyssey4me
odyssey4me / output.log
Created September 12, 2017 17:25
OSA requirements.txt testing
# Setup
apt-get update && \
apt-get purge -y nano && \
apt-get install -y git vim tmux fail2ban
cd /opt
git clone https://github.com/openstack/openstack-ansible.git
cd openstack-ansible
export ANSIBLE_ROLE_FETCH_MODE="git-clone"