Skip to content

Instantly share code, notes, and snippets.

View jrisch's full-sized avatar
🏠
Working from home

Juri Rischel Jensen jrisch

🏠
Working from home
View GitHub Profile
- name: Load bootargs and install repo for Debian install
include_vars:
file=group_vars/Debian.yml
when: '"Debian" in vm_template'
- name: Load bootargs and install repo for Ubuntu install
include_vars:
file=group_vars/Ubuntu.yml
when: '"Ubuntu" in vm_template'
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
---
- hosts: localhost
connection: local
gather_facts: no
tasks:
- name: Test
local_action: shell /usr/local/bin/pwgen -s 14 1
register: password
- hosts: balancers
user: root
tags: deploy
tasks: [ ]
- hosts: prod
serial: 1
tasks:
- name: Upload DB dump to prod
[local]
localhost
[prod]
web01 ansible_ssh_host=xx.xx.xx.xx ansible_ssh_port=2222 ansible_ssh_private_key_file=sshkey
web02 ansible_ssh_host=xx.xx.xx.xx ansible_ssh_port=2223 ansible_ssh_private_key_file=sshkey
[balancers]
lb01 ansible_ssh_host=xx.xx.xx.xx ansible_ssh_private_key_file=sshkey ansible_python_interpreter=/usr/local/bin/python2.7
lb02 ansible_ssh_host=xx.xx.xx.xx ansible_ssh_private_key_file=sshkey ansible_python_interpreter=/usr/local/bin/python2.7
#### Contents of the preconfiguration file (for stretch)
### Localization
# Preseeding only locale sets language, country and locale.
#d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
d-i debian-installer/language string en
d-i debian-installer/country string DK
d-i debian-installer/locale string en_DK.UTF-8
# Optionally specify additional locales to be generated.
rke up - config cluster.yaml
for node in 1.2.3.4 1.2.3.4.5; do ssh rancher@$node; done
docker run -d -v $PWD/sshkeys:/usr/share/nginx/html -p 8081:80 nginx
cd /opt/rke/kubernetes
cp ssl/kube-apiserver.pem .tmp/kube-adm.pem
cp ssl/kube-apiserver.key .tmp/kube-adm.key