Skip to content

Instantly share code, notes, and snippets.

@Dude4Linux
Dude4Linux / test-lxc-destroy
Created Dec 15, 2015
Testing the effects of releasing the dhcp lease when a container is destroyed
View test-lxc-destroy
#!/bin/bash
#
# test-dnsmasq
#
app="wordpress"
container="${app}-container"
domain="${app}.local.lxc"
LEASES="/var/lib/misc/dnsmasq.leases"
release_lease() {
View turnkey-test-app.yml
---
- name: Test a TurnKey appliance
hosts: lxc
gather_facts: false
vars:
host_key_checking: false
ssh_user: '{{lookup("env", "USER")}}'
ssh_key: '{{lookup("file", "~/.ssh/id_rsa.pub")}}'
@Dude4Linux
Dude4Linux / turnkey-setup
Created Apr 28, 2016
Apply my personal customizations to a freshly install TurnKey appliance
View turnkey-setup
#! /bin/bash
# ---------------------------------------------------------------------------
# turnkey-setup - Setup and configure a freshly installed TurnKey appliance
# Install ssh key for automated remote login
# Install vim-nox
# Setup additional bash aliases
# Copyright 2013, John Carver <dude4linux@gmail.com>
@Dude4Linux
Dude4Linux / test-dnsmasq
Last active Jul 21, 2016
Test dnsmasq with LXC containers
View test-dnsmasq
#!/bin/bash
#
# test-dnsmasq
#
app="wordpress"
container="${app}-container"
domain="${app}.local.lxc"
LEASES="/var/lib/misc/dnsmasq.leases"
release_lease() {
View webmin-test-results
##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
Results from version 2.0.1.0 (passed)
```
TASK [Test appliance webmin] ***************************************************
task path: /home/ansible/playbooks/webmin-test.yml:139
<lxc> ESTABLISH SSH CONNECTION FOR USER: root
<lxc> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=22 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home/ansible/.ansible/cp/ansible-ssh-%h-%p-%r -tt lxc '/bin/sh -c '"'"'mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1470625603.84-183242562950122 `" && echo "` echo ~/.ansible/tmp/ansible-tmp-1470625603.84-183242562950122 `"'"'"''
<lxc> PUT /tmp/tmpJw5Mg0 TO /root/.ansible/tmp/ansible-tmp-1470625603.84-183242562950122/uri
View lxc-turnkey
#!/bin/bash
# lxc-turnkey - Template for TurnKey GNU/Linux appliances
#
# lxc: linux Container library
# Authors:
# Daniel Lezcano <daniel.lezcano@free.fr>
# Modified for TurnKey GNU/Linux: