Skip to content

Instantly share code, notes, and snippets.

View lareeth's full-sized avatar

Gareth Luckett lareeth

  • London, UK
View GitHub Profile
@lareeth
lareeth / packer.py
Last active April 16, 2019 16:23
Packer Ansible Connection Plugin
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.connection.ssh import Connection as SSHConnection
DOCUMENTATION = '''
connection: packer
short_description: ssh based connections for powershell via packer
description:
- This connection plugin allows ansible to communicate to the target packer machines via ssh based connections for powershell.
@lareeth
lareeth / userdata.ps1
Last active September 15, 2022 18:22
Packer Ansible WinRM Userdata
<powershell>
#Requires -Version 3.0
# Configure a Windows host for remote management with Ansible
# -----------------------------------------------------------
#
# This script checks the current WinRM (PS Remoting) configuration and makes
# the necessary changes to allow Ansible to connect, authenticate and
# execute PowerShell commands.
#
@lareeth
lareeth / unifi-centos.sh
Last active January 17, 2019 15:46
Install UniFi Controller on CentOS
VERSION=5.9.29
wget https://dl.ubnt.com/unifi/$VERSION/UniFi.unix.zip -O /tmp/UniFi-$VERSION.unix.zip
service unifi stop
ls -lah /opt/unifi/
rm -rf /opt/unifi/
unzip /tmp/UniFi-$VERSION.unix.zip -d /opt/
mv /opt/UniFi /opt/unifi