Skip to content

Instantly share code, notes, and snippets.

View rdonkin's full-sized avatar

Richard Donkin rdonkin

  • Bath, United Kingdom
View GitHub Profile
@rdonkin
rdonkin / ansible-role-test.sh
Created October 21, 2019 06:20 — forked from brentwg/ansible-role-test.sh
For Posterity. From GeerlingGuy, Ansible Role Test Shim (Some modifications)
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
# - test_idempotence: whether to test playbook's idempotence (default = true)
@rdonkin
rdonkin / bash-script-path.sh
Created May 18, 2019 06:55
Getting the full path to current script in bash
#!/bin/bash
# All these options work on bash 3.2 on macOS where 'readlink -f' is not available
# Ref http://stackoverflow.com/a/246128
# 1. Get script path, don't canonicalise symlinks used in script path
# ${BASH_SOURCE[0]} is set but includes './' prefix
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" 2>/dev/null)" && pwd 2>/dev/null)"
@rdonkin
rdonkin / datadog-agent.yaml
Last active April 28, 2019 13:50
datadog agent config as Daemonset delete example for Ansible k8s issue
# Cluster role for Datadog agent
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: datadog-agent
rules:
- apiGroups:
- ""
resources:
- services