Skip to content

Instantly share code, notes, and snippets.

View nbuchwitz's full-sized avatar
👋
hi there

Nicolai nbuchwitz

👋
hi there
View GitHub Profile
- name: schedule downtime
uri:
url: "https://{{ icinga_host }}:{{ icinga_port | default(5665) }}/v1/actions/schedule-downtime"
user: "{{ icinga_user }}"
password: "{{ icinga_password }}"
force_basic_auth: True
validate_certs: False
method: POST
headers:
Accept: "application/json"
---
- hosts: jitsi
become: True
vars:
jitsi_domain: "jitsi.example.org"
certbot_mail: "[email protected]"
pre_tasks:
- name: Enable tls transport for apt
apt:
name: apt-transport-https
@nbuchwitz
nbuchwitz / revpimodio_replace_io_demo.py
Last active June 25, 2021 14:51
RevPiModIO2 replace_io example
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=4:sw=4:et
import revpimodio2
import paho.mqtt.client as mqtt
# connect to mqtt broker
client = mqtt.Client()
client.connect("your-broker.example.com", 1883)
- route53:
state: get
zone: foo.com
record: new.foo.com
type: CNAME
register: rec
- debug:
msg: rec
@nbuchwitz
nbuchwitz / remove-cname.yml
Last active November 29, 2018 15:16
Remove Route54 CNAME records with Ansible
- name: Remove CNAME record
route53:
state: absent
zone: "{{ item.zone }}"
record: "{{ item.record }}"
type: CNAME
value: "{{ item.target }}"
loop:
- { record: "somthing", zone: "example.com", target: "target.host.example.com" }
- { record: "another.one", zone: "example.com", target: "target.host.example.com" }
---
- name: Setup Icinga2 Client
hosts: all
vars:
icinga2_pki_path: /var/lib/icinga2/certs
icinga2_master: "icinga-master.fqdn"
icinga2_cn: "{{ inventory_hostname }}"
icinga2_zone: "{{ inventory_hostname }}"
# connection direction: master <- client
icinga2_endpoint: "icinga-satellite-or-master.fqdn,icinga-satellite-or-master.fqdn,5665"