Compare commits
7 Commits
6c7265d1d3
...
63b8827725
Author | SHA1 | Date | |
---|---|---|---|
|
63b8827725 | ||
|
16eb703f68 | ||
|
c34f7c0912 | ||
|
625babddc4 | ||
|
759fece687 | ||
|
55fec03445 | ||
|
1d97921e7b |
@ -73,25 +73,25 @@
|
|||||||
- sudo
|
- sudo
|
||||||
- doas
|
- doas
|
||||||
- users
|
- users
|
||||||
- package_manager
|
# - package_manager
|
||||||
- zfs
|
# - zfs
|
||||||
- zrepl
|
# - zrepl
|
||||||
- zsh
|
# - zsh
|
||||||
- network
|
# - network
|
||||||
- sshd
|
# - sshd
|
||||||
- base
|
# - base
|
||||||
- firewall
|
- firewall
|
||||||
- cpu
|
# - cpu
|
||||||
- ntp
|
# - ntp
|
||||||
- nvme
|
# - nvme
|
||||||
- hosts
|
# - hosts
|
||||||
- build
|
# - build
|
||||||
- devfs
|
# - devfs
|
||||||
- jail
|
# - jail
|
||||||
- bhyve
|
# - bhyve
|
||||||
- wireguard
|
# - wireguard
|
||||||
- plainmacs
|
# - plainmacs
|
||||||
- mrmanager
|
# - mrmanager
|
||||||
|
|
||||||
- hosts: admin_git:public_dns
|
- hosts: admin_git:public_dns
|
||||||
vars:
|
vars:
|
||||||
|
@ -15,3 +15,5 @@
|
|||||||
rebase = true
|
rebase = true
|
||||||
[log]
|
[log]
|
||||||
date = local
|
date = local
|
||||||
|
[init]
|
||||||
|
defaultBranch = master
|
||||||
|
40
ansible/roles/base/files/watch_freebsd
Normal file
40
ansible/roles/base/files/watch_freebsd
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Imitate watch from linux
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
############## Setup #########################
|
||||||
|
|
||||||
|
function cleanup {
|
||||||
|
switch_to_main_screen
|
||||||
|
}
|
||||||
|
for sig in EXIT INT QUIT HUP TERM; do
|
||||||
|
trap "set +e; cleanup; exit" "$sig"
|
||||||
|
done
|
||||||
|
|
||||||
|
############## Program #########################
|
||||||
|
|
||||||
|
function main {
|
||||||
|
switch_to_alt_screen
|
||||||
|
while true; do
|
||||||
|
local output=$("$@")
|
||||||
|
clear
|
||||||
|
cat <<<"$output"
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function switch_to_alt_screen {
|
||||||
|
# tput smcup
|
||||||
|
echo -e "\e[?1049h"
|
||||||
|
clear
|
||||||
|
}
|
||||||
|
|
||||||
|
function switch_to_main_screen {
|
||||||
|
# tput rmcup
|
||||||
|
echo -e "\e[?1049l"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
8
ansible/roles/base/files/watch_linux
Normal file
8
ansible/roles/base/files/watch_linux
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Invoke watch
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
exec watch "$@"
|
@ -94,6 +94,8 @@
|
|||||||
loop:
|
loop:
|
||||||
- src: bemount.bash
|
- src: bemount.bash
|
||||||
dest: /usr/local/bin/bemount
|
dest: /usr/local/bin/bemount
|
||||||
|
- src: watch_freebsd
|
||||||
|
dest: /usr/local/bin/ww
|
||||||
|
|
||||||
- name: Install rc script
|
- name: Install rc script
|
||||||
copy:
|
copy:
|
||||||
@ -121,4 +123,3 @@
|
|||||||
group: wheel
|
group: wheel
|
||||||
loop:
|
loop:
|
||||||
- disk_labels
|
- disk_labels
|
||||||
|
|
||||||
|
@ -37,3 +37,5 @@
|
|||||||
loop:
|
loop:
|
||||||
- src: mount_disk_image
|
- src: mount_disk_image
|
||||||
dest: /usr/local/bin/mount_disk_image
|
dest: /usr/local/bin/mount_disk_image
|
||||||
|
- src: watch_linux
|
||||||
|
dest: /usr/local/bin/ww
|
||||||
|
@ -14,29 +14,52 @@ udp_pass_in = "{ 53 51820 51821 51822 }"
|
|||||||
|
|
||||||
# options
|
# options
|
||||||
set skip on lo
|
set skip on lo
|
||||||
|
set optimization conservative
|
||||||
|
set block-policy return
|
||||||
|
set fail-policy drop
|
||||||
|
|
||||||
|
# normalization
|
||||||
|
scrub in on $ext_if all fragment reassemble
|
||||||
|
|
||||||
|
# translation
|
||||||
|
|
||||||
|
# Evaluation order of the translation rules is dependent on the type
|
||||||
|
# of the translation rules and of the direction of a packet. binat
|
||||||
|
# rules are always evaluated first. Then either the rdr rules are
|
||||||
|
# evaluated on an inbound packet or the nat rules on an outbound
|
||||||
|
# packet. Rules of the same type are evaluated in the same order in
|
||||||
|
# which they appear in the ruleset. The first matching rule decides
|
||||||
|
# what action is taken.
|
||||||
|
|
||||||
# redirections
|
# redirections
|
||||||
nat pass on lagg0 inet from $jail_nat_v4 to $not_jail_nat_v4 -> (lagg0)
|
nat on $ext_if inet from ! ($ext_if) to ! ($ext_if) -> ($ext_if)
|
||||||
nat pass on $not_ext_if inet from $jail_nat_v4 to 10.215.1.1 port 53 -> ($ext_if)
|
rdr pass proto {tcp, udp} from any to 10.215.1.1 port 53 tag REDIREXTERNAL -> 1.1.1.1 port 53
|
||||||
rdr pass on $not_ext_if proto {tcp, udp} from $jail_nat_v4 to 10.215.1.1 port 53 -> 1.1.1.1 port 53
|
|
||||||
|
|
||||||
rdr pass on $ext_if inet proto tcp from $not_jail_nat_v4 to any port 6443 -> 10.215.1.204 port 6443
|
rdr pass on $ext_if proto {tcp, udp} to ($ext_if) port 6443 -> 10.215.1.204 port 6443
|
||||||
rdr pass on jail_nat inet proto tcp from $jail_nat_v4 to any port 6443 -> 10.215.1.204 port 6443
|
rdr pass on jail_nat proto {tcp, udp} to ($ext_if) port 6443 tag REDIRINTERNAL -> 10.215.1.204 port 6443
|
||||||
nat pass on $not_ext_if proto {tcp, udp} from $not_jail_nat_v4 to 10.215.1.204 port 6443 -> (jail_nat)
|
|
||||||
nat pass on $not_ext_if proto {tcp, udp} from $jail_nat_v4 to 10.215.1.204 port 6443 -> (jail_nat)
|
|
||||||
|
|
||||||
rdr pass on $ext_if inet proto tcp from $not_jail_nat_v4 to $not_jail_nat_v4 port 65099 -> 10.215.1.210 port 22
|
rdr pass on $ext_if proto {tcp, udp} to ($ext_if) port 19993 -> 10.215.1.204 port 19993
|
||||||
rdr pass on jail_nat inet proto tcp from $jail_nat_v4 to $not_jail_nat_v4 port 65099 -> 10.215.1.210 port 22
|
rdr pass on jail_nat proto {tcp, udp} to ($ext_if) port 19993 tag REDIRINTERNAL -> 10.215.1.204 port 19993
|
||||||
# nat pass on $not_ext_if proto {tcp, udp} from $not_jail_nat_v4 to 10.215.1.210 port 65099 -> (jail_nat)
|
|
||||||
# nat pass on $not_ext_if proto {tcp, udp} from $jail_nat_v4 to 10.215.1.210 port 65099 -> (lagg0)
|
rdr pass proto {tcp, udp} from $not_jail_nat_v4 to ($ext_if) port 65099 -> 10.215.1.210 port 22
|
||||||
|
rdr pass proto {tcp, udp} from $jail_nat_v4 to ($ext_if) port 65099 tag REDIRINTERNAL -> 10.215.1.210 port 22
|
||||||
|
|
||||||
rdr pass proto {tcp, udp} from $not_jail_nat_v4 to ($ext_if) port 53 -> 10.215.1.211 port 53
|
rdr pass proto {tcp, udp} from $not_jail_nat_v4 to ($ext_if) port 53 -> 10.215.1.211 port 53
|
||||||
rdr pass proto {tcp, udp} from $jail_nat_v4 to ($ext_if) port 53 tag REDIRINTERNAL -> 10.215.1.211 port 53
|
rdr pass proto {tcp, udp} from $jail_nat_v4 to ($ext_if) port 53 tag REDIRINTERNAL -> 10.215.1.211 port 53
|
||||||
nat pass proto {tcp, udp} tagged REDIRINTERNAL -> (jail_nat)
|
|
||||||
|
nat pass tagged REDIRINTERNAL -> (jail_nat)
|
||||||
|
nat pass tagged REDIREXTERNAL -> ($ext_if)
|
||||||
|
|
||||||
# filtering
|
# filtering
|
||||||
block log all
|
block log all
|
||||||
pass out on $ext_if
|
pass quick proto {icmp, icmp6} all
|
||||||
|
pass out quick on $ext_if
|
||||||
|
# We pass on the interfaces listed in allow rather than skipping on
|
||||||
|
# them because changes to pass rules will update when running a
|
||||||
|
# `service pf reload` but interfaces that we `skip` will not update (I
|
||||||
|
# forget if its from adding, removing, or both. TODO: test to figure
|
||||||
|
# it out). Also skipped interfaces are not subject to nat/rdr rules.
|
||||||
|
pass quick on $allow
|
||||||
|
|
||||||
# Single interface kubernetes cluster is working with the following run on mrmanager:
|
# Single interface kubernetes cluster is working with the following run on mrmanager:
|
||||||
# doas route add -host 74.80.180.139 -interface jail_nat
|
# doas route add -host 74.80.180.139 -interface jail_nat
|
||||||
@ -47,17 +70,8 @@ pass quick from any to $pub_k8s
|
|||||||
|
|
||||||
pass in on jail_nat
|
pass in on jail_nat
|
||||||
# Allow traffic from my machine to the jails/virtual machines
|
# Allow traffic from my machine to the jails/virtual machines
|
||||||
pass out on jail_nat from $jail_nat_v4
|
pass out on jail_nat from (jail_nat:network)
|
||||||
|
|
||||||
# We pass on the interfaces listed in allow rather than skipping on
|
|
||||||
# them because changes to pass rules will update when running a
|
|
||||||
# `service pf reload` but interfaces that we `skip` will not update (I
|
|
||||||
# forget if its from adding, removing, or both. TODO: test to figure
|
|
||||||
# it out). Also skipped interfaces are not subject to nat/rdr rules.
|
|
||||||
pass quick on $allow
|
|
||||||
|
|
||||||
pass on $ext_if proto icmp all
|
|
||||||
pass on $ext_if proto icmp6 all
|
|
||||||
|
|
||||||
pass in on $ext_if proto tcp to any port $tcp_pass_in
|
pass in on $ext_if proto tcp to any port $tcp_pass_in
|
||||||
pass in on $ext_if proto udp to any port $udp_pass_in
|
pass in on $ext_if proto udp to any port $udp_pass_in
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
loop:
|
loop:
|
||||||
- kubeswitch
|
- kubeswitch
|
||||||
- flux-scm
|
- flux-scm
|
||||||
|
- kubectl-minio
|
||||||
|
|
||||||
- name: Update cache
|
- name: Update cache
|
||||||
when: buildaur.changed
|
when: buildaur.changed
|
||||||
@ -23,4 +24,5 @@
|
|||||||
- kubectx
|
- kubectx
|
||||||
- kubeswitch
|
- kubeswitch
|
||||||
- flux-scm
|
- flux-scm
|
||||||
|
- kubectl-minio
|
||||||
state: present
|
state: present
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
- name: Install packages
|
- name: Install packages
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- texlive-most
|
- texlive
|
||||||
state: present
|
state: present
|
||||||
|
1
ansible/roles/mrmanager/files/lockd_rc.conf
Normal file
1
ansible/roles/mrmanager/files/lockd_rc.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
rpc_lockd_enable="YES"
|
1
ansible/roles/mrmanager/files/mountd_rc.conf
Normal file
1
ansible/roles/mrmanager/files/mountd_rc.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
mountd_enable="YES"
|
1
ansible/roles/mrmanager/files/nfsd_rc.conf
Normal file
1
ansible/roles/mrmanager/files/nfsd_rc.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
nfs_server_enable="YES"
|
1
ansible/roles/mrmanager/files/rpcbind_rc.conf
Normal file
1
ansible/roles/mrmanager/files/rpcbind_rc.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
rpcbind_enable="YES"
|
1
ansible/roles/mrmanager/files/statd_rc.conf
Normal file
1
ansible/roles/mrmanager/files/statd_rc.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
rpc_statd_enable="YES"
|
@ -7,3 +7,35 @@
|
|||||||
loop:
|
loop:
|
||||||
- name: net.link.ether.inet.proxyall
|
- name: net.link.ether.inet.proxyall
|
||||||
value: "1"
|
value: "1"
|
||||||
|
|
||||||
|
- name: Install service configuration
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item }}_rc.conf"
|
||||||
|
dest: "/etc/rc.conf.d/{{ item }}"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- nfsd
|
||||||
|
- mountd
|
||||||
|
- lockd
|
||||||
|
- statd
|
||||||
|
- rpcbind
|
||||||
|
|
||||||
|
- name: Create zfs datasets
|
||||||
|
zfs:
|
||||||
|
name: zdata/k8spersistent
|
||||||
|
state: present
|
||||||
|
extra_zfs_properties:
|
||||||
|
sharenfs: "-network 10.215.1.0/24,-alldirs,-maproot=root:root"
|
||||||
|
mountpoint: /k8spersistent
|
||||||
|
|
||||||
|
- name: Update ownership
|
||||||
|
file:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0777
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- /k8spersistent
|
||||||
|
Loading…
Reference in New Issue
Block a user