Compare commits
437 Commits
08454740d6
...
install_fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
504f8ecf09 | ||
|
|
7254bc8c7c | ||
|
|
a32f6bf0d1 | ||
|
|
996cb27a89 | ||
|
|
9008d9b7c6 | ||
|
|
38a1168a32 | ||
|
|
3a4344a112 | ||
|
|
18cb758986 | ||
|
|
e28c7f8968 | ||
|
|
5c17148635 | ||
|
|
199bb38dfb | ||
|
|
5af4a95940 | ||
|
|
daf35778c5 | ||
|
|
1866cf6290 | ||
|
|
23ef4d50b9 | ||
|
|
4aec400388 | ||
|
|
f211282376 | ||
|
|
96a96a0bc4 | ||
|
|
554a6aff65 | ||
|
|
14c5c7d0fd | ||
|
|
22f9a0efcd | ||
|
|
3e80452235 | ||
|
|
c68c069667 | ||
|
|
e08d93425a | ||
|
|
5b7cae49c3 | ||
|
|
e65504b5f3 | ||
|
|
158188c4c6 | ||
|
|
c587fcc2ac | ||
|
|
9d16c7bd7b | ||
|
|
2b3b9af70b | ||
|
|
53f370b1ee | ||
|
|
25c8c30488 | ||
|
|
4d754355b7 | ||
|
|
902c6e1127 | ||
|
|
98f98a8895 | ||
|
|
4a303d17d8 | ||
|
|
7f4c41bb32 | ||
|
|
c68a6aaa19 | ||
|
|
a36ebbf94c | ||
|
|
1044aa16b0 | ||
|
|
efcefc129a | ||
|
|
16dd93668d | ||
|
|
c457f6414b | ||
|
|
844466c2ca | ||
|
|
6cf6e61193 | ||
|
|
ca3ef67533 | ||
|
|
56c0add33f | ||
|
|
ba81687d42 | ||
|
|
144f83982d | ||
|
|
a97a03f642 | ||
|
|
fc47359184 | ||
|
|
812a762652 | ||
|
|
fb785e036b | ||
|
|
cdc7d13225 | ||
|
|
ec4583b79e | ||
|
|
cab8c8d955 | ||
|
|
33f582d17a | ||
|
|
295ac24361 | ||
|
|
42dd67f9da | ||
|
|
c173ea87cf | ||
|
|
33f45c56bf | ||
|
|
83389cb5cf | ||
|
|
4db3ef1ed3 | ||
|
|
fe7a083a7b | ||
|
|
cd0578d0a6 | ||
|
|
f56dcc7c42 | ||
|
|
83de1e3708 | ||
|
|
2b20ab5123 | ||
|
|
3ecb2fc790 | ||
|
|
44a49d7ac7 | ||
|
|
acfc9ac1a4 | ||
|
|
e733dcdcbf | ||
|
|
3099a18424 | ||
|
|
15c209fdd9 | ||
|
|
ee181b535e | ||
|
|
4d0fc61e13 | ||
|
|
2b54630053 | ||
|
|
84bd6be8e6 | ||
|
|
dd96520ad1 | ||
|
|
11a1d61581 | ||
|
|
bab2cfdc7b | ||
|
|
fd0c92f3eb | ||
|
|
6ac33d2538 | ||
|
|
8d4b345414 | ||
|
|
8beaf00693 | ||
|
|
181e650094 | ||
|
|
449f288214 | ||
|
|
f6df27d7a9 | ||
|
|
e3a7a410c4 | ||
|
|
345c62a477 | ||
|
|
e7528765a9 | ||
|
|
54860370c0 | ||
|
|
46b21370bd | ||
|
|
381e3fb591 | ||
|
|
5d4ebf90b3 | ||
|
|
7dcdcc906c | ||
|
|
a4abb96de3 | ||
|
|
5859a06c5d | ||
|
|
02223deb64 | ||
|
|
20e247f8ed | ||
|
|
b0186dc85b | ||
|
|
cac15febfa | ||
|
|
48fa3c7436 | ||
|
|
7dd922c2a2 | ||
|
|
ab6f7dbea5 | ||
|
|
fea86b00b4 | ||
|
|
197b8fcced | ||
|
|
0bec3dbe63 | ||
|
|
53caf8bc81 | ||
|
|
c37d0d9b9e | ||
|
|
a663a90ada | ||
|
|
2d976a1cf3 | ||
|
|
d8e8781287 | ||
|
|
502e18fdec | ||
|
|
24d83e95a5 | ||
|
|
3ed43b1b8a | ||
|
|
64e735abbf | ||
|
|
ed11bf1e65 | ||
|
|
c0afe006b8 | ||
|
|
1fe305576b | ||
|
|
fc400a98db | ||
|
|
4a63e1c23e | ||
|
|
379795f6e8 | ||
|
|
edd3c6a266 | ||
|
|
dd785692ce | ||
|
|
c6ff6a1f24 | ||
|
|
2f2d33296b | ||
|
|
2c1cf54de0 | ||
|
|
65be133ffe | ||
|
|
ee47c3cfa3 | ||
|
|
ff8bb0653b | ||
|
|
ff98873b32 | ||
|
|
67ad4e2dff | ||
|
|
60452b0aeb | ||
|
|
e043320e5c | ||
|
|
2f8c4fbfe8 | ||
|
|
233bf4e967 | ||
|
|
f7adfaf54d | ||
|
|
78c9dec4c4 | ||
|
|
53c12a5b1e | ||
|
|
7d94210d8f | ||
|
|
1ebf31dc11 | ||
|
|
82c30bdb77 | ||
|
|
d5e7fdd097 | ||
|
|
40fd7931d0 | ||
|
|
835fd340a2 | ||
|
|
94ef9ff3c8 | ||
|
|
62d3c010f5 | ||
|
|
e9e792961c | ||
|
|
281dffc9c0 | ||
|
|
5bd67bb02a | ||
|
|
4a76097a5e | ||
|
|
facfd01661 | ||
|
|
2ce4520cd6 | ||
|
|
814769b3e9 | ||
|
|
6424129da3 | ||
|
|
415edbad91 | ||
|
|
a773f94593 | ||
|
|
226610c926 | ||
|
|
7c6afef2bb | ||
|
|
55654fafb1 | ||
|
|
8946868fd6 | ||
|
|
cd8e9002d0 | ||
|
|
e1a274c88e | ||
|
|
cdc4bdffb6 | ||
|
|
9b9a103e49 | ||
|
|
ea7bf809fc | ||
|
|
88a6d046b8 | ||
|
|
d8e16f0b05 | ||
|
|
e3fee206a1 | ||
|
|
3be710b4ad | ||
|
|
b37f8a8e1a | ||
|
|
509cceb220 | ||
|
|
47408cfce0 | ||
|
|
812dc40257 | ||
|
|
0e370c0d62 | ||
|
|
0598c796b7 | ||
|
|
df2efb728d | ||
|
|
62fc955b68 | ||
|
|
e0644a069d | ||
|
|
054e056d00 | ||
|
|
d3ea8b3667 | ||
|
|
3f945f8ae3 | ||
|
|
93c4aa4c76 | ||
|
|
4664804d90 | ||
|
|
edc48d00a2 | ||
|
|
37aa0e6732 | ||
|
|
a739728d41 | ||
|
|
48c5aebd82 | ||
|
|
c33a1b6c50 | ||
|
|
368c455b7f | ||
|
|
5a5d34911c | ||
|
|
d0c1bb1b65 | ||
|
|
9d49eb9d6a | ||
|
|
ccbc999744 | ||
|
|
d537aa599b | ||
|
|
95d06dfe0e | ||
|
|
f2adb9328b | ||
|
|
7bc6e0c470 | ||
|
|
99edb2d161 | ||
|
|
938f8676ff | ||
|
|
d365b6aea9 | ||
|
|
8d911ff893 | ||
|
|
2aca77ea1a | ||
|
|
1b342d3402 | ||
|
|
9976e232e6 | ||
|
|
3baf18f435 | ||
|
|
e00331bf94 | ||
|
|
8e22d8febb | ||
|
|
ed0d1e41d6 | ||
|
|
2c27d580f4 | ||
|
|
75ac4b91f3 | ||
|
|
9abe43096b | ||
|
|
1535800e2f | ||
|
|
dcffced35a | ||
|
|
1da36ab7c5 | ||
|
|
c694c6ae4c | ||
|
|
f524aa168a | ||
|
|
308206d1cc | ||
|
|
8ac235cb8c | ||
|
|
5170678a25 | ||
|
|
19cf31b094 | ||
|
|
4f0024c4f9 | ||
|
|
41138ab34a | ||
|
|
f9b18809f9 | ||
|
|
fefe46b512 | ||
|
|
b4947bcff6 | ||
|
|
14baaddcff | ||
|
|
1c8f2f1c74 | ||
|
|
1bfe24f457 | ||
|
|
08feb8bad6 | ||
|
|
cb3b01a74c | ||
|
|
0e95edd8e7 | ||
|
|
d172b1dea2 | ||
|
|
2a97a1ee92 | ||
|
|
ba4085df1a | ||
|
|
7c542364a2 | ||
|
|
0299ebcb43 | ||
|
|
c23245b97c | ||
|
|
491412c33c | ||
|
|
5a5839482d | ||
|
|
63408f5664 | ||
|
|
d338b77d23 | ||
|
|
ce9140aa73 | ||
|
|
dbf3f2e983 | ||
|
|
0ca26e73fb | ||
|
|
0fb53a4294 | ||
|
|
4019e6d132 | ||
|
|
8b1e76d9d7 | ||
|
|
477637ae62 | ||
|
|
5146a114eb | ||
|
|
a817464b38 | ||
|
|
1acf889c68 | ||
|
|
af07d43c18 | ||
|
|
33f13d898d | ||
|
|
47d9e203f3 | ||
|
|
1a2ff987fe | ||
|
|
16480b3749 | ||
|
|
0d3901788d | ||
|
|
a3cb2c8632 | ||
|
|
6b9660bc44 | ||
|
|
5c41b7efa2 | ||
|
|
ead5db241e | ||
|
|
8b074617e8 | ||
|
|
13970b53ad | ||
|
|
13d7319a0f | ||
|
|
bd9a85efd3 | ||
|
|
4a4c54def4 | ||
|
|
18d372c8ee | ||
|
|
4599b38ebf | ||
|
|
04a95a2543 | ||
|
|
7c5f14ee61 | ||
|
|
d49f12f58f | ||
|
|
936d3bc34d | ||
|
|
1b34841921 | ||
|
|
611904761e | ||
|
|
f843b7924f | ||
|
|
7bb7b89b82 | ||
|
|
c1103775b6 | ||
|
|
24d89ed704 | ||
|
|
e8dff5ece1 | ||
|
|
e22b5c1c6c | ||
|
|
d9bc4f15d8 | ||
|
|
77ae96ca7a | ||
|
|
d2f908005c | ||
|
|
5e74a874ba | ||
|
|
fe820e5843 | ||
|
|
81315e4c7b | ||
|
|
ce8718b042 | ||
|
|
720164497d | ||
|
|
0b31b91c69 | ||
|
|
2ef181cfab | ||
|
|
5a3450fdf8 | ||
|
|
aae534308a | ||
|
|
cbd8f70ce4 | ||
|
|
64d495afa5 | ||
|
|
5e424b35e4 | ||
|
|
7decd40844 | ||
|
|
9c0f3ce601 | ||
|
|
e09eea2049 | ||
|
|
5d23126205 | ||
|
|
748e6dee68 | ||
|
|
27aa2f077b | ||
|
|
69098488f6 | ||
|
|
14e6e78aee | ||
|
|
a0f9f4baa4 | ||
|
|
a7f3754d25 | ||
|
|
54c8459fa1 | ||
|
|
e26118af4f | ||
|
|
764a8c58ce | ||
|
|
8f89f1c6c1 | ||
|
|
862829c57c | ||
|
|
aba96213c3 | ||
|
|
e7ab762ee4 | ||
|
|
b314982196 | ||
|
|
27060fed8d | ||
|
|
20c1c46d12 | ||
|
|
3b133ed86c | ||
|
|
0aad0c39f4 | ||
|
|
fe1033fa4b | ||
|
|
2ce635d028 | ||
|
|
ba3a6e74eb | ||
|
|
7e768022e7 | ||
|
|
a76bd4ebd3 | ||
|
|
df89d1b973 | ||
|
|
50811aad77 | ||
|
|
df3528d62a | ||
|
|
e97c570bb2 | ||
|
|
fbcb0826d2 | ||
|
|
74499fb6a0 | ||
|
|
fbbff409a0 | ||
|
|
05da118d8f | ||
|
|
033d695fd9 | ||
|
|
6953cdb81f | ||
|
|
48f700b803 | ||
|
|
e2f8696ed6 | ||
|
|
3bd4f15fe1 | ||
|
|
157471952a | ||
|
|
a555876a7e | ||
|
|
3116d34994 | ||
|
|
5c823f3353 | ||
|
|
c2f1a0db1c | ||
|
|
c0c12b9eea | ||
|
|
d2ff39b5e6 | ||
|
|
e9e6e141d2 | ||
|
|
d2c1f5c94f | ||
|
|
cd0208f3fc | ||
|
|
9d6ddfd1bd | ||
|
|
117769d1ab | ||
|
|
91a138ab9d | ||
|
|
9a27184885 | ||
|
|
40b0d2c684 | ||
|
|
6d0bc958a9 | ||
|
|
e38bee4c0f | ||
|
|
5a08b3e0bd | ||
|
|
acf4951047 | ||
|
|
9413f5dce8 | ||
|
|
913d2e9f15 | ||
|
|
bb66c9a907 | ||
|
|
5331552759 | ||
|
|
8e5034a393 | ||
|
|
14fa62c64a | ||
|
|
15d65c3f21 | ||
|
|
00bbded91c | ||
|
|
c58257538a | ||
|
|
e2a434bde0 | ||
|
|
077155f835 | ||
|
|
aec97a5df6 | ||
|
|
20768edcf6 | ||
|
|
8175cf443a | ||
|
|
075a768424 | ||
|
|
621625d831 | ||
|
|
3a63d4d307 | ||
|
|
1e47ff3f64 | ||
|
|
31bf399b51 | ||
|
|
9029508c58 | ||
|
|
22d90ae79b | ||
|
|
6420db5385 | ||
|
|
0a4ee7b7f6 | ||
|
|
5d1c1e2e19 | ||
|
|
043061fb16 | ||
|
|
076b8d296f | ||
|
|
6be368a1e8 | ||
|
|
0e2c7adaf9 | ||
|
|
f6152d92f1 | ||
|
|
ab572079ac | ||
|
|
5fe48c2587 | ||
|
|
a9d687448d | ||
|
|
930beb8642 | ||
|
|
640d300adc | ||
|
|
b643f86313 | ||
|
|
664af21ad5 | ||
|
|
63a966947b | ||
|
|
fb679924bc | ||
|
|
fb90c63d84 | ||
|
|
9e107d4a75 | ||
|
|
566b7dfd0b | ||
|
|
0363a462a0 | ||
|
|
f09844c03c | ||
|
|
2042719a3c | ||
|
|
9dc43479aa | ||
|
|
62e70554be | ||
|
|
bc29fd5428 | ||
|
|
b9620382a7 | ||
|
|
67b777c432 | ||
|
|
8cc24f4923 | ||
|
|
96e09db1dd | ||
|
|
8288039264 | ||
|
|
5d0fdd341a | ||
|
|
b0a2086b6c | ||
|
|
78ea5dc244 | ||
|
|
d3c397acf0 | ||
|
|
5823ca90f1 | ||
|
|
c36568462f | ||
|
|
e469ed8b9a | ||
|
|
967f7dac16 | ||
|
|
38d255f0ab | ||
|
|
f44074ebe7 | ||
|
|
ee0fe7eca6 | ||
|
|
c7610fe917 | ||
|
|
5fa7f918a1 | ||
|
|
a2bdb93d5e | ||
|
|
5a763d422a | ||
|
|
44fd819705 | ||
|
|
faa9b7bb62 | ||
|
|
06fb8db40a | ||
|
|
a97b503f8e | ||
|
|
c650b9626f | ||
|
|
a7fe423583 | ||
|
|
32eca75f4e | ||
|
|
f1b3e3a81f | ||
|
|
736e83a465 | ||
|
|
c2b8ab05b1 | ||
|
|
8b4a5e0847 | ||
|
|
ef18e94ff8 | ||
|
|
6d198d290d | ||
|
|
df81196035 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,3 +1,5 @@
|
|||||||
cargo_credentials.toml filter=git-crypt diff=git-crypt
|
cargo_credentials.toml filter=git-crypt diff=git-crypt
|
||||||
**/wireguard_configs/** filter=git-crypt diff=git-crypt
|
**/wireguard_configs/** filter=git-crypt diff=git-crypt
|
||||||
*.key filter=git-crypt diff=git-crypt
|
*.key filter=git-crypt diff=git-crypt
|
||||||
|
credentials filter=git-crypt diff=git-crypt
|
||||||
|
htpasswd filter=git-crypt diff=git-crypt
|
||||||
|
|||||||
@@ -15,12 +15,13 @@ pflog_conf:
|
|||||||
- name: 0
|
- name: 0
|
||||||
dev: pflog0
|
dev: pflog0
|
||||||
cputype: "amd"
|
cputype: "amd"
|
||||||
|
hwpstate: true
|
||||||
etc_hosts: {}
|
etc_hosts: {}
|
||||||
wireguard_directory: mrmanager
|
wireguard_directory: mrmanager
|
||||||
enabled_wireguard:
|
enabled_wireguard:
|
||||||
- colo
|
- colo
|
||||||
jail_zfs_dataset: zdata/jail
|
jail_zfs_dataset: zdata/jail
|
||||||
jail_zfs_dataset_mountpoint: /jail/main
|
jail_zfs_dataset_mountpoint: /jail
|
||||||
jail_canmount: "on"
|
jail_canmount: "on"
|
||||||
jail_list:
|
jail_list:
|
||||||
- name: nat_dhcp
|
- name: nat_dhcp
|
||||||
|
|||||||
@@ -1,9 +1,32 @@
|
|||||||
os_flavor: "freebsd"
|
os_flavor: "freebsd"
|
||||||
|
custom_repo: "https://freebsdpkg.fizz.buzz/repo/14broadwell-default-computer"
|
||||||
|
pkgbase_url: "https://freebsdpkg.fizz.buzz/pkgbase/14broadwell-repo/FreeBSD:14:amd64/latest"
|
||||||
zfs_snapshot_datasets:
|
zfs_snapshot_datasets:
|
||||||
- path: zroot/freebsd/computer/be
|
- path: zroot/freebsd/computer/be
|
||||||
- path: zmass/encrypted/vm
|
- path: zmass/encrypted/vm
|
||||||
|
- path: zmass/encrypted/data
|
||||||
|
users:
|
||||||
|
talexander:
|
||||||
|
initialize: true
|
||||||
|
uid: 11235
|
||||||
|
gid: 11235
|
||||||
|
groups:
|
||||||
|
- name: wheel
|
||||||
|
- name: video
|
||||||
|
- name: u2f
|
||||||
|
- name: operator # To be able to shutdown without root
|
||||||
|
- name: webcamd
|
||||||
|
gid: 145
|
||||||
|
authorized_keys:
|
||||||
|
- yubikey
|
||||||
|
- main_fido
|
||||||
|
- backup_fido
|
||||||
|
- homeassistant
|
||||||
|
gitconfig: "gitconfig_home"
|
||||||
sshd_enabled: true
|
sshd_enabled: true
|
||||||
sshd_conf: "sshd_config"
|
sshd_conf: "sshd_config"
|
||||||
|
prefer_ipv6: true
|
||||||
|
dummynet_config: "dnctl.conf"
|
||||||
pf_config: "homeserver_pf.conf"
|
pf_config: "homeserver_pf.conf"
|
||||||
pflog_conf:
|
pflog_conf:
|
||||||
- name: 0
|
- name: 0
|
||||||
@@ -11,12 +34,11 @@ pflog_conf:
|
|||||||
network_rc: "homeserver_network.conf"
|
network_rc: "homeserver_network.conf"
|
||||||
rc_conf: "homeserver_rc.conf"
|
rc_conf: "homeserver_rc.conf"
|
||||||
loader_conf: "homeserver_loader.conf"
|
loader_conf: "homeserver_loader.conf"
|
||||||
netgraph_config: "setup_netgraph_homeserver"
|
|
||||||
cputype: "intel"
|
cputype: "intel"
|
||||||
hwpstate: false
|
hwpstate: false
|
||||||
devfs_rules: "homeserver_devfs.rules"
|
devfs_rules: "homeserver_devfs.rules"
|
||||||
jail_zfs_dataset: zmass/encrypted/jails
|
jail_zfs_dataset: zmass/encrypted/jails
|
||||||
jail_zfs_dataset_mountpoint: /jail/main
|
jail_zfs_dataset_mountpoint: /jail
|
||||||
jail_canmount: "on"
|
jail_canmount: "on"
|
||||||
jail_bemount: "on"
|
jail_bemount: "on"
|
||||||
jail_list:
|
jail_list:
|
||||||
@@ -31,16 +53,41 @@ jail_list:
|
|||||||
- name: dagger
|
- name: dagger
|
||||||
conf:
|
conf:
|
||||||
src: dagger
|
src: dagger
|
||||||
- name: mumble
|
- name: olddagger
|
||||||
conf:
|
conf:
|
||||||
src: mumble
|
src: olddagger
|
||||||
persist:
|
- name: sftp
|
||||||
- name: mumbledb
|
conf:
|
||||||
mount: /var/db/murmur
|
src: sftp
|
||||||
|
fstab: sftp_fstab
|
||||||
|
- name: bastion
|
||||||
|
conf:
|
||||||
|
src: bastion
|
||||||
|
fstab: fstab_bastion
|
||||||
|
- name: certificate
|
||||||
|
conf:
|
||||||
|
src: certificate
|
||||||
|
- name: momlaptop
|
||||||
|
conf:
|
||||||
|
src: momlaptop
|
||||||
|
# - name: mumble
|
||||||
|
# conf:
|
||||||
|
# src: mumble
|
||||||
|
# persist:
|
||||||
|
# - name: mumbledb
|
||||||
|
# mount: /var/db/murmur
|
||||||
bhyve_dataset: zmass/encrypted/vm
|
bhyve_dataset: zmass/encrypted/vm
|
||||||
bhyve_list: []
|
# Disable mounting bhyve dataset so it doesn't hide the unencrypted linfi vm
|
||||||
bhyve_canmount: "on"
|
bhyve_canmount: "off"
|
||||||
|
bhyve_mountpoint: "none"
|
||||||
bhyve_bemount: "on"
|
bhyve_bemount: "on"
|
||||||
wireguard_directory: homeserver
|
wireguard_directory: homeserver
|
||||||
enabled_wireguard:
|
enabled_wireguard:
|
||||||
- wgh
|
- wgh
|
||||||
|
linfi:
|
||||||
|
enabled: true
|
||||||
|
zfs_dataset: zmass/unencrypted/vm/linfi
|
||||||
|
zfs_mountpoint: /vm/linfi
|
||||||
|
driver_blocklist: "ath if_ath if_ath_pci ath_hal if_iwm if_iwlwifi"
|
||||||
|
pci_blocklist: "6/0/0"
|
||||||
|
amd: false
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
[headless]
|
[headless]
|
||||||
homeserver ansible_user=talexander ansible_host=10.216.1.1
|
homeserver ansible_user=talexander ansible_host=homeserver
|
||||||
|
|||||||
1
ansible/environments/jail/host_vars/bastion
Normal file
1
ansible/environments/jail/host_vars/bastion
Normal file
@@ -0,0 +1 @@
|
|||||||
|
os_flavor: freebsd
|
||||||
1
ansible/environments/jail/host_vars/certificate
Normal file
1
ansible/environments/jail/host_vars/certificate
Normal file
@@ -0,0 +1 @@
|
|||||||
|
os_flavor: freebsd
|
||||||
1
ansible/environments/jail/host_vars/momlaptop
Normal file
1
ansible/environments/jail/host_vars/momlaptop
Normal file
@@ -0,0 +1 @@
|
|||||||
|
os_flavor: freebsd
|
||||||
6
ansible/environments/jail/host_vars/sftp
Normal file
6
ansible/environments/jail/host_vars/sftp
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
os_flavor: "freebsd"
|
||||||
|
users:
|
||||||
|
nochainstounlock:
|
||||||
|
initialize: true
|
||||||
|
uid: 11235
|
||||||
|
gid: 11235
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
[jail]
|
[jail]
|
||||||
nat_dhcp ansible_connection=jail
|
nat_dhcp ansible_connection=jail
|
||||||
homeserver_nat_dhcp ansible_ssh_host=nat_dhcp@172.16.16.2 ansible_connection=sshjail
|
homeserver_nat_dhcp ansible_ssh_host=nat_dhcp@homeserver ansible_connection=sshjail
|
||||||
mrmanager_nat_dhcp ansible_ssh_host=nat_dhcp@10.217.2.1 ansible_connection=sshjail
|
mrmanager_nat_dhcp ansible_ssh_host=nat_dhcp@10.217.2.1 ansible_connection=sshjail
|
||||||
nat_dhcp@172.16.16.2 ansible_connection=sshjail
|
nat_dhcp@172.16.16.2 ansible_connection=sshjail
|
||||||
admin_git ansible_ssh_host=admin_git@10.217.2.1 ansible_connection=sshjail
|
admin_git ansible_ssh_host=admin_git@10.217.2.1 ansible_connection=sshjail
|
||||||
public_dns ansible_ssh_host=public_dns@10.217.2.1 ansible_connection=sshjail
|
public_dns ansible_ssh_host=public_dns@10.217.2.1 ansible_connection=sshjail
|
||||||
|
sftp ansible_ssh_host=sftp@homeserver ansible_connection=sshjail
|
||||||
|
bastion ansible_ssh_host=bastion@homeserver ansible_connection=sshjail
|
||||||
|
certificate ansible_ssh_host=certificate@homeserver ansible_connection=sshjail
|
||||||
|
momlaptop ansible_ssh_host=momlaptop@homeserver ansible_connection=sshjail
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
os_flavor: "freebsd"
|
os_flavor: "freebsd"
|
||||||
custom_repo: current-default-framework
|
custom_repo: "https://freebsdpkg.fizz.buzz/repo/currentznver4-default-framework"
|
||||||
|
pkgbase_url: "https://freebsdpkg.fizz.buzz/pkgbase/currentznver4-repo/FreeBSD:15:amd64/latest"
|
||||||
zfs_snapshot_datasets:
|
zfs_snapshot_datasets:
|
||||||
- path: zroot/freebsd/current/be/default
|
- path: zroot/freebsd/current/be/default
|
||||||
sshd_enabled: true
|
sshd_enabled: true
|
||||||
sshd_conf: "sshd_config"
|
sshd_conf: "sshd_config"
|
||||||
#pf_config: "odofreebsd_pf.conf"
|
pf_config: "odofreebsd_pf.conf"
|
||||||
#pflog_conf:
|
pflog_conf:
|
||||||
# - name: 0
|
- name: 0
|
||||||
# dev: pflog0
|
dev: pflog0
|
||||||
|
prefer_ipv6: true
|
||||||
|
dummynet_config: "dnctl.conf"
|
||||||
network_rc: "odofreebsd_network.conf"
|
network_rc: "odofreebsd_network.conf"
|
||||||
rc_conf: "odofreebsd_rc.conf"
|
rc_conf: "odofreebsd_rc.conf"
|
||||||
loader_conf: "odofreebsd_loader.conf"
|
loader_conf: "odofreebsd_loader.conf"
|
||||||
@@ -16,6 +19,7 @@ graphics_driver: "amd"
|
|||||||
cputype: "amd"
|
cputype: "amd"
|
||||||
hwpstate: true
|
hwpstate: true
|
||||||
cores: 16
|
cores: 16
|
||||||
|
sound_system: "oss"
|
||||||
users:
|
users:
|
||||||
talexander:
|
talexander:
|
||||||
initialize: true
|
initialize: true
|
||||||
@@ -28,6 +32,7 @@ users:
|
|||||||
- name: operator # To be able to shutdown without root
|
- name: operator # To be able to shutdown without root
|
||||||
- name: webcamd
|
- name: webcamd
|
||||||
gid: 145
|
gid: 145
|
||||||
|
- name: realtime
|
||||||
authorized_keys:
|
authorized_keys:
|
||||||
- yubikey
|
- yubikey
|
||||||
- main_fido
|
- main_fido
|
||||||
@@ -36,15 +41,17 @@ users:
|
|||||||
gitconfig: "gitconfig_home"
|
gitconfig: "gitconfig_home"
|
||||||
devfs_rules: "odo_devfs.rules"
|
devfs_rules: "odo_devfs.rules"
|
||||||
jail_zfs_dataset: zroot/freebsd/current/jails
|
jail_zfs_dataset: zroot/freebsd/current/jails
|
||||||
jail_zfs_dataset_mountpoint: /jail/main
|
jail_zfs_dataset_mountpoint: /jail
|
||||||
|
jail_canmount: "on"
|
||||||
jail_list:
|
jail_list:
|
||||||
- name: nat_dhcp
|
- name: nat_dhcp
|
||||||
enabled: true
|
enabled: true
|
||||||
conf:
|
conf:
|
||||||
src: nat_dhcp
|
src: nat_dhcp
|
||||||
bhyve_dataset: zroot/freebsd/current/vm
|
bhyve_dataset: zroot/freebsd/current/vm
|
||||||
bhyve_list: []
|
bhyve_bemount: off
|
||||||
efi_dev: /dev/gpt/EFI
|
# efi_dev: /dev/gpt/EFI
|
||||||
|
efi_dev: /dev/diskid/DISK-SJB7N717610407Q0Hp1
|
||||||
sway_conf_files:
|
sway_conf_files:
|
||||||
- launch_gpg
|
- launch_gpg
|
||||||
wireguard_directory: odo
|
wireguard_directory: odo
|
||||||
@@ -52,3 +59,10 @@ enabled_wireguard:
|
|||||||
- wgh
|
- wgh
|
||||||
- drmario
|
- drmario
|
||||||
- colo
|
- colo
|
||||||
|
linfi:
|
||||||
|
enabled: true
|
||||||
|
zfs_dataset: zroot/freebsd/current/vm/linfi
|
||||||
|
zfs_mountpoint: /vm/linfi
|
||||||
|
driver_blocklist: "if_iwm if_iwlwifi"
|
||||||
|
pci_blocklist: "1/0/0"
|
||||||
|
amd: true
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ users:
|
|||||||
- backup_fido
|
- backup_fido
|
||||||
- homeassistant
|
- homeassistant
|
||||||
gitconfig: "gitconfig_home"
|
gitconfig: "gitconfig_home"
|
||||||
|
periodic_scrub_pools: [zroot]
|
||||||
zfs_snapshot_datasets:
|
zfs_snapshot_datasets:
|
||||||
# - zroot/linux/archmain/home
|
# - zroot/linux/archmain/home
|
||||||
- path: zroot/linux/archmain/be
|
- path: zroot/linux/archmain/be
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ users:
|
|||||||
- main_fido
|
- main_fido
|
||||||
- backup_fido
|
- backup_fido
|
||||||
gitconfig: "gitconfig_work"
|
gitconfig: "gitconfig_work"
|
||||||
|
periodic_scrub_pools: [zroot]
|
||||||
zfs_snapshot_datasets:
|
zfs_snapshot_datasets:
|
||||||
- path: zroot/linux/archwork/be
|
- path: zroot/linux/archwork/be
|
||||||
install_graphics: true
|
install_graphics: true
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
os_flavor: "freebsd"
|
os_flavor: "freebsd"
|
||||||
|
sshd_enabled: true
|
||||||
|
custom_repo: "file:///usr/local/poudriere/data/packages/currentznver4-default-framework"
|
||||||
pkgbase_url: "file:///usr/local/poudriere/data/images/currentznver4-repo/FreeBSD:15:amd64/latest"
|
pkgbase_url: "file:///usr/local/poudriere/data/images/currentznver4-repo/FreeBSD:15:amd64/latest"
|
||||||
poudriere_builds:
|
poudriere_builds:
|
||||||
# - jail: 13amd64
|
# - jail: 13amd64
|
||||||
@@ -10,6 +12,19 @@ poudriere_builds:
|
|||||||
set: framework
|
set: framework
|
||||||
version: CURRENT
|
version: CURRENT
|
||||||
# revision: 66d37dbedfbf2dc94ccf49e6983c3652d5909b91
|
# revision: 66d37dbedfbf2dc94ccf49e6983c3652d5909b91
|
||||||
kernel: GENERIC-NODEBUG
|
kernel: CUSTOM
|
||||||
branch: main
|
branch: main
|
||||||
srcconf: currentznver4_src.conf
|
srcconf: currentznver4_src.conf
|
||||||
|
# - jail: 14broadwell
|
||||||
|
# ports: default
|
||||||
|
# set: computer
|
||||||
|
# version: 14.0-RELEASE
|
||||||
|
# kernel: GENERIC
|
||||||
|
# srcconf: 14broadwell_src.conf
|
||||||
|
- jail: 14broadwell
|
||||||
|
ports: default
|
||||||
|
set: computer
|
||||||
|
version: CURRENT
|
||||||
|
kernel: CUSTOM
|
||||||
|
branch: releng/14.1
|
||||||
|
srcconf: 14broadwell_src.conf
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
- sway
|
- sway
|
||||||
- emacs
|
- emacs
|
||||||
- firefox
|
- firefox
|
||||||
|
- chromium
|
||||||
- devfs
|
- devfs
|
||||||
- ssh_client
|
- ssh_client
|
||||||
- sshfs
|
- sshfs
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
- lvfs
|
- lvfs
|
||||||
- restaurant_health_rating
|
- restaurant_health_rating
|
||||||
- wasm
|
- wasm
|
||||||
|
- noise_suppression
|
||||||
|
|
||||||
- hosts: nat_dhcp:homeserver_nat_dhcp:mrmanager_nat_dhcp
|
- hosts: nat_dhcp:homeserver_nat_dhcp:mrmanager_nat_dhcp
|
||||||
vars:
|
vars:
|
||||||
@@ -66,8 +68,12 @@
|
|||||||
ansible_become: True
|
ansible_become: True
|
||||||
roles:
|
roles:
|
||||||
- sudo # for poudboot script
|
- sudo # for poudboot script
|
||||||
|
- doas
|
||||||
- fstab
|
- fstab
|
||||||
- package_manager
|
- package_manager
|
||||||
|
- zsh
|
||||||
|
- termcap
|
||||||
|
- sshd
|
||||||
- portshaker
|
- portshaker
|
||||||
- poudriere
|
- poudriere
|
||||||
- poudrierenginx
|
- poudrierenginx
|
||||||
@@ -120,12 +126,14 @@
|
|||||||
vars:
|
vars:
|
||||||
ansible_become: True
|
ansible_become: True
|
||||||
roles:
|
roles:
|
||||||
|
- linfi
|
||||||
- framework_laptop
|
- framework_laptop
|
||||||
|
|
||||||
- hosts: homeserver
|
- hosts: homeserver
|
||||||
vars:
|
vars:
|
||||||
ansible_become: True
|
ansible_become: True
|
||||||
roles:
|
roles:
|
||||||
|
- linfi
|
||||||
- homeserver
|
- homeserver
|
||||||
|
|
||||||
- hosts: odowork
|
- hosts: odowork
|
||||||
@@ -133,3 +141,28 @@
|
|||||||
ansible_become: True
|
ansible_become: True
|
||||||
roles:
|
roles:
|
||||||
- odowork
|
- odowork
|
||||||
|
|
||||||
|
- hosts: sftp
|
||||||
|
vars:
|
||||||
|
ansible_become: True
|
||||||
|
roles:
|
||||||
|
- users
|
||||||
|
- sftp
|
||||||
|
|
||||||
|
- hosts: bastion
|
||||||
|
vars:
|
||||||
|
ansible_become: True
|
||||||
|
roles:
|
||||||
|
- jail_bastion
|
||||||
|
|
||||||
|
- hosts: certificate
|
||||||
|
vars:
|
||||||
|
ansible_become: True
|
||||||
|
roles:
|
||||||
|
- jail_certificate
|
||||||
|
|
||||||
|
- hosts: momlaptop
|
||||||
|
vars:
|
||||||
|
ansible_become: True
|
||||||
|
roles:
|
||||||
|
- jail_momlaptop
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
- name: Install packages
|
- name: Install packages
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- py39-ansible
|
- py311-ansible
|
||||||
- ansible-sshjail
|
- ansible-sshjail
|
||||||
state: present
|
state: present
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
# Reconstructed via infocmp from file: /usr/share/terminfo/a/alacritty
|
|
||||||
# (untranslatable capabilities removed to fit entry within 1023 bytes)
|
|
||||||
# (sgr removed to fit entry within 1023 bytes)
|
|
||||||
# (acsc removed to fit entry within 1023 bytes)
|
|
||||||
# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
|
|
||||||
alacritty|alacritty terminal emulator:\
|
|
||||||
:am:bs:hs:mi:ms:xn:\
|
|
||||||
:co#80:it#8:li#24:\
|
|
||||||
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
|
|
||||||
:K2=\EOE:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:\
|
|
||||||
:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:\
|
|
||||||
:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=\r:\
|
|
||||||
:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=\n:\
|
|
||||||
:ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
|
|
||||||
:is=\E[!p\E[?3;4l\E[4l\E>:k1=\EOP:k2=\EOQ:k3=\EOR:\
|
|
||||||
:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
|
|
||||||
:k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\
|
|
||||||
:kd=\EOB:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:kr=\EOC:\
|
|
||||||
:ks=\E[?1h\E=:ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:\
|
|
||||||
:mh=\E[2m:mm=\E[?1034h:mo=\E[?1034l:mr=\E[7m:nd=\E[C:\
|
|
||||||
:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
|
|
||||||
:te=\E[?1049l\E[23;0;0t:ti=\E[?1049h\E[22;0;0t:\
|
|
||||||
:ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\
|
|
||||||
:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h:
|
|
||||||
1
ansible/roles/base/files/bbr_loader.conf
Normal file
1
ansible/roles/base/files/bbr_loader.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
tcp_bbr_load="YES"
|
||||||
1
ansible/roles/base/files/cleartmp_rc.conf
Normal file
1
ansible/roles/base/files/cleartmp_rc.conf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
clear_tmp_enable="YES"
|
||||||
8
ansible/roles/base/files/decode_jwt.bash
Normal file
8
ansible/roles/base/files/decode_jwt.bash
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Decode the contents of a JWT
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
exec jq -R 'split(".") | .[0],.[1] | gsub("-"; "+") | gsub("_"; "/") | gsub("%3D"; "=")| @base64d | fromjson'
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
# Disabling both of these will make /dev/gpt/* populated
|
# Populates the /dev/diskid
|
||||||
|
kern.geom.label.disk_ident.enable="1"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Populates /dev/gpt but only if kern.geom.label.disk_ident.enable is disabled.
|
||||||
#
|
#
|
||||||
# This uses gpt partition labels which you can set with:
|
# This uses gpt partition labels which you can set with:
|
||||||
#
|
#
|
||||||
# gpart modify -l EFI -i 1 nvd0
|
# gpart modify -l EFI -i 1 nvd0
|
||||||
|
|
||||||
# kern.geom.label.disk_ident.enable="0"
|
|
||||||
# kern.geom.label.gptid.enable="1"
|
# kern.geom.label.gptid.enable="1"
|
||||||
|
|||||||
@@ -33,5 +33,5 @@
|
|||||||
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
|
cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED"
|
||||||
# Make the middle pane start without any merge progress:
|
# Make the middle pane start without any merge progress:
|
||||||
# cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
|
# cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"
|
||||||
[includeIf "gitdir:/bridge/git/machine_setup/"]
|
[includeIf "gitdir:/bridge/"]
|
||||||
path = /bridge/git/machine_setup/ansible/roles/base/files/gitconfig_home
|
path = /bridge/git/machine_setup/ansible/roles/base/files/gitconfig_home
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
.idea
|
.idea
|
||||||
.python-version
|
.python-version
|
||||||
|
|
||||||
|
# Emacs per-directory settings
|
||||||
.dir-locals.el
|
.dir-locals.el
|
||||||
|
|
||||||
|
# C/C++ Language Server compile commands
|
||||||
|
compile_commands.json
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
security.bsd.allow_destructive_dtrace=0
|
security.bsd.allow_destructive_dtrace=0
|
||||||
kern.geom.label.disk_ident.enable="0"
|
|
||||||
kern.geom.label.gptid.enable="0"
|
|
||||||
cryptodev_load="YES"
|
cryptodev_load="YES"
|
||||||
zfs_load="YES"
|
zfs_load="YES"
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ default:\
|
|||||||
:cputime=unlimited:\
|
:cputime=unlimited:\
|
||||||
:datasize=unlimited:\
|
:datasize=unlimited:\
|
||||||
:stacksize=unlimited:\
|
:stacksize=unlimited:\
|
||||||
:memorylocked=64K:\
|
:memorylocked=128M:\
|
||||||
:memoryuse=unlimited:\
|
:memoryuse=unlimited:\
|
||||||
:filesize=unlimited:\
|
:filesize=unlimited:\
|
||||||
:coredumpsize=unlimited:\
|
:coredumpsize=unlimited:\
|
||||||
@@ -44,6 +44,7 @@ default:\
|
|||||||
:pseudoterminals=unlimited:\
|
:pseudoterminals=unlimited:\
|
||||||
:kqueues=unlimited:\
|
:kqueues=unlimited:\
|
||||||
:umtxp=unlimited:\
|
:umtxp=unlimited:\
|
||||||
|
:pipebuf=unlimited:\
|
||||||
:priority=0:\
|
:priority=0:\
|
||||||
:ignoretime@:\
|
:ignoretime@:\
|
||||||
:umask=022:\
|
:umask=022:\
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
security.bsd.allow_destructive_dtrace=0
|
security.bsd.allow_destructive_dtrace=0
|
||||||
kern.geom.label.disk_ident.enable="0"
|
|
||||||
kern.geom.label.gptid.enable="0"
|
|
||||||
cryptodev_load="YES"
|
cryptodev_load="YES"
|
||||||
zfs_load="YES"
|
zfs_load="YES"
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,6 @@
|
|||||||
clear_tmp_enable="YES"
|
|
||||||
syslogd_flags="-ss"
|
syslogd_flags="-ss"
|
||||||
sendmail_enable="NONE"
|
sendmail_enable="NONE"
|
||||||
hostname="odo"
|
hostname="odo"
|
||||||
wlans_iwlwifi0="wlan0"
|
|
||||||
ifconfig_wlan0="WPA DHCP"
|
|
||||||
ifconfig_wlan0_ipv6="inet6 accept_rtadv"
|
|
||||||
sshd_enable="YES"
|
|
||||||
ntpd_enable="YES"
|
|
||||||
powerd_enable="YES"
|
|
||||||
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
|
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
|
||||||
dumpdev="NO"
|
dumpdev="NO"
|
||||||
zfs_enable="YES"
|
zfs_enable="YES"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
set-option -g mouse on
|
# set-option -g mouse on
|
||||||
set-option -g history-limit 20000
|
set-option -g history-limit 20000
|
||||||
# set -g @plugin 'tmux-plugins/tmux-yank'
|
# set -g @plugin 'tmux-plugins/tmux-yank'
|
||||||
# Emacs style
|
# Emacs style
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
function cleanup {
|
function cleanup {
|
||||||
switch_to_main_screen
|
switch_to_main_screen
|
||||||
}
|
}
|
||||||
for sig in EXIT INT QUIT HUP TERM; do
|
for sig in EXIT; do
|
||||||
trap "set +e; cleanup; exit" "$sig"
|
trap "set +e; cleanup; exit" "$sig"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- fstab
|
- fstab
|
||||||
|
- termcap
|
||||||
|
|||||||
@@ -16,21 +16,19 @@
|
|||||||
- wget
|
- wget
|
||||||
- colordiff
|
- colordiff
|
||||||
- ipcalc
|
- ipcalc
|
||||||
- kdiff3
|
|
||||||
- meld
|
|
||||||
- tcpdump
|
- tcpdump
|
||||||
- moreutils # for ts [%Y-%m-%d %H:%M:%.S]
|
- moreutils # for ts [%Y-%m-%d %H:%M:%.S]
|
||||||
- ddrescue
|
- ddrescue
|
||||||
|
- dmidecode
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Set timezone
|
- name: Install packages
|
||||||
file:
|
when: install_graphics
|
||||||
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}"
|
package:
|
||||||
dest: /etc/localtime
|
name:
|
||||||
owner: root
|
- kdiff3
|
||||||
# TODO: Arch Linux is changing the group to root instead of wheel. Maybe make this a variable?
|
- meld
|
||||||
group: wheel
|
state: present
|
||||||
state: link
|
|
||||||
|
|
||||||
- name: Install scripts
|
- name: Install scripts
|
||||||
copy:
|
copy:
|
||||||
@@ -50,6 +48,8 @@
|
|||||||
dest: /usr/local/bin/cleanup_temporary_files
|
dest: /usr/local/bin/cleanup_temporary_files
|
||||||
- src: git_fix_author.bash
|
- src: git_fix_author.bash
|
||||||
dest: /usr/local/bin/git_fix_author
|
dest: /usr/local/bin/git_fix_author
|
||||||
|
- src: decode_jwt.bash
|
||||||
|
dest: /usr/local/bin/decode_jwt
|
||||||
|
|
||||||
- import_tasks: tasks/freebsd.yaml
|
- import_tasks: tasks/freebsd.yaml
|
||||||
when: 'os_flavor == "freebsd"'
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
- name: Set timezone
|
||||||
|
file:
|
||||||
|
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}"
|
||||||
|
dest: /etc/localtime
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
state: link
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
@@ -5,29 +13,18 @@
|
|||||||
- gsed
|
- gsed
|
||||||
- gmake
|
- gmake
|
||||||
- rust-coreutils
|
- rust-coreutils
|
||||||
|
- shuf
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: See if the alacritty termcap has been added
|
- name: Install service configuration
|
||||||
lineinfile:
|
copy:
|
||||||
name: /usr/share/misc/termcap
|
src: "files/{{ item }}_rc.conf"
|
||||||
regexp: |-
|
dest: "/etc/rc.conf.d/{{ item }}"
|
||||||
^alacritty\|
|
mode: 0644
|
||||||
state: absent
|
owner: root
|
||||||
check_mode: yes
|
group: wheel
|
||||||
changed_when: false
|
loop:
|
||||||
register: alacritty_cap
|
- cleartmp
|
||||||
|
|
||||||
- name: Append alacritty termcap info
|
|
||||||
blockinfile:
|
|
||||||
path: /usr/share/misc/termcap
|
|
||||||
block: "{{ lookup('file', 'alacritty.termcap') }}"
|
|
||||||
marker: "# {mark} ANSIBLE MANAGED BLOCK alacritty"
|
|
||||||
when: not alacritty_cap.found
|
|
||||||
register: wrote_alacritty_cap
|
|
||||||
|
|
||||||
- name: Update cap_mkdb
|
|
||||||
command: cap_mkdb /usr/share/misc/termcap
|
|
||||||
when: wrote_alacritty_cap.changed
|
|
||||||
|
|
||||||
- name: Install login.conf
|
- name: Install login.conf
|
||||||
copy:
|
copy:
|
||||||
@@ -42,18 +39,6 @@
|
|||||||
command: cap_mkdb /etc/login.conf
|
command: cap_mkdb /etc/login.conf
|
||||||
when: login_config.changed
|
when: login_config.changed
|
||||||
|
|
||||||
- name: Enable periodic scrub
|
|
||||||
community.general.sysrc:
|
|
||||||
name: daily_scrub_zfs_enable
|
|
||||||
value: "YES"
|
|
||||||
path: /etc/periodic.conf.local
|
|
||||||
|
|
||||||
- name: Set scrub interval
|
|
||||||
community.general.sysrc:
|
|
||||||
name: daily_scrub_zfs_default_threshold
|
|
||||||
value: "7"
|
|
||||||
path: /etc/periodic.conf.local
|
|
||||||
|
|
||||||
- name: Install loader.conf
|
- name: Install loader.conf
|
||||||
copy:
|
copy:
|
||||||
src: "{{loader_conf}}"
|
src: "{{loader_conf}}"
|
||||||
@@ -123,3 +108,65 @@
|
|||||||
group: wheel
|
group: wheel
|
||||||
loop:
|
loop:
|
||||||
- disk_labels
|
- disk_labels
|
||||||
|
|
||||||
|
- name: Configure sysctls
|
||||||
|
sysctl:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
|
state: present
|
||||||
|
reload: false
|
||||||
|
sysctl_file: "/etc/sysctl.conf.local"
|
||||||
|
loop:
|
||||||
|
# Adjust ttl
|
||||||
|
- name: net.inet.ip.ttl
|
||||||
|
value: 65
|
||||||
|
- name: net.inet6.ip6.hlim
|
||||||
|
value: 65
|
||||||
|
|
||||||
|
- name: Log periodic output instead of getting it as mail
|
||||||
|
blockinfile:
|
||||||
|
path: "/etc/periodic.conf.local"
|
||||||
|
marker: "# {mark} ANSIBLE MANAGED BLOCK log"
|
||||||
|
# create: true
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
block: |
|
||||||
|
daily_output=/var/log/daily.log
|
||||||
|
weekly_output=/var/log/weekly.log
|
||||||
|
monthly_output=/var/log/monthly.log
|
||||||
|
|
||||||
|
- name: Enable periodic zfs scrub
|
||||||
|
when: install_zfs
|
||||||
|
blockinfile:
|
||||||
|
path: "/etc/periodic.conf.local"
|
||||||
|
marker: "# {mark} ANSIBLE MANAGED BLOCK zfs"
|
||||||
|
# create: true
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
block: |
|
||||||
|
daily_scrub_zfs_enable="YES"
|
||||||
|
daily_scrub_zfs_default_threshold="7"
|
||||||
|
|
||||||
|
# Switch to bbr tcp congestion control which should be better on lossy connections like bad wifi.
|
||||||
|
- name: Install loader.conf
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item }}_loader.conf"
|
||||||
|
dest: "/boot/loader.conf.d/{{ item }}.conf"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- bbr
|
||||||
|
|
||||||
|
- name: Configure sysctls
|
||||||
|
sysctl:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
|
state: present
|
||||||
|
reload: false
|
||||||
|
sysctl_file: "/etc/sysctl.conf.local"
|
||||||
|
loop:
|
||||||
|
- name: net.inet.tcp.functions_default
|
||||||
|
value: "bbr"
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
- name: Set timezone
|
||||||
|
file:
|
||||||
|
src: "/usr/share/zoneinfo/{{ timezone|default('UTC') }}"
|
||||||
|
dest: /etc/localtime
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
state: link
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
@@ -9,6 +17,7 @@
|
|||||||
- uutils-coreutils
|
- uutils-coreutils
|
||||||
- usbutils # for lsusb
|
- usbutils # for lsusb
|
||||||
- bolt
|
- bolt
|
||||||
|
- whois
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Start pkgfile update service
|
- name: Start pkgfile update service
|
||||||
@@ -18,17 +27,6 @@
|
|||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
||||||
# Of questionable value since I don't use swap on my machines
|
|
||||||
- name: Configure sysctls for swap
|
|
||||||
sysctl:
|
|
||||||
name: "{{ item.name }}"
|
|
||||||
value: "{{ item.value }}"
|
|
||||||
state: present
|
|
||||||
sysctl_file: /etc/sysctl.d/swap.conf
|
|
||||||
loop:
|
|
||||||
- name: vm.swappiness
|
|
||||||
value: 10
|
|
||||||
|
|
||||||
- name: Install scripts
|
- name: Install scripts
|
||||||
copy:
|
copy:
|
||||||
src: "files/{{ item.src }}"
|
src: "files/{{ item.src }}"
|
||||||
@@ -41,3 +39,41 @@
|
|||||||
dest: /usr/local/bin/mount_disk_image
|
dest: /usr/local/bin/mount_disk_image
|
||||||
- src: watch_linux
|
- src: watch_linux
|
||||||
dest: /usr/local/bin/ww
|
dest: /usr/local/bin/ww
|
||||||
|
|
||||||
|
- name: Configure sysctls
|
||||||
|
sysctl:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
value: "{{ item.value }}"
|
||||||
|
state: present
|
||||||
|
sysctl_file: /etc/sysctl.d/{{ item.file }}
|
||||||
|
loop:
|
||||||
|
# Of questionable value since I don't use swap on my machines
|
||||||
|
- name: vm.swappiness
|
||||||
|
value: 10
|
||||||
|
file: swap.conf
|
||||||
|
# Enable TCP packetization-layer PMTUD when an ICMP black hole is detected.
|
||||||
|
- name: net.ipv4.tcp_mtu_probing
|
||||||
|
value: 1
|
||||||
|
file: tcp.conf
|
||||||
|
# Switch to bbr tcp congestion control which should be better on lossy connections like bad wifi.
|
||||||
|
- name: net.ipv4.tcp_congestion_control
|
||||||
|
value: bbr
|
||||||
|
file: tcp.conf
|
||||||
|
# Don't do a slow start after a connection has been idle for a single RTO.
|
||||||
|
- name: net.ipv4.tcp_slow_start_after_idle
|
||||||
|
value: 0
|
||||||
|
file: tcp.conf
|
||||||
|
# 3x time to accumulate filesystem changes before flushing to disk.
|
||||||
|
- name: vm.dirty_writeback_centisecs
|
||||||
|
value: 1500
|
||||||
|
file: power.conf
|
||||||
|
# Adjust ttl
|
||||||
|
- name: net.ipv4.ip_default_ttl
|
||||||
|
value: 65
|
||||||
|
file: ttl.conf
|
||||||
|
- name: net.ipv6.conf.all.hop_limit
|
||||||
|
value: 65
|
||||||
|
file: ttl.conf
|
||||||
|
- name: net.ipv6.conf.default.hop_limit
|
||||||
|
value: 65
|
||||||
|
file: ttl.conf
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
bhyve_mountpoint: "/vm"
|
bhyve_mountpoint: "/vm"
|
||||||
bhyve_list: []
|
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
: ${BRIDGE_NAME:="bridge_$INTERFACE_NAME"} # or bridge_raw for RAW networks
|
: ${BRIDGE_NAME:="bridge_$INTERFACE_NAME"} # or bridge_raw for RAW networks
|
||||||
: ${VNC_ENABLE:="NO"}
|
: ${VNC_ENABLE:="NO"}
|
||||||
: ${VNC_LISTEN:="127.0.0.1:5900"}
|
: ${VNC_LISTEN:="127.0.0.1:5900"}
|
||||||
|
: ${VNC_WIDTH:="1920"}
|
||||||
|
: ${VNC_HEIGHT:="1080"}
|
||||||
|
|
||||||
if [ "$VERBOSE" = "YES" ]; then
|
if [ "$VERBOSE" = "YES" ]; then
|
||||||
set -x
|
set -x
|
||||||
@@ -45,7 +47,7 @@ function cleanup {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
vms=()
|
vms=()
|
||||||
for sig in EXIT INT QUIT HUP TERM; do
|
for sig in EXIT; do
|
||||||
trap "set +e; sleep 10; cleanup" "$sig"
|
trap "set +e; sleep 10; cleanup" "$sig"
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -105,7 +107,8 @@ function start_vm {
|
|||||||
local bridge_name="$BRIDGE_NAME"
|
local bridge_name="$BRIDGE_NAME"
|
||||||
local ip_range="$IP_RANGE" # for raw this value does not matter
|
local ip_range="$IP_RANGE" # for raw this value does not matter
|
||||||
|
|
||||||
local mac_address=$(calculate_mac_address "$name")
|
local mac_address
|
||||||
|
mac_address=$(calculate_mac_address "$name")
|
||||||
|
|
||||||
local additional_args=()
|
local additional_args=()
|
||||||
|
|
||||||
@@ -140,7 +143,7 @@ function start_vm {
|
|||||||
additional_args+=("-s" "5,ahci-cd,$mount_cd")
|
additional_args+=("-s" "5,ahci-cd,$mount_cd")
|
||||||
fi
|
fi
|
||||||
if [ "$VNC_ENABLE" = "YES" ]; then
|
if [ "$VNC_ENABLE" = "YES" ]; then
|
||||||
additional_args+=("-s" "29,fbuf,tcp=$VNC_LISTEN,w=1920,h=1080")
|
additional_args+=("-s" "29,fbuf,tcp=$VNC_LISTEN,w=$VNC_WIDTH,h=$VNC_HEIGHT")
|
||||||
fi
|
fi
|
||||||
vms+=("$name")
|
vms+=("$name")
|
||||||
while true; do
|
while true; do
|
||||||
@@ -151,6 +154,8 @@ function start_vm {
|
|||||||
-c $CPU_CORES \
|
-c $CPU_CORES \
|
||||||
-m $MEMORY \
|
-m $MEMORY \
|
||||||
-H \
|
-H \
|
||||||
|
-P \
|
||||||
|
-o 'rtc.use_localtime=false' \
|
||||||
-s 0,hostbridge \
|
-s 0,hostbridge \
|
||||||
-s "4,nvme,/dev/zvol/${zfs_path}/disk0" \
|
-s "4,nvme,/dev/zvol/${zfs_path}/disk0" \
|
||||||
-s 30,xhci,tablet \
|
-s 30,xhci,tablet \
|
||||||
@@ -245,7 +250,8 @@ function ng_exists {
|
|||||||
|
|
||||||
function calculate_mac_address {
|
function calculate_mac_address {
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local source=$(md5 -r -s "$name" | awk '{print $1}')
|
local source
|
||||||
|
source=$(md5 -r -s "$name" | awk '{print $1}')
|
||||||
echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}"
|
echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
ansible/roles/chromium/files/chromium-flags.conf
Normal file
2
ansible/roles/chromium/files/chromium-flags.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
--ozone-platform-hint=auto
|
||||||
|
--enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE
|
||||||
2
ansible/roles/chromium/meta/main.yaml
Normal file
2
ansible/roles/chromium/meta/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- users
|
||||||
55
ansible/roles/chromium/tasks/common.yaml
Normal file
55
ansible/roles/chromium/tasks/common.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# - name: Create directories
|
||||||
|
# file:
|
||||||
|
# name: "{{ item }}"
|
||||||
|
# state: directory
|
||||||
|
# mode: 0755
|
||||||
|
# owner: root
|
||||||
|
# group: wheel
|
||||||
|
# loop:
|
||||||
|
# - /foo/bar
|
||||||
|
|
||||||
|
# - name: Install scripts
|
||||||
|
# copy:
|
||||||
|
# src: "files/{{ item.src }}"
|
||||||
|
# dest: "{{ item.dest }}"
|
||||||
|
# mode: 0755
|
||||||
|
# owner: root
|
||||||
|
# group: wheel
|
||||||
|
# loop:
|
||||||
|
# - src: foo.bash
|
||||||
|
# dest: /usr/local/bin/foo
|
||||||
|
|
||||||
|
# - name: Install Configuration
|
||||||
|
# copy:
|
||||||
|
# src: "files/{{ item.src }}"
|
||||||
|
# dest: "{{ item.dest }}"
|
||||||
|
# mode: 0600
|
||||||
|
# owner: root
|
||||||
|
# group: wheel
|
||||||
|
# loop:
|
||||||
|
# - src: foo.conf
|
||||||
|
# dest: /usr/local/etc/foo.conf
|
||||||
|
|
||||||
|
# - name: Clone Source
|
||||||
|
# git:
|
||||||
|
# repo: "https://foo.bar/baz.git"
|
||||||
|
# dest: /foo/bar
|
||||||
|
# version: "v1.0.2"
|
||||||
|
# force: true
|
||||||
|
# diff: false
|
||||||
|
|
||||||
|
- import_tasks: tasks/freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
||||||
|
|
||||||
|
- include_tasks:
|
||||||
|
file: tasks/peruser.yaml
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
|
become_user: "{{ initialize_user }}"
|
||||||
|
when: users is defined
|
||||||
|
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: initialize_user
|
||||||
5
ansible/roles/chromium/tasks/freebsd.yaml
Normal file
5
ansible/roles/chromium/tasks/freebsd.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# - name: Install packages
|
||||||
|
# package:
|
||||||
|
# name:
|
||||||
|
# - foo
|
||||||
|
# state: present
|
||||||
7
ansible/roles/chromium/tasks/linux.yaml
Normal file
7
ansible/roles/chromium/tasks/linux.yaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Check chrome://gpu/ to confirm hardware video decoding and vulkan rendering is working.
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- chromium
|
||||||
|
state: present
|
||||||
2
ansible/roles/chromium/tasks/main.yaml
Normal file
2
ansible/roles/chromium/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
- import_tasks: tasks/common.yaml
|
||||||
|
when: install_graphics
|
||||||
29
ansible/roles/chromium/tasks/peruser.yaml
Normal file
29
ansible/roles/chromium/tasks/peruser.yaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
- include_role:
|
||||||
|
name: per_user
|
||||||
|
|
||||||
|
# - name: Create directories
|
||||||
|
# file:
|
||||||
|
# name: "{{ account_homedir.stdout }}/{{ item }}"
|
||||||
|
# state: directory
|
||||||
|
# mode: 0700
|
||||||
|
# owner: "{{ account_name.stdout }}"
|
||||||
|
# group: "{{ group_name.stdout }}"
|
||||||
|
# loop:
|
||||||
|
# - ".config/foo"
|
||||||
|
|
||||||
|
# - name: Copy files
|
||||||
|
# copy:
|
||||||
|
# src: "files/{{ item.src }}"
|
||||||
|
# dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
|
||||||
|
# mode: 0600
|
||||||
|
# owner: "{{ account_name.stdout }}"
|
||||||
|
# group: "{{ group_name.stdout }}"
|
||||||
|
# loop:
|
||||||
|
# - src: foo.conf
|
||||||
|
# dest: .config/foo/foo.conf
|
||||||
|
|
||||||
|
- import_tasks: tasks/peruser_freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/peruser_linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
||||||
0
ansible/roles/chromium/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/chromium/tasks/peruser_freebsd.yaml
Normal file
10
ansible/roles/chromium/tasks/peruser_linux.yaml
Normal file
10
ansible/roles/chromium/tasks/peruser_linux.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
- name: Copy files
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
|
||||||
|
mode: 0600
|
||||||
|
owner: "{{ account_name.stdout }}"
|
||||||
|
group: "{{ group_name.stdout }}"
|
||||||
|
loop:
|
||||||
|
- src: chromium-flags.conf
|
||||||
|
dest: .config/chromium-flags.conf
|
||||||
@@ -27,3 +27,14 @@
|
|||||||
group: wheel
|
group: wheel
|
||||||
loop:
|
loop:
|
||||||
- aesni
|
- aesni
|
||||||
|
|
||||||
|
- name: Install loader.conf
|
||||||
|
when: hwpstate is defined and hwpstate
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item }}_loader.conf"
|
||||||
|
dest: "/boot/loader.conf.d/{{ item }}.conf"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- per_core_hwpstate
|
||||||
|
|||||||
@@ -78,4 +78,4 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: wheel
|
group: wheel
|
||||||
loop:
|
loop:
|
||||||
- percorespeedshift
|
- per_core_hwpstate
|
||||||
|
|||||||
@@ -17,3 +17,9 @@ add include $devfsrules_hide_all
|
|||||||
add include $devfsrules_unhide_basic
|
add include $devfsrules_unhide_basic
|
||||||
add include $devfsrules_unhide_login
|
add include $devfsrules_unhide_login
|
||||||
add path 'bpf*' unhide
|
add path 'bpf*' unhide
|
||||||
|
|
||||||
|
[tajailrand=15]
|
||||||
|
add include $devfsrules_hide_all
|
||||||
|
add include $devfsrules_unhide_basic
|
||||||
|
add include $devfsrules_unhide_login
|
||||||
|
add path urandom unhide
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- docker
|
- docker
|
||||||
|
- docker-compose
|
||||||
|
- docker-buildx
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create docker zfs dataset
|
- name: Create docker zfs dataset
|
||||||
|
|||||||
2
ansible/roles/dummynet/files/dnctl.conf
Normal file
2
ansible/roles/dummynet/files/dnctl.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
pipe 1 config bw 100KByte/s
|
||||||
|
pipe 2 config
|
||||||
28
ansible/roles/dummynet/files/dummynet
Normal file
28
ansible/roles/dummynet/files/dummynet
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# PROVIDE: dummynet
|
||||||
|
# BEFORE: pf ipfw
|
||||||
|
# KEYWORD: nojailvnet
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
|
||||||
|
name="dummynet"
|
||||||
|
desc="Dummynet packet queuing and scheduling"
|
||||||
|
rcvar="${name}_enable"
|
||||||
|
load_rc_config $name
|
||||||
|
start_cmd="${name}_start"
|
||||||
|
required_files="$dummynet_rules"
|
||||||
|
required_modules="dummynet"
|
||||||
|
|
||||||
|
dummynet_start()
|
||||||
|
{
|
||||||
|
startmsg -n "Enabling ${name}"
|
||||||
|
cat "$dnctl_rules" | while read l; do
|
||||||
|
dnctl $l
|
||||||
|
done
|
||||||
|
startmsg '.'
|
||||||
|
}
|
||||||
|
|
||||||
|
run_rc_command $*
|
||||||
2
ansible/roles/dummynet/files/dummynet_rc.conf
Normal file
2
ansible/roles/dummynet/files/dummynet_rc.conf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
dummynet_enable="YES"
|
||||||
|
dummynet_rules="/etc/dnctl.conf"
|
||||||
55
ansible/roles/dummynet/tasks/common.yaml
Normal file
55
ansible/roles/dummynet/tasks/common.yaml
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
# - name: Create directories
|
||||||
|
# file:
|
||||||
|
# name: "{{ item }}"
|
||||||
|
# state: directory
|
||||||
|
# mode: 0755
|
||||||
|
# owner: root
|
||||||
|
# group: wheel
|
||||||
|
# loop:
|
||||||
|
# - /foo/bar
|
||||||
|
|
||||||
|
# - name: Install scripts
|
||||||
|
# copy:
|
||||||
|
# src: "files/{{ item.src }}"
|
||||||
|
# dest: "{{ item.dest }}"
|
||||||
|
# mode: 0755
|
||||||
|
# owner: root
|
||||||
|
# group: wheel
|
||||||
|
# loop:
|
||||||
|
# - src: foo.bash
|
||||||
|
# dest: /usr/local/bin/foo
|
||||||
|
|
||||||
|
# - name: Install Configuration
|
||||||
|
# copy:
|
||||||
|
# src: "files/{{ item.src }}"
|
||||||
|
# dest: "{{ item.dest }}"
|
||||||
|
# mode: 0600
|
||||||
|
# owner: root
|
||||||
|
# group: wheel
|
||||||
|
# loop:
|
||||||
|
# - src: foo.conf
|
||||||
|
# dest: /usr/local/etc/foo.conf
|
||||||
|
|
||||||
|
# - name: Clone Source
|
||||||
|
# git:
|
||||||
|
# repo: "https://foo.bar/baz.git"
|
||||||
|
# dest: /foo/bar
|
||||||
|
# version: "v1.0.2"
|
||||||
|
# force: true
|
||||||
|
# diff: false
|
||||||
|
|
||||||
|
- import_tasks: tasks/freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
||||||
|
|
||||||
|
- include_tasks:
|
||||||
|
file: tasks/peruser.yaml
|
||||||
|
apply:
|
||||||
|
become: yes
|
||||||
|
become_user: "{{ initialize_user }}"
|
||||||
|
when: users is defined
|
||||||
|
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
|
||||||
|
loop_control:
|
||||||
|
loop_var: initialize_user
|
||||||
30
ansible/roles/dummynet/tasks/freebsd.yaml
Normal file
30
ansible/roles/dummynet/tasks/freebsd.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
- name: Install Configuration
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0600
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: "{{ dummynet_config }}"
|
||||||
|
dest: /etc/dnctl.conf
|
||||||
|
|
||||||
|
- name: Install rc script
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
mode: 0755
|
||||||
|
loop:
|
||||||
|
- src: dummynet
|
||||||
|
|
||||||
|
- name: Install service configuration
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item }}_rc.conf"
|
||||||
|
dest: "/etc/rc.conf.d/{{ item }}"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- dummynet
|
||||||
29
ansible/roles/dummynet/tasks/linux.yaml
Normal file
29
ansible/roles/dummynet/tasks/linux.yaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# - name: Build aur packages
|
||||||
|
# register: buildaur
|
||||||
|
# become_user: "{{ build_user.name }}"
|
||||||
|
# command: "aurutils-sync --no-view {{ item }}"
|
||||||
|
# args:
|
||||||
|
# creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
|
||||||
|
# loop:
|
||||||
|
# - foo
|
||||||
|
|
||||||
|
# - name: Update cache
|
||||||
|
# when: buildaur.changed
|
||||||
|
# pacman:
|
||||||
|
# name: []
|
||||||
|
# state: present
|
||||||
|
# update_cache: true
|
||||||
|
|
||||||
|
# - name: Install packages
|
||||||
|
# package:
|
||||||
|
# name:
|
||||||
|
# - foo
|
||||||
|
# state: present
|
||||||
|
|
||||||
|
# - name: Enable services
|
||||||
|
# systemd:
|
||||||
|
# enabled: yes
|
||||||
|
# name: "{{ item }}"
|
||||||
|
# daemon_reload: yes
|
||||||
|
# loop:
|
||||||
|
# - foo.service
|
||||||
2
ansible/roles/dummynet/tasks/main.yaml
Normal file
2
ansible/roles/dummynet/tasks/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
- import_tasks: tasks/common.yaml
|
||||||
|
when: (dummynet_config is defined and os_flavor == "freebsd") or (os_flavor == "linux")
|
||||||
29
ansible/roles/dummynet/tasks/peruser.yaml
Normal file
29
ansible/roles/dummynet/tasks/peruser.yaml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
- include_role:
|
||||||
|
name: per_user
|
||||||
|
|
||||||
|
# - name: Create directories
|
||||||
|
# file:
|
||||||
|
# name: "{{ account_homedir.stdout }}/{{ item }}"
|
||||||
|
# state: directory
|
||||||
|
# mode: 0700
|
||||||
|
# owner: "{{ account_name.stdout }}"
|
||||||
|
# group: "{{ group_name.stdout }}"
|
||||||
|
# loop:
|
||||||
|
# - ".config/foo"
|
||||||
|
|
||||||
|
# - name: Copy files
|
||||||
|
# copy:
|
||||||
|
# src: "files/{{ item.src }}"
|
||||||
|
# dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
|
||||||
|
# mode: 0600
|
||||||
|
# owner: "{{ account_name.stdout }}"
|
||||||
|
# group: "{{ group_name.stdout }}"
|
||||||
|
# loop:
|
||||||
|
# - src: foo.conf
|
||||||
|
# dest: .config/foo/foo.conf
|
||||||
|
|
||||||
|
- import_tasks: tasks/peruser_freebsd.yaml
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
- import_tasks: tasks/peruser_linux.yaml
|
||||||
|
when: 'os_flavor == "linux"'
|
||||||
0
ansible/roles/dummynet/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/dummynet/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/dummynet/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/dummynet/tasks/peruser_linux.yaml
Normal file
@@ -1,7 +1,7 @@
|
|||||||
(setq gc-cons-threshold (* 128 1024 1024)) ;; Increase garbage collection threshold for performance (default 800000)
|
(setq gc-cons-threshold (* 128 1024 1024)) ;; 128MiB Increase garbage collection threshold for performance (default 800000)
|
||||||
;; Increase amount of data read from processes, default 4k
|
;; Increase amount of data read from processes, default 4k
|
||||||
(when (version<= "27.0" emacs-version)
|
(when (version<= "27.0" emacs-version)
|
||||||
(setq read-process-output-max (* 1024 1024)) ;; 1mb
|
(setq read-process-output-max (* 10 1024 1024)) ;; 10MiB
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Suppress warnings
|
;; Suppress warnings
|
||||||
|
|||||||
49
ansible/roles/emacs/files/elisp/lang-c.el
Normal file
49
ansible/roles/emacs/files/elisp/lang-c.el
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
(require 'common-lsp)
|
||||||
|
(require 'util-tree-sitter)
|
||||||
|
|
||||||
|
(defun locate-compile-commands-file ()
|
||||||
|
"See if compile_commands.json exists."
|
||||||
|
;; This can be generated by prefixing the make command with `intercept-build15 --append`
|
||||||
|
(let ((compile-commands-file (locate-dominating-file (buffer-file-name) "compile_commands.json")))
|
||||||
|
compile-commands-file
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defun activate-c-eglot ()
|
||||||
|
"Activate eglot for the c family of languages."
|
||||||
|
(when (locate-compile-commands-file)
|
||||||
|
(eglot-ensure)
|
||||||
|
(defclass my/eglot-c (eglot-lsp-server) ()
|
||||||
|
:documentation
|
||||||
|
"Own eglot server class.")
|
||||||
|
|
||||||
|
(add-to-list 'eglot-server-programs
|
||||||
|
'(c-ts-mode . (my/eglot-c "/usr/local/bin/clangd15")))
|
||||||
|
(add-hook 'before-save-hook 'eglot-format-buffer nil 'local)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(use-package c-mode
|
||||||
|
:mode (
|
||||||
|
("\\.c\\'" . c-ts-mode)
|
||||||
|
("\\.h\\'" . c-or-c++-ts-mode)
|
||||||
|
)
|
||||||
|
:commands (c-mode c-ts-mode)
|
||||||
|
:pin manual
|
||||||
|
:ensure nil
|
||||||
|
:hook (
|
||||||
|
(c-ts-mode . (lambda ()
|
||||||
|
(activate-c-eglot)
|
||||||
|
))
|
||||||
|
)
|
||||||
|
:init
|
||||||
|
(add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
|
||||||
|
(add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode))
|
||||||
|
(add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode))
|
||||||
|
(add-to-list 'treesit-language-source-alist '(c "https://github.com/tree-sitter/tree-sitter-c"))
|
||||||
|
(add-to-list 'treesit-language-source-alist '(cpp "https://github.com/tree-sitter/tree-sitter-cpp"))
|
||||||
|
(unless (treesit-ready-p 'c) (treesit-install-language-grammar 'c))
|
||||||
|
(unless (treesit-ready-p 'cpp) (treesit-install-language-grammar 'cpp))
|
||||||
|
)
|
||||||
|
|
||||||
|
(provide 'lang-c)
|
||||||
22
ansible/roles/emacs/files/elisp/lang-nix.el
Normal file
22
ansible/roles/emacs/files/elisp/lang-nix.el
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
(require 'common-lsp)
|
||||||
|
(require 'util-tree-sitter)
|
||||||
|
|
||||||
|
(use-package nix-mode
|
||||||
|
:mode (("\\.nix\\'" . nix-mode)
|
||||||
|
)
|
||||||
|
:commands nix-mode
|
||||||
|
:hook (
|
||||||
|
(nix-mode . (lambda ()
|
||||||
|
;; (eglot-ensure)
|
||||||
|
;; (defclass my/eglot-nix (eglot-lsp-server) ()
|
||||||
|
;; :documentation
|
||||||
|
;; "Own eglot server class.")
|
||||||
|
|
||||||
|
;; (add-to-list 'eglot-server-programs
|
||||||
|
;; '(nix-mode . (my/eglot-nix "nixd")))
|
||||||
|
;; (add-hook 'before-save-hook 'eglot-format-buffer nil 'local)
|
||||||
|
))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(provide 'lang-nix)
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
:bind (
|
:bind (
|
||||||
("C-c l" . org-store-link)
|
("C-c l" . org-store-link)
|
||||||
("C-c a" . org-agenda)
|
("C-c a" . org-agenda)
|
||||||
|
("C--" . org-timestamp-down)
|
||||||
|
("C-=" . org-timestamp-up)
|
||||||
)
|
)
|
||||||
:hook (
|
:hook (
|
||||||
(org-mode . (lambda ()
|
(org-mode . (lambda ()
|
||||||
|
|||||||
@@ -57,19 +57,29 @@
|
|||||||
:pin manual
|
:pin manual
|
||||||
:hook (
|
:hook (
|
||||||
(python-ts-mode . (lambda ()
|
(python-ts-mode . (lambda ()
|
||||||
(when (executable-find "poetry")
|
(when-linux
|
||||||
(add-poetry-venv-to-path)
|
(when (executable-find "poetry")
|
||||||
(let ((venv (locate-venv-poetry))) (when venv
|
(add-poetry-venv-to-path)
|
||||||
(setq eglot-workspace-configuration
|
(let ((venv (locate-venv-poetry))) (when venv
|
||||||
(list (cons ':python (list ':venvPath venv ':pythonPath (concat venv "/bin/python")))))
|
(setq eglot-workspace-configuration
|
||||||
))
|
(list (cons ':python (list ':venvPath venv ':pythonPath (concat venv "/bin/python")))))
|
||||||
)
|
))
|
||||||
(when-linux
|
)
|
||||||
(eglot-ensure)
|
(eglot-ensure)
|
||||||
)
|
)
|
||||||
|
|
||||||
(add-hook 'before-save-hook 'python-fmt nil 'local)
|
;; (when-freebsd
|
||||||
))
|
;; (eglot-ensure)
|
||||||
|
;; (defclass my/eglot-pylyzer (eglot-lsp-server) ()
|
||||||
|
;; :documentation
|
||||||
|
;; "Own eglot server class.")
|
||||||
|
|
||||||
|
;; (add-to-list 'eglot-server-programs
|
||||||
|
;; '(python-ts-mode . (my/eglot-pylyzer "pylyzer" "--server")))
|
||||||
|
;; )
|
||||||
|
|
||||||
|
(add-hook 'before-save-hook 'python-fmt nil 'local)
|
||||||
|
))
|
||||||
)
|
)
|
||||||
:bind ((:map python-ts-mode-map ([backspace] . python-backspace))
|
:bind ((:map python-ts-mode-map ([backspace] . python-backspace))
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
:init
|
:init
|
||||||
(add-to-list 'major-mode-remap-alist '(rust-mode . rust-ts-mode))
|
(add-to-list 'major-mode-remap-alist '(rust-mode . rust-ts-mode))
|
||||||
(add-to-list 'treesit-language-source-alist '(rust "https://github.com/tree-sitter/tree-sitter-rust"))
|
(add-to-list 'treesit-language-source-alist '(rust "https://github.com/tree-sitter/tree-sitter-rust"))
|
||||||
(unless (treesit-ready-p 'yaml) (treesit-install-language-grammar 'rust))
|
(unless (treesit-ready-p 'rust) (treesit-install-language-grammar 'rust))
|
||||||
:config
|
:config
|
||||||
;; Add keybindings for interacting with Cargo
|
;; Add keybindings for interacting with Cargo
|
||||||
(use-package cargo
|
(use-package cargo
|
||||||
|
|||||||
17
ansible/roles/emacs/files/elisp/lang-xml.el
Normal file
17
ansible/roles/emacs/files/elisp/lang-xml.el
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
(defun xml-fmt ()
|
||||||
|
"Run xmllint --format."
|
||||||
|
(run-command-on-buffer "xmllint" "--format" "-")
|
||||||
|
)
|
||||||
|
|
||||||
|
(use-package nxml-mode
|
||||||
|
:commands (nxml-mode)
|
||||||
|
:pin manual
|
||||||
|
:ensure nil
|
||||||
|
:hook (
|
||||||
|
(nxml-mode . (lambda ()
|
||||||
|
(add-hook 'before-save-hook 'xml-fmt nil 'local)
|
||||||
|
))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(provide 'lang-xml)
|
||||||
@@ -32,4 +32,10 @@
|
|||||||
|
|
||||||
(require 'lang-dockerfile)
|
(require 'lang-dockerfile)
|
||||||
|
|
||||||
|
(require 'lang-c)
|
||||||
|
|
||||||
|
(require 'lang-xml)
|
||||||
|
|
||||||
|
(require 'lang-nix)
|
||||||
|
|
||||||
(load-directory autoload-directory)
|
(load-directory autoload-directory)
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ INIT_SCRIPT=$(cat <<EOF
|
|||||||
;; Set default font
|
;; Set default font
|
||||||
(set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono")
|
(set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono")
|
||||||
;; Set fallback font for unicode glyphs
|
;; Set fallback font for unicode glyphs
|
||||||
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji"))
|
(when (display-graphic-p)
|
||||||
|
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji")))
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(when (fboundp 'tool-bar-mode)
|
(when (fboundp 'tool-bar-mode)
|
||||||
(tool-bar-mode -1))
|
(tool-bar-mode -1))
|
||||||
|
|||||||
@@ -11,7 +11,8 @@
|
|||||||
;; Set default font
|
;; Set default font
|
||||||
(set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono")
|
(set-face-attribute 'default nil :height 100 :width 'regular :weight 'regular :family "Cascadia Mono")
|
||||||
;; Set fallback font for unicode glyphs
|
;; Set fallback font for unicode glyphs
|
||||||
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji"))
|
(when (display-graphic-p)
|
||||||
|
(set-fontset-font "fontset-default" nil (font-spec :name "Noto Color Emoji")))
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(when (fboundp 'tool-bar-mode)
|
(when (fboundp 'tool-bar-mode)
|
||||||
(tool-bar-mode -1))
|
(tool-bar-mode -1))
|
||||||
|
|||||||
@@ -5,3 +5,7 @@ dependencies:
|
|||||||
when: 'emacs_flavor == "full"'
|
when: 'emacs_flavor == "full"'
|
||||||
- role: python
|
- role: python
|
||||||
when: 'emacs_flavor == "full"'
|
when: 'emacs_flavor == "full"'
|
||||||
|
- role: terraform
|
||||||
|
when: 'emacs_flavor == "full"'
|
||||||
|
- role: nix
|
||||||
|
when: 'emacs_flavor == "full"'
|
||||||
|
|||||||
@@ -1,27 +1,35 @@
|
|||||||
- name: Install packages
|
- name: Install packages
|
||||||
|
when: install_graphics
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- emacs
|
- emacs
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
when: not install_graphics
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- emacs-nox
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
when: 'emacs_flavor == "full"'
|
when: 'emacs_flavor == "full"'
|
||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- py39-pygments
|
- py311-pygments
|
||||||
- inkscape # to support SVGs in LaTeX
|
- inkscape # to support SVGs in LaTeX
|
||||||
# - prettier # typescript formatting
|
# - prettier # typescript formatting
|
||||||
- aspell
|
- aspell
|
||||||
- en-aspell
|
- en-aspell
|
||||||
- unzip # for extracting mspyls
|
- unzip # for extracting mspyls
|
||||||
- py39-isort
|
- py311-isort
|
||||||
- py39-black
|
- py311-black
|
||||||
- zip # for odt export from org-mode
|
- zip # for odt export from org-mode
|
||||||
- gnuplot # used for exporting graphs from org-mode
|
- gnuplot # used for exporting graphs from org-mode
|
||||||
# - pyright
|
# - pyright
|
||||||
- sqlite3 # for sqlite code blocks in org-mode
|
- sqlite3 # for sqlite code blocks in org-mode
|
||||||
# - terraform-ls # Terraform language server
|
# - terraform-ls # Terraform language server
|
||||||
- py39-ptvsd
|
- py311-ptvsd
|
||||||
- hs-ShellCheck
|
- hs-ShellCheck
|
||||||
# - gopls
|
# - gopls
|
||||||
state: present
|
state: present
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
firefox_config:
|
firefox_config:
|
||||||
# identity.sync.tokenserver.uri: "https://ffsync.fizz.buzz/token/1.0/sync/1.5"
|
# identity.sync.tokenserver.uri: "https://ffsync.fizz.buzz/token/1.0/sync/1.5"
|
||||||
|
media.hardware-video-decoding.force-enabled: true
|
||||||
media.ffmpeg.vaapi.enabled: true
|
media.ffmpeg.vaapi.enabled: true
|
||||||
doh-rollout.doorhanger-decision: "UIDisabled"
|
doh-rollout.doorhanger-decision: "UIDisabled"
|
||||||
dom.security.https_only_mode: true
|
dom.security.https_only_mode: true
|
||||||
@@ -12,3 +13,33 @@ firefox_config:
|
|||||||
browser.newtabpage.activity-stream.feeds.section.topstories: false
|
browser.newtabpage.activity-stream.feeds.section.topstories: false
|
||||||
browser.newtabpage.pinned: "[]"
|
browser.newtabpage.pinned: "[]"
|
||||||
browser.newtabpage.activity-stream.section.highlights.includePocket: false
|
browser.newtabpage.activity-stream.section.highlights.includePocket: false
|
||||||
|
# Disable cache when devtools are open.
|
||||||
|
devtools.cache.disabled: true
|
||||||
|
# Do not track header.
|
||||||
|
privacy.donottrackheader.enabled: true
|
||||||
|
# Tell websites not to share or sell my data.
|
||||||
|
privacy.globalprivacycontrol.enabled: true
|
||||||
|
# Disable "studies" (slice testing)
|
||||||
|
app.shield.optoutstudies.enabled: false
|
||||||
|
# Disable attribution which is used by advertisers to track you.
|
||||||
|
dom.private-attribution.submission.enabled: false
|
||||||
|
# Disable battery status, used to track users.
|
||||||
|
dom.battery.enabled: false
|
||||||
|
# Disable that websites can get notifications if you copy, paste, or cut something from a web page, and it lets them know which part of the page had been selected.
|
||||||
|
#
|
||||||
|
# This breaks copying from BigQuery https://github.com/microsoft/monaco-editor/issues/1540
|
||||||
|
# dom.event.clipboardevents.enabled: false
|
||||||
|
# Isolates all browser identifier sources (e.g. cookies) to the first party domain, with the goal of preventing tracking across different domains.
|
||||||
|
privacy.firstparty.isolate: true
|
||||||
|
# Do not preload URLs that auto-complete in the address bar.
|
||||||
|
browser.urlbar.speculativeConnect.enabled: false
|
||||||
|
# Do not resist fingerprinting because that tells websites to use light mode.
|
||||||
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1732114
|
||||||
|
privacy.resistFingerprinting: null # (default false)
|
||||||
|
# Instead, enable fingerprinting protection, which allows configuring an override.
|
||||||
|
privacy.fingerprintingProtection: true
|
||||||
|
# Allow sending dark mode preference to websites.
|
||||||
|
# Allow sending timezone to websites.
|
||||||
|
privacy.fingerprintingProtection.overrides: "+AllTargets,-CSSPrefersColorScheme,-JSDateTimeUTC,-CanvasExtractionBeforeUserInputIsBlocked"
|
||||||
|
# Disable weather on new tab page
|
||||||
|
browser.newtabpage.activity-stream.showWeather: false
|
||||||
|
|||||||
@@ -10,12 +10,21 @@
|
|||||||
register: firefox_about_config
|
register: firefox_about_config
|
||||||
|
|
||||||
- name: Configure Firefox about:config
|
- name: Configure Firefox about:config
|
||||||
|
when: item[1].value != None
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: "{{ item[0].path }}"
|
path: "{{ item[0].path }}"
|
||||||
regexp: '"{{ item[1].key }}", [^")\n]*\)'
|
regexp: '"{{ item[1].key }}", [^")\n]*\)'
|
||||||
line: 'user_pref("{{ item[1].key }}", {{ item[1].value | to_json }});'
|
line: 'user_pref("{{ item[1].key }}", {{ item[1].value | to_json }});'
|
||||||
loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}"
|
loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}"
|
||||||
|
|
||||||
|
- name: Configure Firefox about:config
|
||||||
|
when: item[1].value == None
|
||||||
|
lineinfile:
|
||||||
|
path: "{{ item[0].path }}"
|
||||||
|
regexp: '"{{ item[1].key }}", [^")\n]*\)'
|
||||||
|
state: absent
|
||||||
|
loop: "{{ firefox_about_config.files | product(firefox_config | dict2items) | list }}"
|
||||||
|
|
||||||
- import_tasks: tasks/peruser_freebsd.yaml
|
- import_tasks: tasks/peruser_freebsd.yaml
|
||||||
when: 'os_flavor == "freebsd"'
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
ext_if = "{ igb0 igb1 ix0 ix1 wlan0 }"
|
ext_if = "{ igb0 igb1 ix0 ix1 linfi_host }"
|
||||||
not_ext_if = "{ !igb0 !igb1 !ix0 !ix1 !wlan0 }"
|
not_ext_if = "{ !igb0 !igb1 !ix0 !ix1 !linfi_host }"
|
||||||
jail_nat_v4 = "{ 10.215.1.0/24 }"
|
jail_nat_v4 = "{ 10.215.1.0/24 }"
|
||||||
not_jail_nat_v4 = "{ any, !10.215.1.0/24 }"
|
not_jail_nat_v4 = "{ any, !10.215.1.0/24 }"
|
||||||
restricted_nat_v4 = "{ 10.215.2.0/24 }"
|
restricted_nat_v4 = "{ 10.215.2.0/24 }"
|
||||||
not_restricted_nat_v4 = "{ any, !10.215.2.0/24 }"
|
not_restricted_nat_v4 = "{ any, !10.215.2.0/24 }"
|
||||||
|
rfc1918 = "{ 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 }"
|
||||||
|
|
||||||
dhcp = "{ bootpc, bootps }"
|
dhcp = "{ bootpc, bootps }"
|
||||||
allow = "{ wgh wgf }"
|
allow = "{ wgh wgf }"
|
||||||
@@ -17,22 +18,51 @@ unifi_ports = "{ 8443 3478 10001 8080 1900 8843 8880 6789 5514 }"
|
|||||||
# options
|
# options
|
||||||
set skip on lo
|
set skip on lo
|
||||||
|
|
||||||
|
# queueing
|
||||||
|
# altq on linfi_host cbq queue { def, stuff }
|
||||||
|
# queue def cbq(default borrow)
|
||||||
|
# queue stuff bandwidth 8Mb cbq { dagger }
|
||||||
|
# queue dagger cbq(borrow)
|
||||||
|
|
||||||
# redirections
|
# redirections
|
||||||
nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (wlan0)
|
nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (linfi_host)
|
||||||
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 1.1.1.1 port 53
|
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 172.16.0.1 port 53
|
||||||
|
|
||||||
# cloak
|
# cloak
|
||||||
nat pass on $ext_if inet from 10.215.2.0/24 to !10.215.2.0/24 -> (wlan0)
|
nat pass on $ext_if inet from 10.215.2.0/24 to !10.215.2.0/24 -> (linfi_host)
|
||||||
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.2.1 port 53 -> 1.1.1.1 port 53
|
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.2.1 port 53 -> 172.16.0.1 port 53
|
||||||
|
|
||||||
rdr pass on $ext_if inet proto tcp from $not_restricted_nat_v4 to any port 8081 -> 10.215.2.2 port 8081
|
# bastion
|
||||||
nat pass on restricted_nat proto {tcp, udp} from any to 10.215.2.2 port 8081 -> 10.215.2.1
|
rdr pass on $ext_if inet proto {tcp, udp} from { any, !10.215.1.0/24, !10.215.2.0/24 } to any port 8081 -> 10.215.1.217 port 443
|
||||||
|
nat pass on jail_nat proto {tcp, udp} from any to 10.215.1.217 port 443 -> 10.215.1.1
|
||||||
|
nat pass on restricted_nat proto {tcp, udp} from 10.215.1.217/32 to 10.215.2.2 port 8081 -> 10.215.2.1
|
||||||
|
|
||||||
|
|
||||||
|
# cloak -> olddagger
|
||||||
|
rdr pass on $ext_if inet proto {tcp, udp} from $not_restricted_nat_v4 to any port 8082 -> 10.215.2.2 port 8082
|
||||||
|
nat pass on restricted_nat proto {tcp, udp} from any to 10.215.2.2 port 8082 -> 10.215.2.1
|
||||||
|
|
||||||
|
# cloak -> dagger old
|
||||||
|
rdr pass on $ext_if inet proto {tcp, udp} from $not_restricted_nat_v4 to any port 8083 -> 10.215.2.2 port 8083
|
||||||
|
nat pass on restricted_nat proto {tcp, udp} from any to 10.215.2.2 port 8083 -> 10.215.2.1
|
||||||
|
|
||||||
|
# -> sftp
|
||||||
|
# TODO: Limit bandwidth for sftp
|
||||||
|
rdr pass on $ext_if inet proto {tcp, udp} from $not_jail_nat_v4 to any port 8022 -> 10.215.1.216 port 22
|
||||||
|
nat pass on jail_nat proto {tcp, udp} from any to 10.215.1.216 port 22 -> 10.215.1.1
|
||||||
|
|
||||||
# Forward ports for unifi controller
|
# Forward ports for unifi controller
|
||||||
# rdr pass on $ext_if inet proto tcp from any to any port 65022 -> 10.213.177.8 port 22
|
# rdr pass on $ext_if inet proto {tcp, udp} from any to any port 65022 -> 10.213.177.8 port 22
|
||||||
rdr pass on $ext_if inet proto {udp, tcp} from any to any port $unifi_ports -> 10.215.1.202
|
rdr pass on $ext_if inet proto {udp, tcp} from any to any port $unifi_ports -> 10.215.1.202
|
||||||
|
|
||||||
|
# -> momlaptop
|
||||||
|
rdr pass on $ext_if inet proto {tcp, udp} from $not_jail_nat_v4 to any port 8033 -> 10.215.1.218 port 443
|
||||||
|
nat pass on jail_nat proto {tcp, udp} from any to 10.215.1.218 port 443 -> 10.215.1.1
|
||||||
|
|
||||||
# filtering
|
# filtering
|
||||||
|
# match in on jail_nat from any to any dnpipe(1, 2)
|
||||||
|
# match in on restricted_nat from any to any dnpipe(1, 2)
|
||||||
|
|
||||||
block log all
|
block log all
|
||||||
pass out on $ext_if
|
pass out on $ext_if
|
||||||
|
|
||||||
@@ -42,6 +72,7 @@ pass out on jail_nat from $jail_nat_v4
|
|||||||
pass out on jail_nat proto {udp, tcp} from any to 10.215.1.202 port $unifi_ports
|
pass out on jail_nat proto {udp, tcp} from any to 10.215.1.202 port $unifi_ports
|
||||||
pass out on restricted_nat proto {udp, tcp} from any to 10.215.2.2 port 8081
|
pass out on restricted_nat proto {udp, tcp} from any to 10.215.2.2 port 8081
|
||||||
|
|
||||||
|
# TODO: limit bandwidth for dagger here
|
||||||
pass in on restricted_nat proto {udp, tcp} from any to any port { 53 51820 }
|
pass in on restricted_nat proto {udp, tcp} from any to any port { 53 51820 }
|
||||||
|
|
||||||
# We pass on the interfaces listed in allow rather than skipping on
|
# We pass on the interfaces listed in allow rather than skipping on
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ scrub in on $ext_if all fragment reassemble
|
|||||||
|
|
||||||
# redirections
|
# redirections
|
||||||
nat on $ext_if inet from ! ($ext_if) to ! ($ext_if) -> ($ext_if)
|
nat on $ext_if inet from ! ($ext_if) to ! ($ext_if) -> ($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 jail_nat proto {tcp, udp} from any to 10.215.1.1 port 53 tag REDIREXTERNAL -> 1.1.1.1 port 53
|
||||||
|
|
||||||
rdr pass on $ext_if proto {tcp, udp} to ($ext_if) 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 proto {tcp, udp} to ($ext_if) port 6443 tag REDIRINTERNAL -> 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
|
||||||
@@ -63,6 +63,7 @@ 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
|
||||||
|
# doas route add -net 10.129.0.0/16 -interface jail_nat
|
||||||
# doas sysctl net.link.ether.inet.proxyall=1
|
# doas sysctl net.link.ether.inet.proxyall=1
|
||||||
# Plus this in pf.conf:
|
# Plus this in pf.conf:
|
||||||
# pass quick from any to 74.80.180.139
|
# pass quick from any to 74.80.180.139
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
ext_if = "{ wlan0 }"
|
ext_if = "{ linfi_host }"
|
||||||
not_ext_if = "{ !wlan0 }"
|
not_ext_if = "{ !linfi_host }"
|
||||||
jail_nat_v4 = "{ 10.215.1.0/24 }"
|
jail_nat_v4 = "{ 10.215.1.0/24 }"
|
||||||
not_jail_nat_v4 = "{ any, !10.215.1.0/24 }"
|
not_jail_nat_v4 = "{ any, !10.215.1.0/24 }"
|
||||||
dns_redirect = "{ 10.193.223.1 10.213.177.1 10.215.1.1 }"
|
rfc1918 = "{ 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 }"
|
||||||
|
|
||||||
dhcp = "{ bootpc, bootps }"
|
dhcp = "{ bootpc, bootps }"
|
||||||
#allow = "{ wgf wgh drmario colo }"
|
allow = "{ wgf wgh drmario colo }"
|
||||||
|
|
||||||
tcp_pass_in = "{ 22 }"
|
tcp_pass_in = "{ 22 }"
|
||||||
udp_pass_in = "{ 53 51820 }"
|
udp_pass_in = "{ 53 51820 }"
|
||||||
@@ -16,8 +16,8 @@ udp_pass_in = "{ 53 51820 }"
|
|||||||
set skip on lo
|
set skip on lo
|
||||||
|
|
||||||
# redirections
|
# redirections
|
||||||
#nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (wlan0)
|
nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (linfi_host)
|
||||||
#rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 1.1.1.1 port 53
|
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 172.16.0.1 port 53
|
||||||
|
|
||||||
# Redirect jaeger ports to virtual machine.
|
# Redirect jaeger ports to virtual machine.
|
||||||
# nat pass on lo inet from 127.0.0.0/24 to 127.0.0.0/24 port {6831 6832 16686 14268} -> (jail_nat)
|
# nat pass on lo inet from 127.0.0.0/24 to 127.0.0.0/24 port {6831 6832 16686 14268} -> (jail_nat)
|
||||||
@@ -27,16 +27,18 @@ set skip on lo
|
|||||||
block log all
|
block log all
|
||||||
pass out on $ext_if
|
pass out on $ext_if
|
||||||
|
|
||||||
#pass in on jail_nat
|
pass in on jail_nat
|
||||||
|
# match in on jail_nat from any to any dnpipe 1
|
||||||
|
# match in on jail_nat from any to $rfc1918 dnpipe 2
|
||||||
# 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_v4
|
||||||
|
|
||||||
# We pass on the interfaces listed in allow rather than skipping on
|
# We pass on the interfaces listed in allow rather than skipping on
|
||||||
# them because changes to pass rules will update when running a
|
# them because changes to pass rules will update when running a
|
||||||
# `service pf reload` but interfaces that we `skip` will not update (I
|
# `service pf reload` but interfaces that we `skip` will not update (I
|
||||||
# forget if its from adding, removing, or both. TODO: test to figure
|
# forget if its from adding, removing, or both. TODO: test to figure
|
||||||
# it out). Also skipped interfaces are not subject to nat/rdr rules.
|
# it out). Also skipped interfaces are not subject to nat/rdr rules.
|
||||||
#pass quick on $allow
|
pass quick on $allow
|
||||||
|
|
||||||
pass on $ext_if proto icmp all
|
pass on $ext_if proto icmp all
|
||||||
pass on $ext_if proto icmp6 all
|
pass on $ext_if proto icmp6 all
|
||||||
|
|||||||
2
ansible/roles/firewall/meta/main.yaml
Normal file
2
ansible/roles/firewall/meta/main.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
dependencies:
|
||||||
|
- dummynet
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# Disable the hardware watchdog inside AMD 700 chipset series for power savings.
|
||||||
|
blacklist sp5100_tco
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Disable power save for wifi card because power save caused video stuttering in google meet on Linux. Both of these are currently the default on FreeBSD but I'm saving it just in case that default changes.
|
||||||
|
compat.linuxkpi.iwlwifi_power_save="0"
|
||||||
|
compat.linuxkpi.iwlwifi_mvm_power_scheme="1"
|
||||||
10
ansible/roles/framework_laptop/files/gpe10-boot.service
Normal file
10
ansible/roles/framework_laptop/files/gpe10-boot.service
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Disable gpe10 interrupt on boot
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/bin/sh -c "echo disable > /sys/firmware/acpi/interrupts/gpe10"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
13
ansible/roles/framework_laptop/files/gpe10-sleep.service
Normal file
13
ansible/roles/framework_laptop/files/gpe10-sleep.service
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Enable gpe10 interrupt for sleep
|
||||||
|
Before=sleep.target
|
||||||
|
StopWhenUnneeded=true
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/bin/sh -c "echo enable > /sys/firmware/acpi/interrupts/gpe10"
|
||||||
|
ExecStop=/bin/sh -c "echo disable > /sys/firmware/acpi/interrupts/gpe10"
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=sleep.target
|
||||||
13
ansible/roles/framework_laptop/files/iwlwifi_modprobe.conf
Normal file
13
ansible/roles/framework_laptop/files/iwlwifi_modprobe.conf
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Manually disable power save:
|
||||||
|
# iw wlan0 set power_save off
|
||||||
|
|
||||||
|
## High power:
|
||||||
|
options iwlwifi power_save=0
|
||||||
|
# options iwlwifi uapsd_disable=1
|
||||||
|
options iwlmvm power_scheme=1 # 1-active, 2-balanced, 3-low power, default: 2 (int)
|
||||||
|
|
||||||
|
## Low power:
|
||||||
|
# options iwlwifi power_save=1
|
||||||
|
# ? power_level:default power save level (range from 1 - 5, default: 1) (int)
|
||||||
|
# options iwlwifi uapsd_disable=0
|
||||||
|
# options iwlmvm power_scheme=3
|
||||||
285
ansible/roles/framework_laptop/files/launch_windows.bash
Normal file
285
ansible/roles/framework_laptop/files/launch_windows.bash
Normal file
@@ -0,0 +1,285 @@
|
|||||||
|
#!/usr/local/bin/bash
|
||||||
|
#
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
# Share a host directory to the guest via 9pfs.
|
||||||
|
#
|
||||||
|
# Inside the VM run:
|
||||||
|
# mount -t virtfs -o trans=virtio sharename /some/vm/path
|
||||||
|
# mount -t 9p -o cache=mmap -o msize=512000 sharename /mnt/9p
|
||||||
|
# mount -t 9p -o trans=virtio,cache=mmap,msize=512000 sharename /path/to/mountpoint
|
||||||
|
# bhyve_options="-s 28,virtio-9p,sharename=/"
|
||||||
|
|
||||||
|
# Enable Sound
|
||||||
|
# bhyve_options="-s 16,hda,play=/dev/dsp,rec=/dev/dsp"
|
||||||
|
|
||||||
|
# Example usage:
|
||||||
|
#
|
||||||
|
# doas bhyve_netgraph_bridge create-disk zdata/vm/poudriere /vm/poudriere 10
|
||||||
|
# doas bhyve_netgraph_bridge start poudriere zdata/vm/poudriere /vm/poudriere /vm/iso/FreeBSD-13.2-RELEASE-amd64-bootonly.iso
|
||||||
|
# doas bhyve_netgraph_bridge start poudriere zdata/vm/poudriere /vm/poudriere
|
||||||
|
|
||||||
|
: ${VERBOSE:="NO"} # or YES
|
||||||
|
: ${CPU_CORES:="1"}
|
||||||
|
: ${MEMORY:="1G"}
|
||||||
|
: ${NETWORK:="NAT"} # or RAW or BOTH
|
||||||
|
: ${IP_RANGE:="10.215.1.1/24"} # Ignored for RAW networks
|
||||||
|
: ${INTERFACE_NAME:="jail_nat"} # or the external interface like lagg0 for RAW networks
|
||||||
|
: ${BRIDGE_NAME:="bridge_$INTERFACE_NAME"} # or bridge_raw for RAW networks
|
||||||
|
: ${VNC_ENABLE:="NO"}
|
||||||
|
: ${VNC_LISTEN:="127.0.0.1:5900"}
|
||||||
|
: ${VNC_WIDTH:="1920"}
|
||||||
|
: ${VNC_HEIGHT:="1080"}
|
||||||
|
|
||||||
|
if [ "$VERBOSE" = "YES" ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
############## Setup #########################
|
||||||
|
|
||||||
|
function cleanup {
|
||||||
|
for vm in "${vms[@]}"; do
|
||||||
|
log "Destroying bhyve vm $vm"
|
||||||
|
bhyvectl "--vm=$vm" --destroy
|
||||||
|
log "Destroyed bhyve vm $vm"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
vms=()
|
||||||
|
for sig in EXIT; do
|
||||||
|
trap "set +e; sleep 10; cleanup" "$sig"
|
||||||
|
done
|
||||||
|
|
||||||
|
function die {
|
||||||
|
local status_code="$1"
|
||||||
|
shift
|
||||||
|
(>&2 echo "${@}")
|
||||||
|
exit "$status_code"
|
||||||
|
}
|
||||||
|
|
||||||
|
function log {
|
||||||
|
(>&2 echo "${@}")
|
||||||
|
}
|
||||||
|
|
||||||
|
############## Program #########################
|
||||||
|
|
||||||
|
function main {
|
||||||
|
local cmd="$1"
|
||||||
|
shift 1
|
||||||
|
if [ "$cmd" = "create-disk" ]; then
|
||||||
|
create_disk "${@}"
|
||||||
|
elif [ "$cmd" = "start" ]; then
|
||||||
|
start_vm "${@}"
|
||||||
|
else
|
||||||
|
die 1 "Unrecognized command $cmd"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function create_disk {
|
||||||
|
local zfs_path="$1"
|
||||||
|
local mount_path="$2"
|
||||||
|
local gigabytes="$3"
|
||||||
|
zfs create -o "mountpoint=$mount_path" "$zfs_path"
|
||||||
|
cp /usr/local/share/edk2-bhyve/BHYVE_UEFI_VARS.fd "${mount_path}/"
|
||||||
|
tee "${mount_path}/settings" <<EOF
|
||||||
|
CPU_CORES="$CPU_CORES"
|
||||||
|
MEMORY="$MEMORY"
|
||||||
|
NETWORK="$NETWORK"
|
||||||
|
IP_RANGE="$IP_RANGE"
|
||||||
|
BRIDGE_NAME="$BRIDGE_NAME"
|
||||||
|
INTERFACE_NAME="$INTERFACE_NAME"
|
||||||
|
EOF
|
||||||
|
zfs create -s "-V${gigabytes}G" -o volmode=dev -o primarycache=metadata -o secondarycache=none -o volblocksize=64K "$zfs_path/disk0"
|
||||||
|
}
|
||||||
|
|
||||||
|
function start_vm {
|
||||||
|
local name="$1"
|
||||||
|
local zfs_path="$2"
|
||||||
|
local mount_path="$3"
|
||||||
|
local mount_cd="${4:-}"
|
||||||
|
|
||||||
|
if [ -e "${mount_path}/settings" ]; then
|
||||||
|
source "${mount_path}/settings"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local host_interface_name="$INTERFACE_NAME" # for raw, external interface
|
||||||
|
local bridge_name="$BRIDGE_NAME"
|
||||||
|
local ip_range="$IP_RANGE" # for raw this value does not matter
|
||||||
|
|
||||||
|
local mac_address
|
||||||
|
mac_address=$(calculate_mac_address "$name")
|
||||||
|
|
||||||
|
local additional_args=()
|
||||||
|
|
||||||
|
if [ "$NETWORK" = "NAT" ]; then
|
||||||
|
assert_bridge "$host_interface_name" "$bridge_name" "$ip_range"
|
||||||
|
local bridge_link_name=$(detect_available_link "${bridge_name}")
|
||||||
|
additional_args+=("-s" "2:0,e1000,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
|
||||||
|
elif [ "$NETWORK" = "RAW" ]; then
|
||||||
|
assert_raw "$host_interface_name" "$bridge_name"
|
||||||
|
local bridge_link_name=$(detect_available_link "${bridge_name}")
|
||||||
|
additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
|
||||||
|
elif [ "$NETWORK" = "BOTH" ]; then
|
||||||
|
assert_bridge "jail_nat" "$bridge_name" "$ip_range"
|
||||||
|
assert_raw "$host_interface_name" "bridge_raw"
|
||||||
|
local bridge_link_name=$(detect_available_link "${bridge_name}")
|
||||||
|
local raw_bridge_link_name=$(detect_available_link "bridge_raw")
|
||||||
|
local raw_mac_address=$(calculate_mac_address "${name}_raw")
|
||||||
|
additional_args+=("-s" "2:0,virtio-net,netgraph,path=${bridge_name}:,peerhook=${bridge_link_name},mac=${mac_address}")
|
||||||
|
additional_args+=("-s" "3:0,virtio-net,netgraph,path=bridge_raw:,peerhook=${raw_bridge_link_name},mac=${raw_mac_address}")
|
||||||
|
elif [ "$NETWORK" = "NONE" ]; then
|
||||||
|
(>&2 echo "Not using any network.")
|
||||||
|
else
|
||||||
|
die 1 "Unrecognized NETWORK type $NETWORK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# -H release the CPU when guest issues HLT instruction. Otherwise 100% of core will be consumed.
|
||||||
|
# -s 3,ahci-cd,/vm/.iso/archlinux-2023.04.01-x86_64.iso \
|
||||||
|
# -s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080,wait \
|
||||||
|
# -s 29,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080 \
|
||||||
|
|
||||||
|
# TODO: Look into using nmdm instead of stdio for serial console
|
||||||
|
if [ -n "$mount_cd" ]; then
|
||||||
|
additional_args+=("-s" "5,ahci-cd,$mount_cd")
|
||||||
|
fi
|
||||||
|
if [ "$VNC_ENABLE" = "YES" ]; then
|
||||||
|
additional_args+=("-s" "29,fbuf,tcp=$VNC_LISTEN,w=$VNC_WIDTH,h=$VNC_HEIGHT,wait")
|
||||||
|
fi
|
||||||
|
vms+=("$name")
|
||||||
|
# Removes CPU_CORES because windows must be a single CPU in bhyve
|
||||||
|
# -c $CPU_CORES \
|
||||||
|
# We need tpm
|
||||||
|
# -l "tpm,passthru,/dev/tpm0" \
|
||||||
|
# -S \
|
||||||
|
while true; do
|
||||||
|
set -x
|
||||||
|
set +e
|
||||||
|
bhyve \
|
||||||
|
-D \
|
||||||
|
-c sockets=1,cores=2,threads=2 \
|
||||||
|
-m $MEMORY \
|
||||||
|
-H \
|
||||||
|
-w \
|
||||||
|
-o 'rtc.use_localtime=false' \
|
||||||
|
-s 0,hostbridge \
|
||||||
|
-s "4,nvme,/dev/zvol/${zfs_path}/disk0" \
|
||||||
|
-s 16,hda,play=/dev/dsp,rec=/dev/dsp \
|
||||||
|
-s 30,xhci,tablet \
|
||||||
|
-s 31,lpc -l com1,stdio \
|
||||||
|
-l "bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,${mount_path}/BHYVE_UEFI_VARS.fd" \
|
||||||
|
-U '5a63bcd1-5cb4-4401-8a6f-d4042fb928a6' \
|
||||||
|
"${additional_args[@]}" \
|
||||||
|
"$name"
|
||||||
|
local exit_code=$?
|
||||||
|
set -e
|
||||||
|
set +x
|
||||||
|
if [ $exit_code -eq 0 ]; then
|
||||||
|
echo "Rebooting."
|
||||||
|
sleep 5
|
||||||
|
elif [ $exit_code -eq 1 ]; then
|
||||||
|
echo "Powered off."
|
||||||
|
break
|
||||||
|
elif [ $exit_code -eq 2 ]; then
|
||||||
|
echo "Halted."
|
||||||
|
break
|
||||||
|
elif [ $exit_code -eq 3 ]; then
|
||||||
|
echo "Triple fault."
|
||||||
|
break
|
||||||
|
elif [ $exit_code -eq 4 ]; then
|
||||||
|
echo "Exited due to an error."
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function detect_available_link {
|
||||||
|
local bridge_name="$1"
|
||||||
|
local linknum=1
|
||||||
|
while true; do
|
||||||
|
local link_name="link${linknum}"
|
||||||
|
if ! ng_exists "${bridge_name}:${link_name}"; then
|
||||||
|
echo "$link_name"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
linknum=$((linknum + 1))
|
||||||
|
if [ "$linknum" -gt 90 ]; then
|
||||||
|
(>&2 echo "No available links on bridge $bridge_name")
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function assert_bridge {
|
||||||
|
local host_interface_name="$1"
|
||||||
|
local bridge_name="$2"
|
||||||
|
local ip_range="$3"
|
||||||
|
|
||||||
|
if ! ng_exists "${bridge_name}:"; then
|
||||||
|
ngctl -d -f - <<EOF
|
||||||
|
mkpeer . eiface hook ether
|
||||||
|
name .:hook $host_interface_name
|
||||||
|
EOF
|
||||||
|
ngctl -d -f - <<EOF
|
||||||
|
mkpeer ${host_interface_name}: bridge ether link0
|
||||||
|
name ${host_interface_name}:ether $bridge_name
|
||||||
|
EOF
|
||||||
|
ifconfig $(ngctl msg "${host_interface_name}:" getifname | grep Args | cut -d '"' -f 2) name "${host_interface_name}" "$ip_range" up
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function assert_raw {
|
||||||
|
local extif="$1"
|
||||||
|
local bridge_name="$2"
|
||||||
|
|
||||||
|
kldload -n ng_bridge ng_eiface ng_ether
|
||||||
|
|
||||||
|
if ! ng_exists "${bridge_name}:"; then
|
||||||
|
ngctlcat <<EOF
|
||||||
|
# Create a bridge.
|
||||||
|
mkpeer $extif: bridge lower link0
|
||||||
|
# Assign a name to the bridge.
|
||||||
|
name $extif:lower ${bridge_name}
|
||||||
|
# Since the host is also using $extif, we need to connect the upper hook also. Otherwise we will lose connectivity.
|
||||||
|
connect $extif: ${bridge_name}: upper link1
|
||||||
|
|
||||||
|
# Enable promiscuous mode so the host ethernet adapter accepts packets for all addresses
|
||||||
|
msg $extif: setpromisc 1
|
||||||
|
|
||||||
|
# Do not overwrite source address on packets
|
||||||
|
msg $extif: setautosrc 0
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function ng_exists {
|
||||||
|
ngctl status "${1}" >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculate_mac_address {
|
||||||
|
local name="$1"
|
||||||
|
local source
|
||||||
|
source=$(md5 -r -s "$name" | awk '{print $1}')
|
||||||
|
echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function find_available_port {
|
||||||
|
local start_port="$1"
|
||||||
|
local port="$start_port"
|
||||||
|
while true; do
|
||||||
|
sockstat -P tcp -p 443
|
||||||
|
port=$((port + 1))
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function ngctlcat {
|
||||||
|
if [ "$VERBOSE" = "YES" ]; then
|
||||||
|
tee /dev/tty | ngctl -d -f -
|
||||||
|
else
|
||||||
|
ngctl -d -f -
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
main "${@}"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# Sound power-saving was causing chat notifications to be inaudible.
|
||||||
|
# options snd_hda_intel power_save=1
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
options cfg80211 ieee80211_regdom=US
|
||||||
46
ansible/roles/framework_laptop/files/windows
Normal file
46
ansible/roles/framework_laptop/files/windows
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# REQUIRE: LOGIN
|
||||||
|
# PROVIDE: windows
|
||||||
|
# KEYWORD: shutdown
|
||||||
|
|
||||||
|
. /etc/rc.subr
|
||||||
|
name=windows
|
||||||
|
rcvar=${name}_enable
|
||||||
|
start_cmd="${name}_start"
|
||||||
|
stop_cmd="${name}_stop"
|
||||||
|
status_cmd="${name}_status"
|
||||||
|
load_rc_config $name
|
||||||
|
|
||||||
|
tmux_name="windows"
|
||||||
|
|
||||||
|
windows_start() {
|
||||||
|
/usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env VNC_ENABLE=YES VNC_LISTEN=0.0.0.0:5900 /usr/local/bin/bash /usr/local/bin/launch_windows start windows zroot/freebsd/current/vm/windows /vm/windows /vm/.iso/Win11_23H2_English_x64v2.iso"
|
||||||
|
}
|
||||||
|
|
||||||
|
windows_status() {
|
||||||
|
if /usr/local/bin/tmux has-session -t $tmux_name 2>/dev/null; then
|
||||||
|
echo "$tmux_name is running."
|
||||||
|
else
|
||||||
|
echo "$tmux_name is not running."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
windows_stop() {
|
||||||
|
/usr/local/bin/tmux has-session -t $tmux_name 2>/dev/null && (
|
||||||
|
/usr/local/bin/tmux kill-session -t $tmux_name
|
||||||
|
sleep 10
|
||||||
|
bhyvectl --vm=windows --destroy
|
||||||
|
# kill `cat /var/run/windows.pid`
|
||||||
|
)
|
||||||
|
windows_wait_for_end
|
||||||
|
}
|
||||||
|
|
||||||
|
windows_wait_for_end() {
|
||||||
|
while /usr/local/bin/tmux has-session -t $tmux_name 2>dev/null; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
run_rc_command "$1"
|
||||||
3
ansible/roles/framework_laptop/meta/main.yaml
Normal file
3
ansible/roles/framework_laptop/meta/main.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
dependencies:
|
||||||
|
- role: bhyve
|
||||||
|
when: 'os_flavor == "freebsd"'
|
||||||
@@ -1,5 +1,30 @@
|
|||||||
# - name: Install packages
|
- name: Install loader.conf
|
||||||
# package:
|
copy:
|
||||||
# name:
|
src: "files/{{ item }}_loader.conf"
|
||||||
# - foo
|
dest: "/boot/loader.conf.d/{{ item }}.conf"
|
||||||
# state: present
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- disable_wifi_powersave
|
||||||
|
|
||||||
|
- name: Install scripts
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: launch_windows.bash
|
||||||
|
dest: /usr/local/bin/launch_windows
|
||||||
|
|
||||||
|
- name: Install rc script
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
mode: 0755
|
||||||
|
loop:
|
||||||
|
- src: windows
|
||||||
|
|||||||
@@ -18,3 +18,83 @@
|
|||||||
group: wheel
|
group: wheel
|
||||||
loop:
|
loop:
|
||||||
- screen_brightness
|
- screen_brightness
|
||||||
|
|
||||||
|
- name: Install module config
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item }}_modprobe.conf"
|
||||||
|
dest: "/etc/modprobe.d/{{ item }}.conf"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- iwlwifi
|
||||||
|
- snd_hda_intel
|
||||||
|
- disable_sp5100_watchdog
|
||||||
|
- wifi_us
|
||||||
|
|
||||||
|
- name: Configure kernel command line
|
||||||
|
zfs:
|
||||||
|
name: "zroot/linux"
|
||||||
|
state: present
|
||||||
|
extra_zfs_properties:
|
||||||
|
# amdgpu.abmlevel=3 :: Automatically reduce screen brightness but tweak colors to compensate for power reduction.
|
||||||
|
# pcie_aspm=force pcie_aspm.policy=powersupersave :: Enable PCIe active state power management for power reduction.
|
||||||
|
# nowatchdog :: Disable watchdog for power savings (related to disable_sp5100_watchdog above).
|
||||||
|
# amd_pstate=passive :: Fully automated hardware pstate control.
|
||||||
|
# amd_pstate=active :: Same as passive except we can set the energy performance preference (EPP) to suggest how much we prefer performance or energy efficiency.
|
||||||
|
# amd_pstate=guided :: Same as passive except we can set upper and lower frequency bounds.
|
||||||
|
# amdgpu.dcdebugmask=0x10 :: Allegedly disables Panel Replay from https://community.frame.work/t/tracking-freezing-arch-linux-amd/39495/32
|
||||||
|
"org.zfsbootmenu:commandline": "rw quiet amdgpu.abmlevel=3 pcie_aspm=force pcie_aspm.policy=powersupersave nowatchdog amdgpu.dcdebugmask=0x10"
|
||||||
|
|
||||||
|
- name: Install Configuration
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0600
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: gpe10-boot.service
|
||||||
|
dest: /etc/systemd/system/gpe10-boot.service
|
||||||
|
- src: gpe10-sleep.service
|
||||||
|
dest: /etc/systemd/system/gpe10-sleep.service
|
||||||
|
|
||||||
|
- name: Enable services
|
||||||
|
systemd:
|
||||||
|
enabled: yes
|
||||||
|
name: "{{ item }}"
|
||||||
|
daemon_reload: yes
|
||||||
|
loop:
|
||||||
|
- gpe10-boot.service
|
||||||
|
- gpe10-sleep.service
|
||||||
|
# install swtpm
|
||||||
|
# install edk2-ovmf for /usr/share/ovmf/OVMF.fd
|
||||||
|
# install qemu-system-x86
|
||||||
|
|
||||||
|
# doas qemu-system-x86_64 -cdrom /vm/.iso/Win11_23H2_English_x64v2.iso -cpu Skylake-Client-v3 -enable-kvm -m 8192 —device chardev,socket,id=chrtpm,path=/tmp/emulated_tpm/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0 -smp 2 -device intel-hda -device hda-duplex -usb -nic user,ipv6=off,model=rtl8139,mac=84:1b:77:c9:03:a6 -bios /usr/share/edk2/x64/OVMF.fd -drive file=/dev/zvol/zroot/freebsd/current/vm/windows/disk0,format=raw,media=disk,if=none,id=nvm -device nvme,drive=nvm,serial=foo,opt_io_size=4096,min_io_size=4096,logical_block_size=4096,physical_block_size=4096
|
||||||
|
|
||||||
|
# doas mkdir /tmp/emulated_tpm
|
||||||
|
# doas swtpm socket --tpmstate dir=/tmp/emulated_tpm --ctrl type=unixio,path=/tmp/emulated_tpm/swtpm-sock --log level=20 --tpm2
|
||||||
|
|
||||||
|
- name: Build aur packages
|
||||||
|
register: buildaur
|
||||||
|
become_user: "{{ build_user.name }}"
|
||||||
|
command: "aurutils-sync --no-view {{ item }}"
|
||||||
|
args:
|
||||||
|
creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
|
||||||
|
loop:
|
||||||
|
- fw-ectool-git
|
||||||
|
|
||||||
|
- name: Update cache
|
||||||
|
when: buildaur.changed
|
||||||
|
pacman:
|
||||||
|
name: []
|
||||||
|
state: present
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- fw-ectool-git
|
||||||
|
- wireless-regdb
|
||||||
|
state: present
|
||||||
|
|||||||
14
ansible/roles/google_cloud_sdk/files/google_logging_link.py
Executable file
14
ansible/roles/google_cloud_sdk/files/google_logging_link.py
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
|
# Generate a link to google cloud logging by passing in a logging query.
|
||||||
|
import sys
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
|
def main():
|
||||||
|
query = "\n".join([line.strip() for line in sys.stdin.readlines()])
|
||||||
|
query = urllib.parse.quote(query)
|
||||||
|
query = query + "?project=project-id-here"
|
||||||
|
print(query)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -1,3 +1,14 @@
|
|||||||
|
- name: Install scripts
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: google_logging_link.py
|
||||||
|
dest: /usr/local/bin/google_logging_link
|
||||||
|
|
||||||
- import_tasks: tasks/freebsd.yaml
|
- import_tasks: tasks/freebsd.yaml
|
||||||
when: 'os_flavor == "freebsd"'
|
when: 'os_flavor == "freebsd"'
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
hw.amdgpu.abmlevel=3
|
||||||
@@ -2,34 +2,25 @@
|
|||||||
package:
|
package:
|
||||||
name:
|
name:
|
||||||
- drm-kmod
|
- drm-kmod
|
||||||
# - libva-intel-media-driver # va-api support for broadwell (2014) and newer.
|
|
||||||
# - libva-intel-driver # va-api support until after coffeelake (2017).
|
|
||||||
- vulkan-loader
|
- vulkan-loader
|
||||||
- libva-utils # for vainfo
|
- libva-utils # for vainfo
|
||||||
- vdpauinfo # for vdpauinfo
|
- vdpauinfo # for vdpauinfo
|
||||||
- libvdpau-va-gl # vdpau support
|
- libvdpau-va-gl # vdpau support
|
||||||
# - igt-gpu-tools # for intel_gpu_top
|
- mesa-gallium-va # Accelerated video decoding
|
||||||
|
- mesa-gallium-vdpau # Accelerated video decoding
|
||||||
|
- radeontop
|
||||||
- vulkan-tools # For vulkaninfo
|
- vulkan-tools # For vulkaninfo
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# - name: Configure vdpau to use va-api driver
|
- name: Install loader.conf
|
||||||
# copy:
|
copy:
|
||||||
# src: vdpau.sh
|
src: "files/{{ item }}_loader.conf"
|
||||||
# dest: /etc/profile.d/vdpau.sh
|
dest: "/boot/loader.conf.d/{{ item }}.conf"
|
||||||
# mode: 0644
|
mode: 0644
|
||||||
# owner: root
|
owner: root
|
||||||
# group: root
|
group: wheel
|
||||||
|
loop:
|
||||||
#- name: Install loader.conf
|
- amd_adaptive_backlight_management
|
||||||
# copy:
|
|
||||||
# src: "files/{{ item }}_loader.conf"
|
|
||||||
# dest: "/boot/loader.conf.d/{{ item }}.conf"
|
|
||||||
# mode: 0644
|
|
||||||
# owner: root
|
|
||||||
# group: wheel
|
|
||||||
# loop:
|
|
||||||
# - intel_power
|
|
||||||
# - intel_hw_accel_video
|
|
||||||
|
|
||||||
- name: Install service configuration
|
- name: Install service configuration
|
||||||
copy:
|
copy:
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
- libva-utils # for vainfo
|
- libva-utils # for vainfo
|
||||||
- vdpauinfo # for vdpauinfo
|
- vdpauinfo # for vdpauinfo
|
||||||
- libvdpau-va-gl # vdpau support
|
- libvdpau-va-gl # vdpau support
|
||||||
- igt-gpu-tools # for intel_gpu_top
|
|
||||||
- vulkan-tools # For vulkaninfo
|
- vulkan-tools # For vulkaninfo
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
|||||||
@@ -17,4 +17,5 @@
|
|||||||
- vdpauinfo # for vdpauinfo
|
- vdpauinfo # for vdpauinfo
|
||||||
- vulkan-tools # For vulkaninfo
|
- vulkan-tools # For vulkaninfo
|
||||||
- radeontop
|
- radeontop
|
||||||
|
- nvtop
|
||||||
state: present
|
state: present
|
||||||
|
|||||||
4
ansible/roles/jail/files/fstab_bastion
Normal file
4
ansible/roles/jail/files/fstab_bastion
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
tmpfs /jail/bastion/tmp tmpfs rw,mode=777 0 0
|
||||||
|
tmpfs /jail/bastion/var/run tmpfs rw,mode=755 0 0
|
||||||
|
|
||||||
|
/jail/certificate/usr/local/etc/letsencrypt /jail/bastion/letsencrypt nullfs ro,noexec 0 0
|
||||||
@@ -23,11 +23,15 @@ function start_jail {
|
|||||||
jail_interface_name=$(sanitize_interface_name "$2")
|
jail_interface_name=$(sanitize_interface_name "$2")
|
||||||
ip_range="$3"
|
ip_range="$3"
|
||||||
|
|
||||||
|
local mac_address
|
||||||
|
mac_address=$(calculate_mac_address "$jail_interface_name")
|
||||||
|
|
||||||
assert_bridge "$host_interface_name" "$bridge_name" "$ip_range"
|
assert_bridge "$host_interface_name" "$bridge_name" "$ip_range"
|
||||||
|
|
||||||
bridge_link_name=$(detect_available_link "${bridge_name}")
|
bridge_link_name=$(detect_available_link "${bridge_name}")
|
||||||
ngctl -d -f - <<EOF
|
ngctl -d -f - <<EOF
|
||||||
mkpeer ${bridge_name}: eiface $bridge_link_name ether
|
mkpeer ${bridge_name}: eiface $bridge_link_name ether
|
||||||
|
msg ${bridge_name}:$bridge_link_name set $mac_address
|
||||||
name ${bridge_name}:$bridge_link_name $jail_interface_name
|
name ${bridge_name}:$bridge_link_name $jail_interface_name
|
||||||
EOF
|
EOF
|
||||||
ifconfig $(ngctl msg "${jail_interface_name}:" getifname | grep Args | cut -d '"' -f 2) name "${jail_interface_name}" up
|
ifconfig $(ngctl msg "${jail_interface_name}:" getifname | grep Args | cut -d '"' -f 2) name "${jail_interface_name}" up
|
||||||
@@ -121,4 +125,11 @@ function sanitize_interface_name {
|
|||||||
echo "${1:0:15}"
|
echo "${1:0:15}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function calculate_mac_address {
|
||||||
|
local name="$1"
|
||||||
|
local source
|
||||||
|
source=$(md5 -r -s "$name" | awk '{print $1}')
|
||||||
|
echo "06:${source:0:2}:${source:2:2}:${source:4:2}:${source:6:2}:${source:8:2}"
|
||||||
|
}
|
||||||
|
|
||||||
main "${@}"
|
main "${@}"
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
admin_git {
|
admin_git {
|
||||||
path = "/jail/main/jails/${name}";
|
path = "/jail/${name}";
|
||||||
vnet;
|
vnet;
|
||||||
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
|
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
|
||||||
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
|
exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
|
||||||
vnet.interface += "jail${name}";
|
vnet.interface += "jail${name}";
|
||||||
|
|
||||||
devfs_ruleset = 14;
|
devfs_ruleset = 14;
|
||||||
mount.devfs;
|
mount.devfs;
|
||||||
|
mount.fstab = "/etc/fstab.${name}";
|
||||||
|
|
||||||
exec.start += "/bin/sh /etc/rc";
|
exec.start += "/bin/sh /etc/rc";
|
||||||
exec.stop = "/bin/sh /etc/rc.shutdown jail";
|
exec.stop = "/bin/sh /etc/rc.shutdown jail";
|
||||||
|
|||||||
15
ansible/roles/jail/files/jails/bastion.conf
Normal file
15
ansible/roles/jail/files/jails/bastion.conf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
bastion {
|
||||||
|
path = "/jail/${name}";
|
||||||
|
vnet;
|
||||||
|
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
|
||||||
|
exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
|
||||||
|
vnet.interface += "jail${name}";
|
||||||
|
|
||||||
|
devfs_ruleset = 14;
|
||||||
|
mount.devfs;
|
||||||
|
mount.fstab = "/etc/fstab.${name}";
|
||||||
|
|
||||||
|
exec.start += "/bin/sh /etc/rc";
|
||||||
|
exec.stop = "/bin/sh /etc/rc.shutdown jail";
|
||||||
|
exec.consolelog = "/var/log/jail_${name}_console.log";
|
||||||
|
}
|
||||||
15
ansible/roles/jail/files/jails/certificate.conf
Normal file
15
ansible/roles/jail/files/jails/certificate.conf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
certificate {
|
||||||
|
path = "/jail/${name}";
|
||||||
|
vnet;
|
||||||
|
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start jail_nat jail${name} 10.215.1.1/24";
|
||||||
|
exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop jail_nat jail${name}";
|
||||||
|
vnet.interface += "jail${name}";
|
||||||
|
|
||||||
|
devfs_ruleset = 14;
|
||||||
|
mount.devfs;
|
||||||
|
mount.fstab = "/etc/fstab.${name}";
|
||||||
|
|
||||||
|
exec.start += "/bin/sh /etc/rc";
|
||||||
|
exec.stop = "/bin/sh /etc/rc.shutdown jail";
|
||||||
|
exec.consolelog = "/var/log/jail_${name}_console.log";
|
||||||
|
}
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
cloak {
|
cloak {
|
||||||
path = "/jail/main/jails/${name}";
|
path = "/jail/${name}";
|
||||||
vnet;
|
vnet;
|
||||||
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start restricted_nat jail${name} 10.215.2.1/24";
|
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start restricted_nat jail${name} 10.215.2.1/24";
|
||||||
exec.poststop += "/usr/local/bin/jail_netgraph_bridge stop restricted_nat jail${name}";
|
# Create a dummy interface that is never used, just to create the cloak bridge that is used by children.
|
||||||
|
exec.prestart += "/usr/local/bin/jail_netgraph_bridge start cloak dummy${name} 192.168.1.0/24";
|
||||||
|
exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop cloak dummy{name}";
|
||||||
|
exec.poststop += "sleep 10; /usr/local/bin/jail_netgraph_bridge stop restricted_nat jail${name}";
|
||||||
vnet.interface += "jail${name}";
|
vnet.interface += "jail${name}";
|
||||||
vnet.interface += "cloak";
|
vnet.interface += "cloak";
|
||||||
|
|
||||||
devfs_ruleset = 13;
|
devfs_ruleset = 13;
|
||||||
mount.devfs; # To expose tun device
|
mount.devfs; # To expose tun device
|
||||||
|
mount.fstab = "/etc/fstab.${name}";
|
||||||
|
|
||||||
exec.start += "/bin/sh /etc/rc";
|
exec.start += "/bin/sh /etc/rc";
|
||||||
exec.stop = "/bin/sh /etc/rc.shutdown jail";
|
exec.stop = "/bin/sh /etc/rc.shutdown jail";
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user