Skip to content

Instantly share code, notes, and snippets.

@acardak
acardak / tekton-pipelinerun-cleaner.yaml
Created May 9, 2022 02:15 — forked from raelga/tekton-pipelinerun-cleaner.yaml
CronJob to clean up PipelineRuns, keeping up to `NUM_TO_KEEP` of runs of each pipeline
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: tekton-pipelinerun-cleaner
labels:
app: tekton-pipelinerun-cleaner
app.kubernetes.io/name: tekton-pipelinerun-cleaner
app.kubernetes.io/component: pipelinerun-cleaner
app.kubernetes.io/part-of: tekton
@acardak
acardak / main.yml
Created December 19, 2018 03:23 — forked from ParagDoke/main.yml
Conditionally loop over multiple ansible tasks
---
- name: test
hosts: localhost
connection: local
tasks:
- name: Invoke poller
vars:
url: http://localhost:8000/abc.json
validate_certs: yes
poll_interval: 10
@acardak
acardak / web-servers.md
Created October 6, 2018 22:41 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@acardak
acardak / jinja_variables_types.yml
Created March 15, 2018 03:00 — forked from spiette/jinja_variables_types.yml
Test the variables types in jinja2 templates, used here with ansible
---
- hosts: all
gather_facts: no
vars:
string: "string"
list:
- item1
- item2
dict:
key1: value1
@acardak
acardak / inventory.sh
Created February 27, 2018 06:32 — forked from tuxfight3r/inventory.sh
Ansible dynamic inventory bash demo
#!/bin/bash
if [ "$1" == "--list" ] ; then
cat<<EOF
{
"bash_hosts": {
"hosts": [
"10.220.21.24",
"10.220.21.27"
],
@acardak
acardak / aws_create_site.yml
Created October 18, 2017 12:08 — forked from ruzickap/aws_create_site.yml
Ansible playbook which creates instances and tag volumes
---
- name: Create Instance in AWS
hosts: localhost
connection: local
gather_facts: false
vars:
aws_access_key: "xxxxxx"
aws_secret_key: "xxxxxx"
security_token: "xxxxxx"
@acardak
acardak / inventory2json.py
Created October 13, 2017 12:12 — forked from sivel/inventory2json.py
Ansible inventory to dynamic inventory JSON output, accepts all inventory input formats
import sys
import json
from ansible.parsing.dataloader import DataLoader
try:
from ansible.inventory.manager import InventoryManager
A24 = True
except ImportError:
from ansible.vars import VariableManager