This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# vim: set ft=ansible ts=2 sw=2 et: | |
- hosts: localhost | |
gather_facts: no | |
connection: local | |
become: no | |
vars: | |
my_json: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: get-iplayer | |
spec: | |
selector: | |
matchLabels: | |
tier: media | |
replicas: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ansible VMware external inventory script settings | |
[vmware] | |
# The resolvable hostname or ip address of the vsphere | |
server=172.16.0.1 | |
# The port for the vsphere API | |
port=443 | |
# The username with access to the vsphere API | |
username=myuser | |
# The password for the vsphere API |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: search_master, search_data | |
serial: 1 # run one at a time | |
gather_facts: false | |
become: yes | |
vars: | |
# cannot be done as lookup are only on the Ansible controller | |
#config: "{{ lookup('file','/etc/elasticsearch/elasticsearch.yml') | from_yaml }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reload_zone(origin): | |
for action in ['status','freeze', 'reload', 'thaw', 'status']: | |
print('doing... rndc', action, origin) | |
cmd = ['/usr/sbin/rndc', action, origin] | |
try: | |
Out = subprocess.check_output(cmd,stderr=sys.stdout.buffer,universal_newlines=True) | |
print("{}".format(Out)) | |
except subprocess.CalledProcessError as rndcexc: | |
print("Error code {} {}".format(rndcexc.returncode, rndcexc.output)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python -u | |
from time import localtime, strftime | |
from pyownet import protocol | |
hostname="rpi-loft" | |
port=4304 | |
interval=60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
FQDNLookup false | |
#BaseDir "/var/lib/collectd" | |
#PluginDir "/usr/lib/collectd" | |
#TypesDB "/usr/share/collectd/types.db" "/etc/collectd/my_types.db" | |
Interval 30 | |
#Timeout 2 | |
ReadThreads 4 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yum install -y httpd | |
service httpd start | |
chkconfig httpd on | |
groupadd www | |
usermod -a -G www k5user | |
chown -R root:www /var/www | |
chmod 2775 /var/www | |
find /var/www -type d -exec chmod 2775 {} + | |
find /var/www -type f -exec chmod 0664 {} + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Create Azure VM | |
hosts: localhost | |
connection: local | |
vars: | |
# { | |
# "offer": "UbuntuServer", | |
# "publisher": "Canonical", | |
# "sku": "16.04-LTS", | |
# "urn": "Canonical:UbuntuServer:16.04-LTS:latest", |