Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| input { | |
| file { | |
| path => "/logs/*.log" | |
| type => "application-load-balancer" | |
| start_position => "beginning" | |
| sincedb_path => "log_sincedb" | |
| } | |
| } | |
| filter { | |
| if [type] == "application-load-balancer" { |
| sudo add-apt-repository ppa:webupd8team/java | |
| sudo apt-get update | |
| sudo apt-get install oracle-java7-installer | |
| sudo apt-get install oracle-java7-set-default |
| # allowed out | |
| echo 1 > /proc/sys/net/ipv4/ip_forward | |
| iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE | |
| iptables --append FORWARD --in-interface eth1 -j ACCEPT | |
| # forward port | |
| iptables -t nat -A PREROUTING -p tcp -d 192.95.39.129 --dport 80 -j DNAT --to-destination 10.0.0.3:80 | |
| iptables -t nat -A POSTROUTING -p tcp -d 10.0.0.3 --dport 80 -j SNAT --to-source 10.0.0.1 |
| lxc list --format=json | jq -r '.[]| select(.status=="Running").state.network.eth0.addresses[0].address + " " + select(.status=="Running").name' | sudo tee -a /etc/hosts |
| Ansible execution begins with the script: `bin/ansible`. This script is sym-linked to other names, such as ansible-playbook and ansible-pull, ansible-conneciton being the exception. | |
| When executed, this script looks at the first parameter passed to it. On Linux/Unix systems, this parameter is the name of the script itself. By examining this value, we can determine which CLI class we should load and execute. | |
| Ansible CLI Classes: | |
| - AdHocCLI (the plain "ansible" command) | |
| - PlaybookCLI (when run with "ansible-playbook") | |
| - PullCLI (when run with "ansible-pull") | |
| - DocCLI (when run with "ansible-doc") | |
| - GalaxyCLI (when run with "ansible-galaxy") |
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system Raspbian. Carry on using all the tools and packages you're used to with the officially-supported OS.
| # This tells kubecfg to read its config from the local directory | |
| export KUBECONFIG=./kubeconfig | |
| # Looking at the cluster | |
| kubectl get nodes | |
| kubectl get pods --namespace=kube-system | |
| # Running a single pod | |
| kubectl run --generator=run-pod/v1 --image=gcr.io/kuar-demo/kuard-amd64:1 kuard | |
| kubectl get pods |
| #!/bin/bash | |
| # This script allows you to chroot ("work on") | |
| # the raspbian sd card as if it's the raspberry pi | |
| # on your Ubuntu desktop/laptop | |
| # just much faster and more convenient | |
| # credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689 | |
| # make sure you have issued |
| #!/bin/bash | |
| function install_packages() { | |
| packages=( $@ ) | |
| sudo apt update | |
| sudo apt install --no-install-recommends -y ${packages[@]} | |
| } | |
| function create_dir() { | |
| dir_list=( $@ ) |