From 022b375185dacebcce15bea72486279b159f1a4b Mon Sep 17 00:00:00 2001 From: Lord Anton Hvornum Date: Thu, 24 May 2018 20:39:35 +0200 Subject: Rebased the deployment examples --- deployments/00:11:22:33:44:55.json | 20 ++++++++++++++++++++ deployments/00_11_22_33_44_55.json | 20 -------------------- deployments/08:00:27:36:83:9b.json | 21 --------------------- deployments/08:00:27:6f:0c:25.json | 29 ----------------------------- deployments/08:00:27:d4:fd:ef.json | 17 ----------------- deployments/08:00:27:e0:e0:e6.json | 31 ------------------------------- deployments/9c:d6:43:ae:11:4f.json | 5 ----- deployments/default.json | 37 ------------------------------------- deployments/dns_server.json | 29 +++++++++++++++++++++++++++++ deployments/local_mirror.json | 31 +++++++++++++++++++++++++++++++ deployments/minimal_example.json | 5 +++++ deployments/router.json | 17 +++++++++++++++++ 12 files changed, 102 insertions(+), 160 deletions(-) create mode 100644 deployments/00:11:22:33:44:55.json delete mode 100644 deployments/00_11_22_33_44_55.json delete mode 100644 deployments/08:00:27:36:83:9b.json delete mode 100644 deployments/08:00:27:6f:0c:25.json delete mode 100644 deployments/08:00:27:d4:fd:ef.json delete mode 100644 deployments/08:00:27:e0:e0:e6.json delete mode 100644 deployments/9c:d6:43:ae:11:4f.json delete mode 100644 deployments/default.json create mode 100644 deployments/dns_server.json create mode 100644 deployments/local_mirror.json create mode 100644 deployments/minimal_example.json create mode 100644 deployments/router.json diff --git a/deployments/00:11:22:33:44:55.json b/deployments/00:11:22:33:44:55.json new file mode 100644 index 00000000..5526629e --- /dev/null +++ b/deployments/00:11:22:33:44:55.json @@ -0,0 +1,20 @@ +{ + "args" : { + "include" : "workstation", + "user" : "anton", + "password" : "1111", + "drive" : "/dev/sdb", + "post" : "don't reboot" + }, + "post" : { + "Setup a basic virtual environment": { + "mkdir -p /home/{user}/virts" : {"pass-args" : true}, + "qemu-img create -f qcow2 /home/{user}/virts/test_deploy.qcow2 4G" : {"pass-args" : true}, + "chown -R {user}.{user} /home/{user}/virts" : {"pass-args" : true} + }, + "Setup user" : { + "useradd -m -G wheel -s /bin/bash anton" : null, + "sh -c \"echo {user}:{password} | chpasswd\"" : {"pass-args" : true} + } + } +} diff --git a/deployments/00_11_22_33_44_55.json b/deployments/00_11_22_33_44_55.json deleted file mode 100644 index 5526629e..00000000 --- a/deployments/00_11_22_33_44_55.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "args" : { - "include" : "workstation", - "user" : "anton", - "password" : "1111", - "drive" : "/dev/sdb", - "post" : "don't reboot" - }, - "post" : { - "Setup a basic virtual environment": { - "mkdir -p /home/{user}/virts" : {"pass-args" : true}, - "qemu-img create -f qcow2 /home/{user}/virts/test_deploy.qcow2 4G" : {"pass-args" : true}, - "chown -R {user}.{user} /home/{user}/virts" : {"pass-args" : true} - }, - "Setup user" : { - "useradd -m -G wheel -s /bin/bash anton" : null, - "sh -c \"echo {user}:{password} | chpasswd\"" : {"pass-args" : true} - } - } -} diff --git a/deployments/08:00:27:36:83:9b.json b/deployments/08:00:27:36:83:9b.json deleted file mode 100644 index c6e4f698..00000000 --- a/deployments/08:00:27:36:83:9b.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "args" : { - "password" : "0000" - }, - "pre" : { - "sh -c \"echo -n -e '[arch_offline]\nSigLevel = Optional TrustAll\nServer = http://localmirror.lan/archlinux/os/${arch}' >> /etc/pacman.conf\"" : null - }, - "post" : { - "Setup openssh": { - "pacman -Syy --noconfirm openssh" : null - }, - "Setup OpenVPN": { - "pacman -Syy --noconfirm openvpn" : null - }, - "Setup autostarts": { - "systemctl enable dhcpcd" : null, - "systemctl enable openssh" : null, - "systemctl enable openvpn-client@testclient" : null - } - } -} diff --git a/deployments/08:00:27:6f:0c:25.json b/deployments/08:00:27:6f:0c:25.json deleted file mode 100644 index 423fe872..00000000 --- a/deployments/08:00:27:6f:0c:25.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "args" : { - "password" : "0000", - "post" : "stay" - }, - "post" : { - "Installing DNS + Database": { - "pacman -Syy --noconfirm powerdns postgresql" : null - }, - "Setup Database": { - "sh -c \"echo 'postgres:{pin}' | chpasswd\"" : null, - "su - postgres -c \"initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'\"" : null, - "systemctl start postgresql" : null, - "su - postgres -c \"psql -c \\\"CREATE USER pdns WITH PASSWORD 'SomePassword';\\\"\"" : {"debug" : true} - }, - "Setup DNS": { - "sh -c \"echo -e 'launch=gpgsql\ngpgsql-host=127.0.0.1\ngpgsql-user=pdns\ngpgsql-dbname=pdns\ngpgsql-password={PIN}' >> /etc/powerdns/pdns.conf\"" : null, - "psql -U pdns -d pdns -a -f /usr/share/doc/powerdns/schema.pgsql.sql" : null - }, - "Install DNS Entries": { - - }, - "Setup autostarts": { - "systemctl enable dhcpcd" : null, - "systemctl enable postgresql" : null, - "systemctl enable powerdns" : null - } - } -} diff --git a/deployments/08:00:27:d4:fd:ef.json b/deployments/08:00:27:d4:fd:ef.json deleted file mode 100644 index 48e038c0..00000000 --- a/deployments/08:00:27:d4:fd:ef.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Setup temp build env": { - "pacman -Syy --noconfirm git" : null, - "useradd -m -G wheel builder" : null, - "sed -i 's/# %wheel ALL=(ALL) NO/%wheel ALL=(ALL) NO/' /etc/sudoers" : null - }, - "install slimdhcp": { - "git clone https://aur.archlinux.org/slimdhcp-git.git /home/builder/slimdhcp" : null, - "chown -R builder.builder /home/builder/slimdhcp" : null, - "su - builder -c \"(cd /home/builder/slimdhcp/; /usr/bin/makepkg -s --noconfirm)\"" : null, - "sh -c 'pacman -U --noconfirm /home/builder/slimdhcp/*.xz'" : null - }, - "Remove temp build env": { - "rm -rf /home/builder/slimdhcp" : null, - "sed -i 's/%wheel ALL=(ALL) NO/# %wheel ALL=(ALL) NO/' /etc/sudoers" : null - } -} diff --git a/deployments/08:00:27:e0:e0:e6.json b/deployments/08:00:27:e0:e0:e6.json deleted file mode 100644 index 79347f8b..00000000 --- a/deployments/08:00:27:e0:e0:e6.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "args" : { - "password" : "0001" - }, - "post" : { - "Setup temp build env": { - "pacman -Syy --noconfirm git" : null, - "useradd -m -G wheel builder" : null, - "sed -i 's/# %wheel ALL=(ALL) NO/%wheel ALL=(ALL) NO/' /etc/sudoers" : null - }, - "install lighttpd2-git": { - "git clone https://aur.archlinux.org/lighttpd2-git.git /home/builder/lighttpd2" : null, - "chown -R builder.builder /home/builder/lighttpd2" : null, - "su - builder -c \"(cd /home/builder/lighttpd2/; /usr/bin/makepkg -s --noconfirm)\"" : null, - "sh -c 'pacman -U --noconfirm /home/builder/lighttpd2/*.xz'" : null - }, - "Remove temp build env": { - "rm -rf /home/builder/lighttpd2" : null, - "sed -i 's/%wheel ALL=(ALL) NO/# %wheel ALL=(ALL) NO/' /etc/sudoers" : null - }, - "Create mirror": { - "mkdir -p /srv/http/archlinux/arch_offline/os/x86_64" : null, - "pacman --noconfirm --dbpath /tmp/ -Syu -w --cachedir /srv/http/archlinux/arch_offline/os/x86_64 base base-devel git python python-systemd awesome xorg-xinit xorg-server xterm nano screen sudo iptables mesa-libgl dhclient dnsmasq darkhttpd openssh sshfs openssl openvpn gcc openvpn rtorrent powerdns postgresql" : null, - "sh -c 'repo-add /srv/http/archlinux/arch_offline/os/x86_64/arch_offline.db.tar.gz /srv/http/archlinux/arch_offline/os/x86_64/*.pkg.tar.xz'" : null - }, - "Setup autostarts": { - "systemctl enable dhcpcd" : null, - "systemctl enable lighttpd2" : null - } - } -} diff --git a/deployments/9c:d6:43:ae:11:4f.json b/deployments/9c:d6:43:ae:11:4f.json deleted file mode 100644 index ab988e44..00000000 --- a/deployments/9c:d6:43:ae:11:4f.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "install ssh": { - "pacman -Syy --noconfirm cmatrix" : null - } -} diff --git a/deployments/default.json b/deployments/default.json deleted file mode 100644 index c2d34267..00000000 --- a/deployments/default.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "args" : { - "password" : "", - "user" : "anton", - "_webbrowser" : "chromium", - "_window_manager" : "awesome", - "_keyboard_layout" : "sv-latin1" - }, - "post" : { - "Install workstation packages": { - "pacman -Syy --noconfirm {_webbrowser} {_window_manager} openssh sshfs git dhclient ttf-freefont xorg-server xorg-xrandr xorg-xinit xterm nano wget pulseaudio pulseaudio-alsa pavucontrol smbclient cifs-utils xscreensaver" : null - }, - "Enable autostarts": { - "systemctl enable dhcpcd" : null - }, - "Setup desktop environment" : { - "sed -i 's/^twm &/#&/' /etc/X11/xinit/xinitrc" : null, - "sed -i 's/^xclock/#&/' /etc/X11/xinit/xinitrc" : null, - "sed -i 's/^xterm/#&/' /etc/X11/xinit/xinitrc" : null, - "sed -i 's/^exec xterm/#&/' /etc/X11/xinit/xinitrc" : null, - "sh -c \"echo 'setxkbmap se' >> /etc/X11/xinit/xinitrc\"" : null, - "sh -c \"echo 'xscreensaver -no-splash &' >> /etc/X11/xinit/xinitrc\"" : null, - "sh -c \"echo 'exec {_window_manager}' >> /etc/X11/xinit/xinitrc\"" : {"pass-args" : true}, - "sh -c \"echo 'KEYMAP={_keyboard_layout}\nFONT=lat9w-16' >> /etc/vconsole.conf\"" : {"pass-args" : true}, - "sh -c \"sed -i 's/{ \\\"open terminal\\\", terminal/{ \\\"Chromium\\\", \\\"chromium\\\" },\n &1/' /etc/xdg/awesome/rc.lua\"" : null, - "sh -c \"sed -i 's/{ \\\"open terminal\\\", terminal/{ \\\"File handler\\\", \\\"nemo\\\" },\n &1/' /etc/xdg/awesome/rc.lua\"" : null, - "sh -c \"sed -i 's/^globalkeys = gears.table.join(/&\n awful.key({ modkey, }, \\\"l\\\", function() awful.spawn(\\\"xscreensaver-command -lock &\\\") end),\n/' /etc/xdg/awesome/rc.lua\"" : null, - "sh -c \"awk -i inplace -v RS='' '{gsub(/awful.key\\({ modkey,.*?}, \\\"Tab\\\",.*?\\\"client\\\"}\\),/, \\\"awful.key({ modkey, }, \\\"Tab\\\",\\\n function ()\\\n awful.client.focus.byidx(-1)\\\n if client.focus then\\\n client.focus:raise()\\\n end\\\n end),\\\n awful.key({ modkey, \\\"Shift\\\" }, \\\"Tab\\\",\\\n function ()\\\n awful.client.focus.byidx(1)\\\n if client.focus then\\\n client.focus.raise()\\\n end\\\n end),\\\"); print}' /etc/xdg/awesome/rc.lua\"" : null, - "gsettings set org.nemo.desktop show-desktop-icons false" : null, - "xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search" : null - }, - "Setup users" : { - "useradd -m -G wheel -s /bin/bash anton" : null, - "sh -c \"echo {user}:{password} | chpasswd\"" : {"pass-args" : true} - } - } -} diff --git a/deployments/dns_server.json b/deployments/dns_server.json new file mode 100644 index 00000000..423fe872 --- /dev/null +++ b/deployments/dns_server.json @@ -0,0 +1,29 @@ +{ + "args" : { + "password" : "0000", + "post" : "stay" + }, + "post" : { + "Installing DNS + Database": { + "pacman -Syy --noconfirm powerdns postgresql" : null + }, + "Setup Database": { + "sh -c \"echo 'postgres:{pin}' | chpasswd\"" : null, + "su - postgres -c \"initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'\"" : null, + "systemctl start postgresql" : null, + "su - postgres -c \"psql -c \\\"CREATE USER pdns WITH PASSWORD 'SomePassword';\\\"\"" : {"debug" : true} + }, + "Setup DNS": { + "sh -c \"echo -e 'launch=gpgsql\ngpgsql-host=127.0.0.1\ngpgsql-user=pdns\ngpgsql-dbname=pdns\ngpgsql-password={PIN}' >> /etc/powerdns/pdns.conf\"" : null, + "psql -U pdns -d pdns -a -f /usr/share/doc/powerdns/schema.pgsql.sql" : null + }, + "Install DNS Entries": { + + }, + "Setup autostarts": { + "systemctl enable dhcpcd" : null, + "systemctl enable postgresql" : null, + "systemctl enable powerdns" : null + } + } +} diff --git a/deployments/local_mirror.json b/deployments/local_mirror.json new file mode 100644 index 00000000..79347f8b --- /dev/null +++ b/deployments/local_mirror.json @@ -0,0 +1,31 @@ +{ + "args" : { + "password" : "0001" + }, + "post" : { + "Setup temp build env": { + "pacman -Syy --noconfirm git" : null, + "useradd -m -G wheel builder" : null, + "sed -i 's/# %wheel ALL=(ALL) NO/%wheel ALL=(ALL) NO/' /etc/sudoers" : null + }, + "install lighttpd2-git": { + "git clone https://aur.archlinux.org/lighttpd2-git.git /home/builder/lighttpd2" : null, + "chown -R builder.builder /home/builder/lighttpd2" : null, + "su - builder -c \"(cd /home/builder/lighttpd2/; /usr/bin/makepkg -s --noconfirm)\"" : null, + "sh -c 'pacman -U --noconfirm /home/builder/lighttpd2/*.xz'" : null + }, + "Remove temp build env": { + "rm -rf /home/builder/lighttpd2" : null, + "sed -i 's/%wheel ALL=(ALL) NO/# %wheel ALL=(ALL) NO/' /etc/sudoers" : null + }, + "Create mirror": { + "mkdir -p /srv/http/archlinux/arch_offline/os/x86_64" : null, + "pacman --noconfirm --dbpath /tmp/ -Syu -w --cachedir /srv/http/archlinux/arch_offline/os/x86_64 base base-devel git python python-systemd awesome xorg-xinit xorg-server xterm nano screen sudo iptables mesa-libgl dhclient dnsmasq darkhttpd openssh sshfs openssl openvpn gcc openvpn rtorrent powerdns postgresql" : null, + "sh -c 'repo-add /srv/http/archlinux/arch_offline/os/x86_64/arch_offline.db.tar.gz /srv/http/archlinux/arch_offline/os/x86_64/*.pkg.tar.xz'" : null + }, + "Setup autostarts": { + "systemctl enable dhcpcd" : null, + "systemctl enable lighttpd2" : null + } + } +} diff --git a/deployments/minimal_example.json b/deployments/minimal_example.json new file mode 100644 index 00000000..ec5e7d1c --- /dev/null +++ b/deployments/minimal_example.json @@ -0,0 +1,5 @@ +{ + "install cmatrix": { + "pacman -Syy --noconfirm cmatrix" : null + } +} diff --git a/deployments/router.json b/deployments/router.json new file mode 100644 index 00000000..48e038c0 --- /dev/null +++ b/deployments/router.json @@ -0,0 +1,17 @@ +{ + "Setup temp build env": { + "pacman -Syy --noconfirm git" : null, + "useradd -m -G wheel builder" : null, + "sed -i 's/# %wheel ALL=(ALL) NO/%wheel ALL=(ALL) NO/' /etc/sudoers" : null + }, + "install slimdhcp": { + "git clone https://aur.archlinux.org/slimdhcp-git.git /home/builder/slimdhcp" : null, + "chown -R builder.builder /home/builder/slimdhcp" : null, + "su - builder -c \"(cd /home/builder/slimdhcp/; /usr/bin/makepkg -s --noconfirm)\"" : null, + "sh -c 'pacman -U --noconfirm /home/builder/slimdhcp/*.xz'" : null + }, + "Remove temp build env": { + "rm -rf /home/builder/slimdhcp" : null, + "sed -i 's/%wheel ALL=(ALL) NO/# %wheel ALL=(ALL) NO/' /etc/sudoers" : null + } +} -- cgit v1.2.3-70-g09d2