Skip to content

Instantly share code, notes, and snippets.

@chadgeary
chadgeary / mutley.sh
Last active January 23, 2021 18:16
mutley
# get your original terraform output
cd ~/cloudblock/oci
terraform output
# go to instance
ssh <instance ip>
# get gist
sudo rm -f /opt/cloudblock/playbooks/mutley_oci.yml
sudo wget https://gist.githubusercontent.com/chadgeary/39e51e00b5651df351fb941ff0e1934a/raw/d4fbeece1b0568439dc214508760cc2f32cd3fb9/gistfile1.txt -O /opt/cloudblock/playbooks/mutley_oci.yml
---
- name: cloudblock - amd64 oci (oracle) variant with cloudflare custom doh
hosts: localhost
collections:
- oracle.oci
gather_facts: true
become: true
tasks:
- name: required packages
---
- name: cloudblock - raspbian arm64 standalone variant
hosts: localhost
connection: local
gather_facts: true
become: true
tasks:
- name: add docker apt key
apt_key:
@chadgeary
chadgeary / gist:a575620254f17d357f574a39c70ad1e7
Created June 16, 2020 17:47
iam-for-aws-backups-sample
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:CopySnapshot",
"backup:DescribeBackupVault",
"elasticfilesystem:DescribeTags"

Reference

Creates an (all-in-one) guacamole server using docker w/ mysql for auth.

Deployment

# local example
ansible-playbook guacamole.yml --extra-vars="target=localhost guacnet_cidr=192.168.5.0/24 guacnet_guacd=192.168.5.2 guacnet_guacdb=192.168.5.3 guacnet_guacamole=192.168.5.4"

Notes

ALTER USER 'root'@'localhost' IDENTIFIED BY '{{ guacdb_root_pass.stdout }}';
CREATE DATABASE guacamole_db;
CREATE USER 'guacamole_user'@'{{ guacnet_guacamole }}' IDENTIFIED BY '{{ guacdb_guacamole_pass.stdout }}';
GRANT SELECT,INSERT,UPDATE,DELETE ON guacamole_db.* TO 'guacamole_user'@'{{ guacnet_guacamole }}';
FLUSH PRIVILEGES;
@chadgeary
chadgeary / guacamole.yml
Created March 17, 2020 02:18
guacamole.yml
---
- name: guacamole
hosts: "{{ target }}"
gather_facts: true
become: true
tasks:
- name: Docker Installation
package:
name: "{% if ansible_os_family == 'RedHat' %}docker{% elif ansible_os_family == 'Debian' %}docker.io{% endif %}"

Minecraft

A playbook for installing / starting minecraft on a CentOS 7 server.

Deploy

# locally
ansible-playbook minecraft.yml --extra-vars "target=localhost"

Todo

# Minecraft server properties
view-distance=10
max-build-height=256
gamemode=creative
server-port=25565
query.port=25565
allow-nether=true
enable-command-block=false
enable-rcon=false
enable-query=false
---
- name: minecraft
hosts: '{{ target }}'
become: True
become_user: root
tasks:
- name: java
yum:
name: "{{ repo_packages }}"