diff options
author | 2023-08-13 14:59:36 +0100 | |
---|---|---|
committer | 2023-08-13 15:54:03 +0100 | |
commit | 431585b5256a0d08f4f3c33122465a88a93ddcb1 (patch) | |
tree | 4cc41cda81655332fa467e6c9c85d1ee9c35b90e /local_testing | |
parent | Serve static files from Turing (#116) (diff) |
Move all ansible files to their own folder
Diffstat (limited to 'local_testing')
-rw-r--r-- | local_testing/.gitignore | 1 | ||||
-rw-r--r-- | local_testing/README.md | 50 | ||||
-rw-r--r-- | local_testing/Vagrantfile | 91 | ||||
-rw-r--r-- | local_testing/hosts.yaml | 56 | ||||
-rwxr-xr-x | local_testing/scripts/push-keys | 7 |
5 files changed, 0 insertions, 205 deletions
diff --git a/local_testing/.gitignore b/local_testing/.gitignore deleted file mode 100644 index a977916..0000000 --- a/local_testing/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.vagrant/ diff --git a/local_testing/README.md b/local_testing/README.md deleted file mode 100644 index db3c409..0000000 --- a/local_testing/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Testing Locally - -### Requirements - -- [Vagrant](https://developer.hashicorp.com/vagrant/docs/installation) -- [VirtualBox](https://www.virtualbox.org/wiki/Downloads) - -## Get Started - -```shell -vagrant up # This will take a while -vagrant ssh # Get a shell, password=vagrant - -# inside control VM -/vagrant/scripts/push-keys # Push the control VM's ssh key to all nodes - -# run ansible -cd infra -# if you're on Windows, the `infra` directory will be mounted with permissions set to 777 -# which ansible will reject as insecure -# export the below environment variable to force anisble to accept the writable config -# export ANSIBLE_CONFIG='/home/vagrant/infra/ansible.cfg' -ansible-playbook playbook.yml --inventory local_testing/hosts.yaml --user vagrant -``` - -Below are the IPs of the VMs on the VirtualBox network -```yaml -vms: -- control: 192.168.56.1 -- hopper: 192.168.56.2 -- lovelace: 192.168.56.3 -- neumann: 192.168.56.4 -- richie: 192.168.56.5 -- turing: 192.168.56.6 -``` - - -# Fixes/Notes - -### There was an error when attempting to rsync a synced folder. - -```shell -vagrant plugin install vagrant-vbguest -``` - - -### Kernel module is not loaded -```shell -sudo modprobe vbox{drv,netadp,netflt} -``` diff --git a/local_testing/Vagrantfile b/local_testing/Vagrantfile deleted file mode 100644 index 011f9f3..0000000 --- a/local_testing/Vagrantfile +++ /dev/null @@ -1,91 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - config.vm.box = "bento/debian-11" - config.vm.box_version = "202212.11.0" - config.vm.provision "shell", inline: <<-SHELL - apt-get update - apt-get install -y python3 openssh-server - systemctl enable ssh - SHELL - - config.vm.define "control", primary: true do |control| - control.vm.hostname = "control" - control.vm.network "private_network", ip: "192.168.56.1", - virtualbox__intnet: true - control.vm.synced_folder "../", "/home/vagrant/infra" - control.vm.provision "shell", inline: <<-SHELL - apt-get install -y sshpass python3-pip - SHELL - - control.vm.provision "shell", privileged: false, inline: <<-SHELL - python3 -m pip install --user ansible dnspython - ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa <<< y - SHELL - - control.vm.provider "virtualbox" do |v| - v.name = "pydis_control" - end - end - - config.vm.define "hopper" do |hopper| - hopper.vm.hostname = "hopper" - hopper.vm.network "private_network", ip: "192.168.56.2", - virtualbox__intnet: true - hopper.vm.synced_folder '.', '/vagrant', disabled: true - - hopper.vm.provider "virtualbox" do |v| - v.name = "pydis_hopper" - v.memory = 2048 - end - end - - config.vm.define "lovelace" do |lovelace| - lovelace.vm.hostname = "lovelace" - lovelace.vm.network "private_network", ip: "192.168.56.3", - virtualbox__intnet: true - lovelace.vm.synced_folder '.', '/vagrant', disabled: true - - lovelace.vm.provider "virtualbox" do |v| - v.name = "pydis_lovelace" - v.memory = 2048 - end - end - - config.vm.define "neumann" do |neumann| - neumann.vm.hostname = "neumann" - neumann.vm.network "private_network", ip: "192.168.56.4", - virtualbox__intnet: true - neumann.vm.synced_folder '.', '/vagrant', disabled: true - - neumann.vm.provider "virtualbox" do |v| - v.name = "pydis_neumann" - v.memory = 2048 - end - end - - config.vm.define "ritchie" do |ritchie| - ritchie.vm.hostname = "ritchie" - ritchie.vm.network "private_network", ip: "192.168.56.5", - virtualbox__intnet: true - ritchie.vm.synced_folder '.', '/vagrant', disabled: true - - ritchie.vm.provider "virtualbox" do |v| - v.name = "pydis_ritchie" - v.memory = 2048 - end - end - - config.vm.define "turing" do |turing| - turing.vm.hostname = "turing" - turing.vm.network "private_network", ip: "192.168.56.6", - virtualbox__intnet: true - turing.vm.synced_folder '.', '/vagrant', disabled: true - - turing.vm.provider "virtualbox" do |v| - v.name = "pydis_turing" - v.memory = 2048 - end - end -end diff --git a/local_testing/hosts.yaml b/local_testing/hosts.yaml deleted file mode 100644 index d1759a3..0000000 --- a/local_testing/hosts.yaml +++ /dev/null @@ -1,56 +0,0 @@ -all: - hosts: - hopper: - ansible_host: 192.168.56.2 - ip: 192.168.56.2 - access_ip: 192.168.56.2 - lovelace: - ansible_host: 192.168.56.3 - ip: 192.168.56.3 - access_ip: 192.168.56.3 - neumann: - ansible_host: 192.168.56.4 - ip: 192.168.56.4 - access_ip: 192.168.56.4 - ritchie: - ansible_host: 192.168.56.5 - ip: 192.168.56.5 - access_ip: 192.168.56.5 - turing: - ansible_host: 192.168.56.6 - ip: 192.168.56.6 - access_ip: 192.168.56.6 - children: - kube_control_plane: - hosts: - hopper: - turing: - kube_node: - hosts: - hopper: - turing: - lovelace: - neumann: - ritchie: - etcd: - hosts: - hopper: - turing: - lovelace: - k8s_cluster: - children: - kube_control_plane: - kube_node: - calico_rr: - hosts: {} - podman: - hosts: - turing: - lovelace: - hopper: - ritchie: - nginx: - hosts: - turing: - ritchie: - neumann: diff --git a/local_testing/scripts/push-keys b/local_testing/scripts/push-keys deleted file mode 100755 index 6fdc85f..0000000 --- a/local_testing/scripts/push-keys +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -# Intended to be used in the "control" VM to push keys to the other hosts - -for i in {1..6} ; do - ssh-keyscan 192.168.56.$i >> ~/.ssh/known_hosts - sshpass -p vagrant ssh-copy-id 192.168.56.$i -done |