diff options
Diffstat (limited to 'http')
-rw-r--r-- | http/cleanup-vyos-configure.py | 25 | ||||
-rw-r--r-- | http/debian_11-vyos.list | 6 | ||||
-rw-r--r-- | http/debian_11.list | 5 | ||||
-rw-r--r-- | http/debian_12-vyos.list | 7 | ||||
-rw-r--r-- | http/debian_12.list | 13 | ||||
-rw-r--r-- | http/install-image.py | 55 |
6 files changed, 111 insertions, 0 deletions
diff --git a/http/cleanup-vyos-configure.py b/http/cleanup-vyos-configure.py new file mode 100644 index 0000000..b58b03b --- /dev/null +++ b/http/cleanup-vyos-configure.py @@ -0,0 +1,25 @@ +import json +from vyos.configtree import ConfigTree + +config_path = '/config/config.boot' + +with open(config_path, 'r') as file: + config_string = file.read() + +config = ConfigTree(config_string=config_string) + +interfaces = config.list_nodes(['interfaces', 'ethernet']) + +# remove all hw-id from interfaces ethernet since it cause issue on interface order +# for interface in interfaces: +# hw_id_path = ['interfaces', 'ethernet', interface, 'hw-id'] +# if config.exists(hw_id_path): +# config.delete(hw_id_path) + +# remove all interfaces ethernet +for interface in interfaces: + hw_id_path = ['interfaces', 'ethernet', interface] + config.delete(hw_id_path) + +with open(config_path, 'w') as config_file: + config_file.write(config.to_string()) diff --git a/http/debian_11-vyos.list b/http/debian_11-vyos.list new file mode 100644 index 0000000..5c94539 --- /dev/null +++ b/http/debian_11-vyos.list @@ -0,0 +1,6 @@ +# temporary debian list to add debian software +deb http://deb.debian.org/debian buster main contrib non-free +#deb-src http://deb.debian.org/debian buster main contrib non-free +deb http://security.debian.org/debian-security/ buster/updates main contrib non-free +#deb-src http://security.debian.org/debian-security/ buster/updates main contrib non-free +deb http://dev.packages.vyos.net/repositories/equuleus equuleus main diff --git a/http/debian_11.list b/http/debian_11.list new file mode 100644 index 0000000..a5315c9 --- /dev/null +++ b/http/debian_11.list @@ -0,0 +1,5 @@ +# temporary debian list to add debian software +deb http://deb.debian.org/debian buster main contrib non-free +#deb-src http://deb.debian.org/debian buster main contrib non-free +deb http://security.debian.org/debian-security/ buster/updates main contrib non-free +#deb-src http://security.debian.org/debian-security/ buster/updates main contrib non-free diff --git a/http/debian_12-vyos.list b/http/debian_12-vyos.list new file mode 100644 index 0000000..2bbf859 --- /dev/null +++ b/http/debian_12-vyos.list @@ -0,0 +1,7 @@ +# temporary debian list to add debian software +deb http://deb.debian.org/debian bookworm contrib main non-free non-free-firmware +deb http://deb.debian.org/debian bookworm-updates contrib main non-free non-free-firmware +# deb http://deb.debian.org/debian bookworm-backports contrib main non-free non-free-firmware +deb http://deb.debian.org/debian-security bookworm-security contrib main non-free non-free-firmware + +deb http://dev.packages.vyos.net/repositories/current current main diff --git a/http/debian_12.list b/http/debian_12.list new file mode 100644 index 0000000..22f08cd --- /dev/null +++ b/http/debian_12.list @@ -0,0 +1,13 @@ +# temporary debian list to add debian software +deb http://deb.debian.org/debian bookworm contrib main non-free non-free-firmware +deb http://deb.debian.org/debian bookworm-updates contrib main non-free non-free-firmware +# deb http://deb.debian.org/debian bookworm-backports contrib main non-free non-free-firmware +deb http://deb.debian.org/debian-security bookworm-security contrib main non-free non-free-firmware + + + +# deb http://deb.debian.org/debian bookworm main contrib non-free +# deb-src http://deb.debian.org/debian bookworm main contrib non-free +# deb http://security.debian.org/debian-security/ bookworm/updates main contrib non-free +# deb-src http://security.debian.org/debian-security/ bookworm/updates main contrib non-free + diff --git a/http/install-image.py b/http/install-image.py new file mode 100644 index 0000000..6a7f314 --- /dev/null +++ b/http/install-image.py @@ -0,0 +1,55 @@ +#!/usr/bin/python + +import pexpect +import time +import sys +import os + +var_vm_name = os.getenv("VM_NAME", "vyos") +var_ssh_password = os.getenv("VM_PASSWORD", "vyos") + +install_process = pexpect.spawn("/opt/vyatta/sbin/install-image", logfile=sys.stdout, encoding='utf-8') + +install_process.expect("Would you like to continue") +time.sleep(0.2) +install_process.sendline("Yes") + +install_process.expect("Partition") +time.sleep(0.2) +install_process.sendline("Auto") + +install_process.expect("Install the image on") +time.sleep(0.2) +install_process.sendline("") + +install_process.expect("Continue") +time.sleep(0.2) +install_process.sendline("Yes") + +install_process.expect("How big of a root partition should I create") +time.sleep(0.2) +install_process.sendline("") + +install_process.expect("What would you like to name this image") +time.sleep(0.2) +install_process.sendline(var_vm_name) + +install_process.expect("Which one should I copy to") +time.sleep(0.2) +install_process.sendline("") + +install_process.expect("Enter password for user") +time.sleep(0.2) +install_process.sendline(var_ssh_password) + +install_process.expect("Retype password for user") +time.sleep(0.2) +install_process.sendline(var_ssh_password) + +install_process.expect("Which drive should GRUB modify the boot partition on") +time.sleep(0.2) +install_process.sendline("") + +# wait until process ends +install_process.wait() + |