This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eux | |
HEADSET="alsa_output.usb-Logitech_Logitech_USB_Headset-00.analog-stereo" | |
HEADSET_MIC="alsa_input.usb-Logitech_Logitech_USB_Headset-00.analog-mono" | |
#pacmd list-sink-inputs | |
#pacmd list-source-outputs | |
pacmd stat | grep -E '^Default (sink|source) name' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eux | |
FILES="$*" | |
SUBJECT_KEYWORDS="active, adventure, backpack, backpacker" | |
DESCRIPTION="My description" | |
TITLE="My title" | |
LICENSE_LINK="https://creativecommons.org/licenses/by-sa/4.0/" | |
AUTHOR="Petr Ruzicka <petr.ruzicka@gmail.com>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Vagrant and virsh command | |
dnf install -y libvirt-client vagrant-hostmanager vagrant-libvirt | |
# Allow to manage VMs via libvirt remotely (using TCP connection) | |
cat >> /etc/libvirt/libvirtd.conf << EOF | |
listen_tls = 0 | |
listen_tcp = 1 | |
listen_addr = "0.0.0.0" | |
auth_tcp = "none" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
mkdir test | |
cd test | |
curl https://raw.githubusercontent.com/ruzickap/packer-templates/master/http/windows-server-2016/Autounattend.xml | sed '/.*Microsoft-Windows-PnpCustomizationsWinPE.*/,/component>/d' > Autounattend.xml | |
wget -c https://raw.githubusercontent.com/ruzickap/packer-templates/master/scripts/win-common/fixnetwork.ps1 | |
test -f packer || ( wget https://releases.hashicorp.com/packer/1.2.0/packer_1.2.0_linux_amd64.zip && unzip packer_1.2.0_linux_amd64.zip && rm packer_1.2.0_linux_amd64.zip ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@kube01:~# kubectl get nodes | |
NAME STATUS ROLES AGE VERSION | |
kube01 Ready master,node 7m v1.8.3+coreos.0 | |
kube02 Ready master,node 7m v1.8.3+coreos.0 | |
kube03 Ready node 7m v1.8.3+coreos.0 | |
kube04 Ready node 7m v1.8.3+coreos.0 | |
root@kube01:~# kubectl get componentstatuses | |
NAME STATUS MESSAGE ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create Virtual env for Kubespray and make it active | |
virtualenv --system-site-packages kubespray_virtenv | |
source kubespray_virtenv/bin/activate | |
# Install Ansible and Kubespray to virtualenv | |
pip install kubespray | |
# Create kubespray config file | |
cat > ~/.kubespray.yml << EOF | |
kubespray_git_repo: "https://github.com/kubespray/kubespray.git" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Vagrant libvirt plugin (with all the dependencies like qemu, libvirt, vagrant, ...) | |
dnf install -y -q ansible git libvirt-client libvirt-nss python-netaddr python-virtualenv vagrant-libvirt | |
vagrant plugin install vagrant-libvirt | |
# Enable dns resolution of VMs taken from libvirt (https://lukas.zapletalovi.com/2017/10/definitive-solution-to-libvirt-guest-naming.html) | |
sed -i.orig 's/files dns myhostname/files libvirt libvirt_guest dns myhostname/' /etc/nsswitch.conf | |
# Start the libvirt daemon | |
service libvirtd start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export VIRTIO_WIN_ISO_DIR=$(mktemp -d --suffix=_virtio-win-iso) | |
export NAME=windows-server-2016-standard-x64-eval | |
export WINDOWS_VERSION=2016 | |
export WINDOWS_TYPE=server | |
export TMPDIR="/var/tmp/" | |
cd /var/tmp/packer_windows-server-2016-eval | |
# Download and mount virtio-win to provide basic virtio Windows drivers | |
wget -c https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prepare directory structure | |
mkdir -p /var/tmp/packer_windows-server-2016-eval/{scripts/win-common,http/windows-server-2016,ansible} | |
cd /var/tmp/packer_windows-server-2016-eval | |
# Download Autounattended file for Windows Server 2016 Evaluation | |
wget -c -P http/windows-server-2016 https://raw.githubusercontent.com/ruzickap/packer-templates/master/http/windows-server-2016/Autounattend.xml | |
# Create some basic Ansible playbook for Windows provisioning | |
cat > ansible/win.yml << EOF | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install necessary packages | |
dnf install -y -q ansible qemu-img qemu-kvm wget unzip | |
# Download and unpack Packer | |
cd /tmp | |
wget https://releases.hashicorp.com/packer/1.1.3/packer_1.1.3_linux_amd64.zip | |
unzip packer*.zip | |
# Use packerio as a binary name, because packer binary already exists in fedora : /usr/sbin/packer as part of cracklib-dicts package | |
mv packer /usr/local/bin/packerio |