Compare commits
736
Commits
main
...
36b8305f0f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36b8305f0f | ||
|
|
a823d4ae63 | ||
|
|
8311427506 | ||
|
|
797744d9fe | ||
|
|
4ae411584e | ||
|
|
2dccea21ae | ||
|
|
32916ad470 | ||
|
|
8b4329d129 | ||
|
|
ec60e9f5f7 | ||
|
|
edffe124fd | ||
|
|
1de11bc2d9 | ||
|
|
44a0463ab8 | ||
|
|
9a1004dfb9 | ||
|
|
607129e1c2 | ||
|
|
48c6f54903 | ||
|
|
1278c5020f | ||
|
|
11cac42df8 | ||
|
|
feb1985755 | ||
|
|
99965a1df2 | ||
|
|
4de2772ad0 | ||
|
|
3e1291d1f9 | ||
|
|
bcdb47ac74 | ||
|
|
1764705562 | ||
|
|
c8bd5ee1e4 | ||
|
|
36a80041f3 | ||
|
|
41d01c70f5 | ||
|
|
9f82c136e9 | ||
|
|
89fdb52fcc | ||
|
|
98c6d47d7f | ||
|
|
8a2a723d4b | ||
|
|
1e8aa6956f | ||
|
|
caf60d1ccd | ||
|
|
f17b6a96b2 | ||
|
|
c8f32b917f | ||
|
|
e5891a72c6 | ||
|
|
b1ebe20874 | ||
|
|
1746d7f11a | ||
|
|
90ecb842d3 | ||
|
|
be53012c48 | ||
|
|
c709930bf0 | ||
|
|
7e0df2ee13 | ||
|
|
6a446a8383 | ||
|
|
bedfbe566d | ||
|
|
629f7c424d | ||
|
|
0a0b85e66d | ||
|
|
2706011fa0 | ||
|
|
669095e7cb | ||
|
|
13f20a4e98 | ||
|
|
cab2013a97 | ||
|
|
8ed0aca797 | ||
|
|
79d6f53424 | ||
|
|
79a8c32584 | ||
|
|
0f4fe291b2 | ||
|
|
490df1e24c | ||
|
|
b26ead5577 | ||
|
|
bcf2a5aee6 | ||
|
|
98b9691e1e | ||
|
|
62306f886e | ||
|
|
03d0978a64 | ||
|
|
f3632fa13a | ||
|
|
f828e0a9f2 | ||
|
|
852b904dd4 | ||
|
|
b7738a1b78 | ||
|
|
13801d9d86 | ||
|
|
0dc7f258a3 | ||
|
|
d20b1b8114 | ||
|
|
f070896ad3 | ||
|
|
822140efe6 | ||
|
|
231aa8a9a2 | ||
|
|
5e3d162481 | ||
|
|
eab790c2cc | ||
|
|
3c04476217 | ||
|
|
e762e1231a | ||
|
|
44ae9967f1 | ||
|
|
fe4f23fdb0 | ||
|
|
c213397550 | ||
|
|
951959a00b | ||
|
|
9d7a6414b3 | ||
|
|
18b73f7665 | ||
|
|
cccd7238cd | ||
|
|
43eff5399c | ||
|
|
65090d32e8 | ||
|
|
fb692f3766 | ||
|
|
6ae099fcb1 | ||
|
|
80f5f100f1 | ||
|
|
7e2dd72fc1 | ||
|
|
b3a11dec30 | ||
|
|
e8cece4445 | ||
|
|
0e10bc235f | ||
|
|
883ad223c2 | ||
|
|
9dee72820b | ||
|
|
a3ba5e7a60 | ||
|
|
d27d759c97 | ||
|
|
fe46062be0 | ||
|
|
a0eae9a7cc | ||
|
|
df0df85d9e | ||
|
|
5541c8251c | ||
|
|
6fc8181272 | ||
|
|
487f1f46f3 | ||
|
|
0776e89d26 | ||
|
|
ccd8355946 | ||
|
|
942780e6d1 | ||
|
|
019066c4dc | ||
|
|
1f16053042 | ||
|
|
bafa669bb5 | ||
|
|
5595ea0888 | ||
|
|
3aee0feb39 | ||
|
|
5d352bbb53 | ||
|
|
6c46439eb6 | ||
|
|
648501b7c0 | ||
|
|
e0288ce4d5 | ||
|
|
c6cc631d8c | ||
|
|
3381eb6d70 | ||
|
|
53351fde28 | ||
|
|
7922225b26 | ||
|
|
d27976150c | ||
|
|
8b73c7ef02 | ||
|
|
69b1e62c82 | ||
|
|
8970b14e31 | ||
|
|
861546236f | ||
|
|
f7389bc944 | ||
|
|
c85d96f940 | ||
|
|
4ab93d02f4 | ||
|
|
0feb9b1995 | ||
|
|
e95054d329 | ||
|
|
993eeda08b | ||
|
|
5655fe52b0 | ||
|
|
daec9237f0 | ||
|
|
a866a6d2e5 | ||
|
|
43d92d14ed | ||
|
|
0450aa45c3 | ||
|
|
196c879c27 | ||
|
|
9aae4dc2ca | ||
|
|
6735e257b3 | ||
|
|
4ce0720a43 | ||
|
|
c59d78270b | ||
|
|
0c422687a5 | ||
|
|
d0f7127807 | ||
|
|
c7432d554f | ||
|
|
bd181de2c9 | ||
|
|
e95c87dddf | ||
|
|
0b88905e91 | ||
|
|
e3d6a759a8 | ||
|
|
b5c7bed4e9 | ||
|
|
29e989fae9 | ||
|
|
f6dfa4f81f | ||
|
|
9e6e162b03 | ||
|
|
816ef4ddc6 | ||
|
|
731a367e6f | ||
|
|
76702e6433 | ||
|
|
ee97598070 | ||
|
|
74b42f3d63 | ||
|
|
0c86a76968 | ||
|
|
f29fad4078 | ||
|
|
a9080a6d12 | ||
|
|
22252b8880 | ||
|
|
3c8617aab2 | ||
|
|
f29b28e838 | ||
|
|
9860f56bf7 | ||
|
|
10821d2317 | ||
|
|
d7c321adea | ||
|
|
77d2ae62a3 | ||
|
|
a511fdac35 | ||
|
|
934bec45b5 | ||
|
|
0660dd55d4 | ||
|
|
57707ff56e | ||
|
|
fe6f41d1e8 | ||
|
|
b60c4c4170 | ||
|
|
8099c34791 | ||
|
|
a319e29f93 | ||
|
|
80a809545c | ||
|
|
4cd86fc47f | ||
|
|
bef91a4ba1 | ||
|
|
ce34f879d6 | ||
|
|
2c6921688f | ||
|
|
e7d307a306 | ||
|
|
227a91e2f3 | ||
|
|
2fc13b59e6 | ||
|
|
7dd0f80590 | ||
|
|
af8182626a | ||
|
|
50d51b7264 | ||
|
|
6fa3a42362 | ||
|
|
393ff77eaf | ||
|
|
562c2e4416 | ||
|
|
fecefb6a6e | ||
|
|
704955248b | ||
|
|
5899f93a0a | ||
|
|
0e4c6d5faa | ||
|
|
15b8fc95ff | ||
|
|
4307856790 | ||
|
|
acfe37f0c0 | ||
|
|
8db3616687 | ||
|
|
5be5c34fd6 | ||
|
|
bddb4d14b4 | ||
|
|
c0fb178193 | ||
|
|
8a5c2f4b8a | ||
|
|
79887c227b | ||
|
|
44b1bfd43a | ||
|
|
1d7374e3ad | ||
|
|
ddfa5d5d81 | ||
|
|
7f9d59213f | ||
|
|
9cf77d2ab8 | ||
|
|
d36585f21d | ||
|
|
742de9b6b4 | ||
|
|
edaeec1ff2 | ||
|
|
2cf83a2fcf | ||
|
|
d6dbe38e17 | ||
|
|
813a96c469 | ||
|
|
fbe5f54b7f | ||
|
|
b1d70789e7 | ||
|
|
39b949517a | ||
|
|
58f8636969 | ||
|
|
827db06b38 | ||
|
|
08b60b62b6 | ||
|
|
48bf1d542f | ||
|
|
50e99bde43 | ||
|
|
31d9600253 | ||
|
|
1f47d2b50d | ||
|
|
e3bdcc595a | ||
|
|
77ca6380f4 | ||
|
|
f08f0e630a | ||
|
|
b306064061 | ||
|
|
ab09a74bf2 | ||
|
|
45e1331ce8 | ||
|
|
4fa346bd8b | ||
|
|
547112c4a1 | ||
|
|
688ee6cb1c | ||
|
|
1845c8da63 | ||
|
|
1374648d0c | ||
|
|
a06b5680c0 | ||
|
|
425abcff73 | ||
|
|
502cec92f3 | ||
|
|
18a875e842 | ||
|
|
d272730ced | ||
|
|
6178c56838 | ||
|
|
e38d86015f | ||
|
|
463a5fc4af | ||
|
|
a266189b38 | ||
|
|
eddc73850f | ||
|
|
8297204c9c | ||
|
|
d4b3c57cc9 | ||
|
|
50b67ed0cc | ||
|
|
4cb5e89fe9 | ||
|
|
ba98477576 | ||
|
|
d01227fcde | ||
|
|
2ea65fda25 | ||
|
|
d36eac4ceb | ||
|
|
1d750e4e30 | ||
|
|
4c0aef9bca | ||
|
|
bd3a0d33e0 | ||
|
|
e75d293787 | ||
|
|
eedcebe11e | ||
|
|
3085ae8569 | ||
|
|
ad5c4b2d0e | ||
|
|
d77674a283 | ||
|
|
3290afc7b7 | ||
|
|
29a08af257 | ||
|
|
c6f7a2526b | ||
|
|
c81726ab2c | ||
|
|
d5c91d4fff | ||
|
|
1966e44734 | ||
|
|
713ae2dc49 | ||
|
|
3e5837bde2 | ||
|
|
d40c178985 | ||
|
|
00d0a5297f | ||
|
|
d01a6e5432 | ||
|
|
1f048876d0 | ||
|
|
386eb58767 | ||
|
|
864853f5dc | ||
|
|
a822b095ee | ||
|
|
ff548cc7a2 | ||
|
|
f808eb7ecb | ||
|
|
9beecf1a49 | ||
|
|
0a820394bb | ||
|
|
198a731f9e | ||
|
|
2917e32498 | ||
|
|
b7ed58bac1 | ||
|
|
d797b8a295 | ||
|
|
510af86d25 | ||
|
|
060b1ac771 | ||
|
|
9f203d5112 | ||
|
|
53920832cd | ||
|
|
b522d18100 | ||
|
|
f3bc150953 | ||
|
|
89b7c6d5de | ||
|
|
97d2e38e2c | ||
|
|
f97c2708fa | ||
|
|
3d1b0791b3 | ||
|
|
f7a260c722 | ||
|
|
65d0c3c45e | ||
|
|
e094ec7143 | ||
|
|
772c2906dd | ||
|
|
eb54844618 | ||
|
|
f8226c07c3 | ||
|
|
ee461bee2d | ||
|
|
f5d65ba192 | ||
|
|
5e7279e497 | ||
|
|
ba5a142339 | ||
|
|
e11c6e1e64 | ||
|
|
7ad7edc82c | ||
|
|
63e7e97076 | ||
|
|
19821939e2 | ||
|
|
07c2f352f1 | ||
|
|
1c8c237bac | ||
|
|
c6875551b2 | ||
|
|
3d61a7619c | ||
|
|
2d6bba789c | ||
|
|
5be56dd7f8 | ||
|
|
7fe9f650a6 | ||
|
|
6285f02214 | ||
|
|
1c20173b8b | ||
|
|
2dbfffafd0 | ||
|
|
3aa1819440 | ||
|
|
68f7c91cdc | ||
|
|
1e3f1e82cf | ||
|
|
adab73ff82 | ||
|
|
8daf385422 | ||
|
|
8ead4b4e6d | ||
|
|
5b6f1a5b64 | ||
|
|
e9d6a41c7f | ||
|
|
081818451b | ||
|
|
f48555f859 | ||
|
|
de6e2d711d | ||
|
|
5080dd9112 | ||
|
|
5e863999e5 | ||
|
|
ceaa6c77af | ||
|
|
2a5ee62a5e | ||
|
|
21e1ee1708 | ||
|
|
fc49d68d01 | ||
|
|
f19bc454e4 | ||
|
|
83e77e421d | ||
|
|
77ecb21d00 | ||
|
|
3708528c44 | ||
|
|
079ccb77b5 | ||
|
|
dbd588fc27 | ||
|
|
baa841c8cf | ||
|
|
a66384a2d7 | ||
|
|
ca24d37e34 | ||
|
|
8b3c4fd36c | ||
|
|
e02c188a18 | ||
|
|
ebc8c5c690 | ||
|
|
5231fedcdc | ||
|
|
5770998ef5 | ||
|
|
e90cc22255 | ||
|
|
b8e46a05f1 | ||
|
|
49f363b80c | ||
|
|
cc9350347a | ||
|
|
5153d68230 | ||
|
|
baab102be8 | ||
|
|
197bbc2b03 | ||
|
|
433e354638 | ||
|
|
7bcd537855 | ||
|
|
6614dd386c | ||
|
|
6820591482 | ||
|
|
0f88b83790 | ||
|
|
645e2b02cb | ||
|
|
31c2615c69 | ||
|
|
c36dd8756c | ||
|
|
74a65af640 | ||
|
|
c4964a1a1e | ||
|
|
f59a4f90ba | ||
|
|
df622a175b | ||
|
|
7f6110a3f9 | ||
|
|
3965f0a587 | ||
|
|
9bd7cb59b5 | ||
|
|
83104fac25 | ||
|
|
36f8aa3649 | ||
|
|
d2b8cac45d | ||
|
|
7764260639 | ||
|
|
154bb01c0e | ||
|
|
bb9ac37d9c | ||
|
|
4d1c461fcf | ||
|
|
f1a7025e07 | ||
|
|
d5ef919e6d | ||
|
|
8ec82bd3f1 | ||
|
|
b0620734b6 | ||
|
|
d58d830206 | ||
|
|
5f50b3d1d7 | ||
|
|
ab2d39c700 | ||
|
|
eb06cf62c5 | ||
|
|
0b59b1c401 | ||
|
|
4a21321318 | ||
|
|
8db5389c6d | ||
|
|
cdf11a8dc1 | ||
|
|
c95ae2512e | ||
|
|
8591ad23ff | ||
|
|
51c649798e | ||
|
|
2e2c81fe9d | ||
|
|
0bffef28a8 | ||
|
|
a7f1ad232b | ||
|
|
b83812f1b9 | ||
|
|
f415100314 | ||
|
|
10a6c6c0ff | ||
|
|
3c97226143 | ||
|
|
e167a3018e | ||
|
|
df449282e4 | ||
|
|
0f346af760 | ||
|
|
674b3a4d03 | ||
|
|
3997f9e79f | ||
|
|
3a905a5608 | ||
|
|
eb239616e7 | ||
|
|
59fa66a3b1 | ||
|
|
8199ee0eeb | ||
|
|
88ed007218 | ||
|
|
d9a6007af3 | ||
|
|
ee3339bb99 | ||
|
|
3ae1b49348 | ||
|
|
098a4b054b | ||
|
|
1510a681b1 | ||
|
|
9cc0715362 | ||
|
|
abde0204f4 | ||
|
|
8911aeaed7 | ||
|
|
9557b7d99e | ||
|
|
f090bcc727 | ||
|
|
3fc7423f3c | ||
|
|
70f1a1443e | ||
|
|
418fa5dc47 | ||
|
|
fe10d1661f | ||
|
|
fa3bb09637 | ||
|
|
f64ed9ebda | ||
|
|
66987a59ce | ||
|
|
38f9c82137 | ||
|
|
6022bf4499 | ||
|
|
20db768906 | ||
|
|
bc01040ce6 | ||
|
|
86a04aba75 | ||
|
|
b44611928a | ||
|
|
b9452b98aa | ||
|
|
7bff244be0 | ||
|
|
2533f80f40 | ||
|
|
451bf41b50 | ||
|
|
0a90c5cca1 | ||
|
|
9555012353 | ||
|
|
3e048e5159 | ||
|
|
355d8c819a | ||
|
|
cf5439cf73 | ||
|
|
aac6eb6374 | ||
|
|
7a2ccfa229 | ||
|
|
85afd25697 | ||
|
|
e526bd09e8 | ||
|
|
2541652153 | ||
|
|
afec44e8cb | ||
|
|
b4be986c0d | ||
|
|
4b394c4923 | ||
|
|
c481b74b5d | ||
|
|
60e685529d | ||
|
|
3035840bb2 | ||
|
|
2eeccd5cf5 | ||
|
|
5776308513 | ||
|
|
8f1cd20374 | ||
|
|
aff14c7fae | ||
|
|
1aa64f3c13 | ||
|
|
7663185265 | ||
|
|
a6f4b06677 | ||
|
|
8e46cb16a5 | ||
|
|
785db7e893 | ||
|
|
94431dff43 | ||
|
|
dcf4b3d451 | ||
|
|
58f5f13b28 | ||
|
|
fe022d7a9c | ||
|
|
0ef5e0cc6a | ||
|
|
ccabad9c30 | ||
|
|
f83fe61296 | ||
|
|
da9c34a9da | ||
|
|
8c3c3fb381 | ||
|
|
d617334a54 | ||
|
|
52c6dba409 | ||
|
|
21d69f230b | ||
|
|
3a815d319c | ||
|
|
94b6db2000 | ||
|
|
564485145e | ||
|
|
814451fa44 | ||
|
|
bd9460c8bb | ||
|
|
55a531f1b4 | ||
|
|
c2f910aabc | ||
|
|
ccfa27fcaf | ||
|
|
3c6c7de5e1 | ||
|
|
24c5a2973f | ||
|
|
262cfa002e | ||
|
|
4fe8daf347 | ||
|
|
ea589d09b2 | ||
|
|
dd0412d821 | ||
|
|
14a0d21633 | ||
|
|
0d42c2419c | ||
|
|
ccd87b92bb | ||
|
|
82e32c0f95 | ||
|
|
73dfdce734 | ||
|
|
bf57faaac5 | ||
|
|
9406d4aca2 | ||
|
|
4cf848d4a9 | ||
|
|
09f6a1e96b | ||
|
|
2d5fa52294 | ||
|
|
d54131a1b2 | ||
|
|
8a79822ae5 | ||
|
|
c66938f738 | ||
|
|
be849d9c70 | ||
|
|
b69be78382 | ||
|
|
845b042d21 | ||
|
|
42b88fb8bd | ||
|
|
e98ad94a90 | ||
|
|
dfb72122a0 | ||
|
|
671d21b9d3 | ||
|
|
edec84400e | ||
|
|
b4eeff4386 | ||
|
|
331cf32737 | ||
|
|
9fb39f8503 | ||
|
|
b1cc1473db | ||
|
|
d0580925ac | ||
|
|
5732c36d1d | ||
|
|
29435e43e2 | ||
|
|
b051bce767 | ||
|
|
fa732599fe | ||
|
|
bed26990bd | ||
|
|
bcfc716b46 | ||
|
|
33a645fea0 | ||
|
|
8e0cc7fa45 | ||
|
|
13459f8f4b | ||
|
|
5155952dc7 | ||
|
|
19970515ca | ||
|
|
1aaf64404f | ||
|
|
65a0d8b670 | ||
|
|
b6b0e620cf | ||
|
|
a10480c692 | ||
|
|
00218a447f | ||
|
|
b9d0e31631 | ||
|
|
5435da309a | ||
|
|
5ebfa7e8bb | ||
|
|
712b0b8ffe | ||
|
|
99cf761528 | ||
|
|
dbb9528f26 | ||
|
|
0122f086b2 | ||
|
|
0b878674d3 | ||
|
|
6e86149f59 | ||
|
|
a2ec622582 | ||
|
|
ab478153ec | ||
|
|
caa7bd9285 | ||
|
|
19ce3dde3b | ||
|
|
1bd66a0df9 | ||
|
|
73a6ea092b | ||
|
|
85c2a4d4b1 | ||
|
|
063928ebb8 | ||
|
|
1679eb2522 | ||
|
|
65cf20f932 | ||
|
|
a1935588a4 | ||
|
|
44060a6d1d | ||
|
|
f756182d12 | ||
|
|
b41a381385 | ||
|
|
faddea7492 | ||
|
|
a85cbf277f | ||
|
|
15a79578e6 | ||
|
|
57e8824d16 | ||
|
|
f46b0bad96 | ||
|
|
f76b635e40 | ||
|
|
0fc27e94b0 | ||
|
|
08fbce5f44 | ||
|
|
1ea368184d | ||
|
|
5710f284ba | ||
|
|
b4e8bf6f15 | ||
|
|
e0395dda04 | ||
|
|
625f4c899f | ||
|
|
f324589c65 | ||
|
|
3fe18ef9dc | ||
|
|
57f5473c2f | ||
|
|
e517a8c3e8 | ||
|
|
751cbbc055 | ||
|
|
5175b7ff0c | ||
|
|
6d0b0f52f5 | ||
|
|
203d8a1ef4 | ||
|
|
c9370553fb | ||
|
|
e3e9418a12 | ||
|
|
398541fa54 | ||
|
|
e031be406e | ||
|
|
4c0639e862 | ||
|
|
07047f140e | ||
|
|
1493d76352 | ||
|
|
b0a7a03542 | ||
|
|
b8b7ca1851 | ||
|
|
184ec96395 | ||
|
|
4adc2d2e7e | ||
|
|
fb4386b418 | ||
|
|
ed2b678228 | ||
|
|
4ce049b3ea | ||
|
|
d48f6d1572 | ||
|
|
a0582c7483 | ||
|
|
1917b087c9 | ||
|
|
c2b32c6d3e | ||
|
|
aa0522ee67 | ||
|
|
04d9498c72 | ||
|
|
481f8fa5d1 | ||
|
|
a2edee0857 | ||
|
|
a9352773a7 | ||
|
|
3b1502f6c1 | ||
|
|
4dba89dba2 | ||
|
|
69bf1c25fb | ||
|
|
bf4b6951ac | ||
|
|
de29d33042 | ||
|
|
2de2fb1966 | ||
|
|
99966ea0c4 | ||
|
|
90d4a22431 | ||
|
|
28829018cd | ||
|
|
62b59f4e8a | ||
|
|
9010a7dc7c | ||
|
|
e8eb5c68a7 | ||
|
|
0887a3bdf0 | ||
|
|
3861f2fad4 | ||
|
|
d8d5f001f2 | ||
|
|
91996885e9 | ||
|
|
a8d0e2c7bb | ||
|
|
ae20dec6f1 | ||
|
|
88717f745b | ||
|
|
1972cd4b9e | ||
|
|
fbc8e62872 | ||
|
|
dac6240b92 | ||
|
|
3faa49c290 | ||
|
|
d2356a5780 | ||
|
|
862b36d537 | ||
|
|
e3f2d42017 | ||
|
|
2b40012443 | ||
|
|
70114784a5 | ||
|
|
3823aa438a | ||
|
|
2f3109d113 | ||
|
|
7e891fac9d | ||
|
|
a94b8cdd72 | ||
|
|
b1ae3a7587 | ||
|
|
4f20bdfa1b | ||
|
|
c43e589235 | ||
|
|
f3a3ac63ea | ||
|
|
4f31769802 | ||
|
|
ab5a35a133 | ||
|
|
faeef04ca4 | ||
|
|
87f5c39a9a | ||
|
|
bd29c74d21 | ||
|
|
eb70ee7a34 | ||
|
|
816ff990b3 | ||
|
|
cda28a2c4e | ||
|
|
1ff0e3624f | ||
|
|
f70ebba7e7 | ||
|
|
ca482245cc | ||
|
|
e4d66c9d33 | ||
|
|
98cc0c08df | ||
|
|
27d66493e4 | ||
|
|
6056038b75 | ||
|
|
728c68443f | ||
|
|
ddd5693145 | ||
|
|
d6295f8ffe | ||
|
|
014b9ef105 | ||
|
|
c8973bf074 | ||
|
|
9cc6be2325 | ||
|
|
f6d9521865 | ||
|
|
3a53fbb0c6 | ||
|
|
8d74bee2ff | ||
|
|
4b359afdd0 | ||
|
|
465ba8e053 | ||
|
|
edb1db9a9a | ||
|
|
cc22d3e9bd | ||
|
|
3376d6fef1 | ||
|
|
654e944da4 | ||
|
|
5cf45dfeaf | ||
|
|
1bbb64f38e | ||
|
|
64a9fc4de1 | ||
|
|
2d95d3be8f | ||
|
|
3c9c23736e | ||
|
|
94ef15e9c7 | ||
|
|
f2ee698fee | ||
|
|
d5aa46dcfd | ||
|
|
c62b6f3b59 | ||
|
|
2813734dda | ||
|
|
942bc475e0 | ||
|
|
28be7abaf1 | ||
|
|
4f96f32c1c | ||
|
|
248f352e16 | ||
|
|
163a649dc7 | ||
|
|
c30490aa1d | ||
|
|
c11d9ec25e | ||
|
|
c3fb8f360f | ||
|
|
ed2535b802 | ||
|
|
fb140bea72 | ||
|
|
33ef2544dc | ||
|
|
4b8f122376 | ||
|
|
df6dc122f2 | ||
|
|
b765c5cdae | ||
|
|
3629d24b1b | ||
|
|
9339b24808 | ||
|
|
5e8d188871 | ||
|
|
4fd3e43e0d | ||
|
|
d8bc4a66cf | ||
|
|
30f9aff49e | ||
|
|
190b3d921b | ||
|
|
11632e72d7 | ||
|
|
fa0ea0098e | ||
|
|
579764ca76 | ||
|
|
51b3161124 | ||
|
|
18a1defd65 | ||
|
|
f7ac9cc7e7 | ||
|
|
c40019a72d | ||
|
|
2d1f720578 | ||
|
|
119b8aa669 | ||
|
|
2b7447ba26 | ||
|
|
e0bb2b3c66 | ||
|
|
e70fdaabd5 | ||
|
|
4522811da1 | ||
|
|
ec22eacbdb | ||
|
|
4031be218c | ||
|
|
e280bd7a49 | ||
|
|
2954ce5af9 | ||
|
|
cd7a290d61 | ||
|
|
89982bae39 | ||
|
|
9327ed23ac | ||
|
|
79a2c832b4 | ||
|
|
6a36811590 | ||
|
|
2e0dd78f68 | ||
|
|
861a9c6257 | ||
|
|
210e409428 | ||
|
|
44039bbd1b | ||
|
|
a1bbcdc804 | ||
|
|
22a74506fd | ||
|
|
5d7318ec32 | ||
|
|
cf676808c9 | ||
|
|
66ca4dcb98 | ||
|
|
ea1716957b | ||
|
|
2e560c9f2b | ||
|
|
c21d7415f5 | ||
|
|
e3c61c5bcd | ||
|
|
af3c665a43 | ||
|
|
8b52914683 | ||
|
|
b3e9f7584f | ||
|
|
1a2572870f | ||
|
|
d32c913a40 | ||
|
|
b8fa688e52 | ||
|
|
ea3ce8d023 | ||
|
|
dd7325da39 | ||
|
|
195c315714 | ||
|
|
b91b43b56d | ||
|
|
a64f2253b6 | ||
|
|
7f21a0fc7b | ||
|
|
87aca38811 |
No files matched your search
@@ -0,0 +1,23 @@
|
|||||||
|
# .ansible-lint
|
||||||
|
---
|
||||||
|
skip_list:
|
||||||
|
- command-instead-of-shell
|
||||||
|
- key-order[task]
|
||||||
|
- yaml[line-length]
|
||||||
|
- yaml[colons]
|
||||||
|
- jinja[spacing]
|
||||||
|
- name[missing]
|
||||||
|
- yaml[comments]
|
||||||
|
- yaml[commas]
|
||||||
|
- var-naming[pattern]
|
||||||
|
- yaml[braces]
|
||||||
|
|
||||||
|
warn_list:
|
||||||
|
- literal-compare
|
||||||
|
- ignore-errors
|
||||||
|
- no-changed-when
|
||||||
|
- yaml[indentation]
|
||||||
|
- risky-file-permissions
|
||||||
|
- risky-shell-pipe
|
||||||
|
- fqcn[action-core]
|
||||||
|
- fqcn[action]
|
||||||
@@ -17,17 +17,27 @@ This information is as of 2025-11-21.
|
|||||||
|
|
||||||
### Primary
|
### Primary
|
||||||
|
|
||||||
These are the operating systems used as my daily driver.
|
These are the operating systems used as my dailies.
|
||||||
|
|
||||||
|
#### Artix (`runit`)
|
||||||
|
|
||||||
|
2026-08-04: Completed adapting playbooks and now using this as a daily driver.
|
||||||
|
|
||||||
|
2026-07-31: Began experimenting and adapting playbooks using VMs.
|
||||||
|
|
||||||
#### Debian Trixie
|
#### Debian Trixie
|
||||||
|
|
||||||
This has been used as my primary server and workstation OS since at least 2024.
|
This has been used as my primary server and workstation OS since at least 2024.
|
||||||
|
|
||||||
The `apt` version of `ansible` in both Bookworm and Trixie are sufficient,
|
The `apt` version of `ansible` in both Bookworm and Trixie are sufficient,
|
||||||
no longer need to use `ansible` out of `pip`.
|
no longer need to use `ansible` out of `pip`.
|
||||||
|
|
||||||
|
Stopped using as a workstation on all devices by August 2026, still using as a server.
|
||||||
|
|
||||||
### Secondary
|
### Secondary
|
||||||
|
|
||||||
These are tested via my Docker project's `ProvisionsTests` container but not currently used as daily drivers.
|
These are tested via my Docker project's `ProvisionsTests` containers
|
||||||
|
but not currently used as daily drivers. [TBD: Link]()
|
||||||
|
|
||||||
#### Arch
|
#### Arch
|
||||||
|
|
||||||
@@ -54,6 +64,14 @@ TBD
|
|||||||
100%, but only if using a recent enough version of Ansible. `pip` usually has a
|
100%, but only if using a recent enough version of Ansible. `pip` usually has a
|
||||||
better version than `apt`.
|
better version than `apt`.
|
||||||
|
|
||||||
|
#### Devuan (`runit`)
|
||||||
|
|
||||||
|
2026-09-14: Abandoned, did not support virtualization on runit and felt slow / clunky to Artix.
|
||||||
|
|
||||||
|
2026-08-13: Distribution is nearly fully dunctional.
|
||||||
|
|
||||||
|
2026-07-30: Distribution has beed added with a few caveats:
|
||||||
|
|
||||||
#### Ubuntu
|
#### Ubuntu
|
||||||
|
|
||||||
100%, both server and desktop.
|
100%, both server and desktop.
|
||||||
@@ -88,14 +106,14 @@ terrible while updating. Ubuntu Rolling Rhino filled the gap.
|
|||||||
Workstation: 100%,
|
Workstation: 100%,
|
||||||
Server: 100%
|
Server: 100%
|
||||||
|
|
||||||
## Suse Family
|
### Suse Family
|
||||||
|
|
||||||
### openSUSE Tumbleweed v2022-02-17
|
#### openSUSE Tumbleweed v2022-02-17
|
||||||
|
|
||||||
Generic: 100%,
|
Generic: 100%,
|
||||||
Workstation: 100%
|
Workstation: 100%
|
||||||
|
|
||||||
### openSUSE Leap 15.4
|
#### openSUSE Leap 15.4
|
||||||
|
|
||||||
Generic: 100%
|
Generic: 100%
|
||||||
Workstation: Currently failing at `[Workstation | Linux | Flatpak Distro | Package Manager | Install From Repo]` with message `Problem: nothing provides libedataserver-1.2.so.24 needed by the to be installed evolution-data-server-32bit-3.34.4-3.3.1.x86_64`.
|
Workstation: Currently failing at `[Workstation | Linux | Flatpak Distro | Package Manager | Install From Repo]` with message `Problem: nothing provides libedataserver-1.2.so.24 needed by the to be installed evolution-data-server-32bit-3.34.4-3.3.1.x86_64`.
|
||||||
@@ -127,6 +145,8 @@ after update problems due to a long computer hiatus.
|
|||||||
|
|
||||||
Specifically for the Pinephone.
|
Specifically for the Pinephone.
|
||||||
|
|
||||||
|
## Unsupported
|
||||||
|
|
||||||
## Future Goals
|
## Future Goals
|
||||||
|
|
||||||
Eventually some of the scripts and install files will be put into the files
|
Eventually some of the scripts and install files will be put into the files
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
[defaults]
|
[defaults]
|
||||||
inventory=hosts
|
inventory=hosts
|
||||||
interpreter_python=auto_silent
|
interpreter_python=auto_silent
|
||||||
|
inject_facts_as_vars=True
|
||||||
|
|
||||||
[inventory]
|
[inventory]
|
||||||
localhost_warning=False
|
localhost_warning=False
|
||||||
|
|||||||
@@ -2,17 +2,16 @@
|
|||||||
# Facts that must be gathered after running tasks.
|
# Facts that must be gathered after running tasks.
|
||||||
|
|
||||||
- name: General | Facts | Gather | Locate bash
|
- name: General | Facts | Gather | Locate bash
|
||||||
shell: which bash
|
ansible.builtin.shell: which bash
|
||||||
register: bash_exec
|
register: bash_exec
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Facts | Gather | Locate ansible-pull
|
- name: General | Facts | Gather | Locate ansible-pull
|
||||||
shell: which ansible-pull
|
ansible.builtin.shell: which ansible-pull
|
||||||
register: ansible_pull_exec
|
register: ansible_pull_exec
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Facts | Gather | Locate zsh
|
- name: General | Facts | Gather | Locate zsh
|
||||||
shell: which zsh
|
ansible.builtin.shell: which zsh
|
||||||
register: zsh_exec
|
register: zsh_exec
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
+60
-38
@@ -3,23 +3,34 @@
|
|||||||
# This file is for ALL systems and should not include UI components.
|
# This file is for ALL systems and should not include UI components.
|
||||||
|
|
||||||
- name: General | Facts | Package | Shared Defaults
|
- name: General | Facts | Package | Shared Defaults
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
sshfs: sshfs
|
sshfs: sshfs
|
||||||
tar: tar
|
tar: tar
|
||||||
iftop: iftop
|
iftop: iftop
|
||||||
nethogs: nethogs
|
nethogs: nethogs
|
||||||
ntp_server: chrony
|
ntp_server: chrony
|
||||||
dig: dig
|
dig: dig
|
||||||
neofetch: neofetch
|
neofetch: fastfetch
|
||||||
|
lightdm: lightdm
|
||||||
|
sddm: sddm
|
||||||
|
tmux: tmux
|
||||||
|
base_devel: htop # Placeholder for Arch package.
|
||||||
|
sendmail: msmtp
|
||||||
|
sendmail_mta: msmtp-mta
|
||||||
|
ca_certificates: ca-certificates
|
||||||
|
locate: mlocate
|
||||||
|
alsa: alsa-utils
|
||||||
|
stress: stress
|
||||||
|
jq: jq
|
||||||
|
|
||||||
- name: General | Facts | Package | Parrot OS Fixes
|
- name: General | Facts | Package | Parrot OS Fixes
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ansible_pkg_mgr: "apt"
|
ansible_pkg_mgr: "apt"
|
||||||
ansible_python_interpreter: "/usr/bin/python3"
|
ansible_python_interpreter: "/usr/bin/python3"
|
||||||
when: ansible_distribution == "Parrot OS"
|
when: ansible_distribution == "Parrot OS"
|
||||||
|
|
||||||
- name: General | Facts | Package | apt
|
- name: General | Facts | Package | apt
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
locate: locate
|
locate: locate
|
||||||
opensshd: openssh-server
|
opensshd: openssh-server
|
||||||
microcode_amd: amd64-microcode
|
microcode_amd: amd64-microcode
|
||||||
@@ -29,23 +40,20 @@
|
|||||||
dig: dnsutils
|
dig: dnsutils
|
||||||
when: ansible_pkg_mgr == "apt"
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
- name: General | Facts | Package | apt | Debian Trixie
|
|
||||||
set_fact:
|
|
||||||
neofetch: fastfetch
|
|
||||||
when: ansible_pkg_mgr == "apt" and ansible_distribution_release == "trixie"
|
|
||||||
|
|
||||||
- name: General | Facts | Package | pacman
|
- name: General | Facts | Package | pacman
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
locate: mlocate
|
locate: mlocate
|
||||||
opensshd: openssh
|
opensshd: openssh
|
||||||
microcode_amd: linux-firmware
|
microcode_amd: linux-firmware
|
||||||
microcode_intel: intel-ucode
|
microcode_intel: intel-ucode
|
||||||
cron: cronie
|
cron: cronie
|
||||||
encfs: encfs
|
encfs: encfs
|
||||||
|
dig: bind
|
||||||
|
base_devel: base-devel
|
||||||
when: ansible_pkg_mgr == "pacman"
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
- name: General | Facts | Package | FreeBSD
|
- name: General | Facts | Package | FreeBSD
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
sshfs: fusefs-sshfs
|
sshfs: fusefs-sshfs
|
||||||
locate: htop # Placeholder to prevent errors, locate built into FreeBSD.
|
locate: htop # Placeholder to prevent errors, locate built into FreeBSD.
|
||||||
opensshd: htop # sshd comes installed on FreeBSD
|
opensshd: htop # sshd comes installed on FreeBSD
|
||||||
@@ -56,13 +64,13 @@
|
|||||||
encfs: fusefs-encfs
|
encfs: fusefs-encfs
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- name: General | Facts | Package | dnf (Fixes) # TBD: Fix + test package names: mlocate, dig, neofetch
|
- name: General | Facts | Package | dnf (Fixes)
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ansible_pkg_mgr: dnf
|
ansible_pkg_mgr: dnf
|
||||||
when: ansible_pkg_mgr in ("dnf5")
|
when: ansible_pkg_mgr in ("dnf5")
|
||||||
|
|
||||||
- name: General | Facts | Package | dnf
|
- name: General | Facts | Package | dnf
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
sshfs: fuse-sshfs
|
sshfs: fuse-sshfs
|
||||||
locate: plocate
|
locate: plocate
|
||||||
opensshd: openssh
|
opensshd: openssh
|
||||||
@@ -70,39 +78,37 @@
|
|||||||
microcode_intel: microcode_ctl
|
microcode_intel: microcode_ctl
|
||||||
cron: cronie
|
cron: cronie
|
||||||
encfs: fuse-encfs
|
encfs: fuse-encfs
|
||||||
|
dig: bind-utils
|
||||||
|
sendmail_mta: msmtp
|
||||||
when: ansible_pkg_mgr == "dnf"
|
when: ansible_pkg_mgr == "dnf"
|
||||||
|
|
||||||
- name: General | Facts | Package | zypper
|
- name: General | Facts | Package | zypper
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
locate: plocate
|
locate: plocate
|
||||||
opensshd: openssh
|
opensshd: openssh
|
||||||
microcode_amd: ucode-amd
|
microcode_amd: ucode-amd
|
||||||
microcode_intel: ucode-intel
|
microcode_intel: ucode-intel
|
||||||
cron: cronie
|
cron: cronie
|
||||||
encfs: encfs
|
encfs: encfs
|
||||||
|
dig: bind-utils
|
||||||
when: ansible_pkg_mgr == "zypper"
|
when: ansible_pkg_mgr == "zypper"
|
||||||
|
|
||||||
|
|
||||||
- name: General | Facts | Package | Update Command | Helpers
|
- name: General | Facts | Package | Update Command | Helpers
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
update_accept_var: '$accept'
|
update_accept_var: '$accept'
|
||||||
nix_days: 14
|
nix_days: 14
|
||||||
ansible_distribution_file: "{{ prov_dir }}/ansible_distribution.txt"
|
ansible_distribution_file: "{{ prov_dir }}/ansible_distribution.txt"
|
||||||
ansible_pkg_mgr_file: "{{ prov_dir }}/ansible_pkg_mgr.txt"
|
ansible_pkg_mgr_file: "{{ prov_dir }}/ansible_pkg_mgr.txt"
|
||||||
|
|
||||||
- name: General | Facts | Package | Update Command | Helpers | pacman
|
|
||||||
set_fact:
|
|
||||||
update_accept_var: '--noconfirm'
|
|
||||||
when: ansible_pkg_mgr == "pacman"
|
|
||||||
|
|
||||||
- name: General | Facts | Package | Update Command | Store Variables
|
- name: General | Facts | Package | Update Command | Store Variables
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "echo '{{ ansible_distribution }}' > {{ ansible_distribution_file }}"
|
- "echo '{{ ansible_distribution }}' > {{ ansible_distribution_file }}"
|
||||||
- "echo '{{ ansible_pkg_mgr }}' > {{ ansible_pkg_mgr_file }}"
|
- "echo '{{ ansible_pkg_mgr }}' > {{ ansible_pkg_mgr_file }}"
|
||||||
|
|
||||||
- name: General | Facts | Package | Update Command
|
- name: General | Facts | Package | Update Command
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
update_package_manager: |
|
update_package_manager: |
|
||||||
|
|
||||||
distribution="`cat {{ ansible_distribution_file }}`"
|
distribution="`cat {{ ansible_distribution_file }}`"
|
||||||
@@ -148,11 +154,22 @@
|
|||||||
|
|
||||||
pacman)
|
pacman)
|
||||||
echo "*** Pacman ***"
|
echo "*** Pacman ***"
|
||||||
if [[ "$accept" == "Y" ]]; then
|
auto_accept="{{ update_accept_var }}"
|
||||||
auto_accept="{{ update_accept_var }}"
|
if [[ "$auto_accept" == "-y" ]]; then
|
||||||
|
auto_accept="--noconfirm"
|
||||||
fi
|
fi
|
||||||
sudo pacman -Syyu $auto_accept ||
|
|
||||||
|
sudo pacman -Syu $auto_accept --overwrite '/usr/lib/node_modules/*' ||
|
||||||
return 1
|
return 1
|
||||||
|
echo -e "\n"
|
||||||
|
|
||||||
|
if [[ "$LOGNAME" != "root" ]]; then
|
||||||
|
echo "*** AUR (yay) ***"
|
||||||
|
yay --sudoloop -Syu $auto_accept || return 2
|
||||||
|
else
|
||||||
|
echo "*** User is root, skipping AUR (yay) ***"
|
||||||
|
fi
|
||||||
|
echo -e "\n"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pkg | pkgng)
|
pkg | pkgng)
|
||||||
@@ -243,40 +260,45 @@
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# End of update_package_manager
|
update_npm: |
|
||||||
|
if [[ `which npm` ]]; then
|
||||||
|
echo "*** NPM ***" &&
|
||||||
|
sudo npm update -g
|
||||||
|
echo -e "\n"
|
||||||
|
fi
|
||||||
|
|
||||||
# Flatpaks
|
# Flatpaks
|
||||||
- name: General | Facts | Package | Update Command | Flatpak | Check
|
- name: General | Facts | Package | Update Command | Flatpak | Check
|
||||||
shell: which flatpak
|
ansible.builtin.shell: which flatpak
|
||||||
register: flatpak_exec
|
register: flatpak_exec
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Facts | Package | Update Command | Flatpak | Exists
|
- name: General | Facts | Package | Update Command | Flatpak | Exists
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
update_flatpak: |
|
update_flatpak: |
|
||||||
echo "*** Flatpak ***"
|
echo "*** Flatpak ***"
|
||||||
[[ -n {{ update_accept_var }} ]] && sudo flatpak repair
|
[[ -n "$accept" ]] && sudo flatpak repair
|
||||||
sudo flatpak uninstall --unused {{ update_accept_var }} &&
|
sudo flatpak uninstall --unused $accept &&
|
||||||
sudo flatpak update {{ update_accept_var }} ||
|
sudo flatpak update $accept ||
|
||||||
return 1
|
return 1
|
||||||
when: flatpak_exec is defined
|
when: flatpak_exec is defined
|
||||||
and flatpak_exec.failed is defined
|
and flatpak_exec.failed is defined
|
||||||
and not flatpak_exec.failed
|
and not flatpak_exec.failed
|
||||||
|
|
||||||
- name: General | Facts | Package | Update Command | Flatpak | Missing
|
- name: General | Facts | Package | Update Command | Flatpak | Missing
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
update_flatpak: |
|
update_flatpak: |
|
||||||
echo "*** Flatpak Not Installed ***"
|
echo "*** Flatpak Not Installed ***"
|
||||||
when: update_flatpak is not defined
|
when: update_flatpak is not defined
|
||||||
|
|
||||||
# Firmware
|
# Firmware
|
||||||
- name: General | Facts | Package | Update Command | Firmware | Check
|
- name: General | Facts | Package | Update Command | Firmware | Check
|
||||||
shell: which fwupdmgr
|
ansible.builtin.shell: which fwupdmgr
|
||||||
register: fwupdmgr_exec
|
register: fwupdmgr_exec
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Facts | Package | Update Command | Firmware | Exists
|
- name: General | Facts | Package | Update Command | Firmware | Exists
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
update_firmware: |
|
update_firmware: |
|
||||||
echo "*** Firmware ***"
|
echo "*** Firmware ***"
|
||||||
sudo fwupdmgr refresh --force &&
|
sudo fwupdmgr refresh --force &&
|
||||||
@@ -288,7 +310,7 @@
|
|||||||
and not fwupdmgr_exec.failed
|
and not fwupdmgr_exec.failed
|
||||||
|
|
||||||
- name: General | Facts | Package | Update Command | Firmware | Missing
|
- name: General | Facts | Package | Update Command | Firmware | Missing
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
update_firmware: |
|
update_firmware: |
|
||||||
echo "*** Firmware Updater (fwupdmgr) Not Installed ***"
|
echo "*** Firmware Updater (fwupdmgr) Not Installed ***"
|
||||||
when: update_firmware is not defined
|
when: update_firmware is not defined
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# Definitions for service management.
|
# Definitions for service management.
|
||||||
|
|
||||||
- name: General | Facts | Service | All
|
- name: General | Facts | Service | All
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
cups: cups
|
cups: cups
|
||||||
cups_pattern: cupsd
|
cups_pattern: cupsd
|
||||||
cups_browse: cups-browsed
|
cups_browse: cups-browsed
|
||||||
@@ -18,19 +18,19 @@
|
|||||||
bluetooth_pattern: bluetooth
|
bluetooth_pattern: bluetooth
|
||||||
|
|
||||||
- name: General | Facts | Service | Arch Linux
|
- name: General | Facts | Service | Arch Linux
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
crond: cronie
|
crond: cronie
|
||||||
crond_pattern: cronie
|
crond_pattern: cronie
|
||||||
when: ansible_distribution in ("Archlinux")
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
- name: General | Facts | Service | Fedora
|
- name: General | Facts | Service | Fedora
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
crond: crond
|
crond: crond
|
||||||
crond_pattern: crond
|
crond_pattern: crond
|
||||||
when: ansible_distribution in ("Fedora")
|
when: ansible_distribution in ("Fedora")
|
||||||
|
|
||||||
- name: General | Facts | Service | Ubuntu Linux
|
- name: General | Facts | Service | Ubuntu Linux
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
sshd: ssh
|
sshd: ssh
|
||||||
sshd_pattern: ssh
|
sshd_pattern: ssh
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_distribution == "Ubuntu"
|
||||||
+59
-14
@@ -1,41 +1,86 @@
|
|||||||
---
|
---
|
||||||
# Define file, folder, and other facts per OS.
|
# Define file, folder, and other facts per OS.
|
||||||
|
|
||||||
- name: General | Facts | System | Global
|
- name: General | Facts | System | Global 01
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
lynis_install_dir: /usr/local/src/lynis
|
global_src: /usr/local/src
|
||||||
dwm_install_dir: /usr/local/src/dwm
|
|
||||||
st_install_dir: /usr/local/src/st
|
|
||||||
global_bin: /usr/local/bin
|
global_bin: /usr/local/bin
|
||||||
x_desktops: /usr/share/xsessions
|
x_desktops: /usr/share/xsessions
|
||||||
git_repo_http: https://{{ git_host }}/{{ git_user }}/{{ git_project }}
|
git_repo_http: "https://{{ git_host }}/{{ git_user }}/{{ git_project }}"
|
||||||
git_repo_ssh: ssh://git@{{ git_host }}:{{ git_ssh_port }}/{{ git_user }}/{{ git_project }}
|
git_repo_ssh: "ssh://git@{{ git_host }}:{{ git_ssh_port }}/{{ git_user }}/{{ git_project }}"
|
||||||
|
notify_log: "ansible.notify.log"
|
||||||
|
runit_script_dir: /etc/runit/sv
|
||||||
|
runit_service_dir: /etc/runit/runsvdir/default
|
||||||
|
runit_service_script: run
|
||||||
|
runit_log_dir: log
|
||||||
|
global_log: /var/log
|
||||||
|
global_log_config: config
|
||||||
|
runit_finish_sleep: |
|
||||||
|
#!/bin/sh
|
||||||
|
exec 2>&1
|
||||||
|
# $1 is the exit code, $2 is the exit status byte (signal number if killed)
|
||||||
|
echo "FINISH: Service returned with exit code: $1 and status: $2"
|
||||||
|
|
||||||
|
sleep_long=10
|
||||||
|
sleep_short=1
|
||||||
|
if [[ "$1" != 0 ]]; then
|
||||||
|
echo "FINISH: Sleeping for $sleep_long seconds due to error..."
|
||||||
|
sleep $sleep_long
|
||||||
|
else
|
||||||
|
echo "FINISH: Sleeping for $sleep_short seconds."
|
||||||
|
sleep $sleep_short
|
||||||
|
fi
|
||||||
|
runit_log_config_1mb: |
|
||||||
|
s1000000 # rotate at 1 MB
|
||||||
|
n2 # keep 2 old files
|
||||||
|
runit_log_config_10mb: |
|
||||||
|
s10000000 # rotate at 10 MB
|
||||||
|
n2 # keep 2 old files
|
||||||
|
runit_log_config_100mb: |
|
||||||
|
s100000000 # rotate at 100 MB
|
||||||
|
n2 # keep 2 old files
|
||||||
|
|
||||||
|
- name: General | Facts | System | Global 02
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
shared_rc_install_dir: "{{ global_src }}/env-shared"
|
||||||
|
notify_log_file: "/var/log/{{ notify_log }}"
|
||||||
|
notify_log_file_wip: "/tmp/{{ notify_log }}.wip"
|
||||||
|
lynis_install_dir: "{{ global_src }}/lynis"
|
||||||
|
dwm_install_dir: "{{ global_src }}/dwm"
|
||||||
|
st_install_dir: "{{ global_src }}/st"
|
||||||
|
runit_log_script: "{{ runit_service_script }}"
|
||||||
|
|
||||||
|
- name: General | Facts | System | Global 03
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
shared_rc_bin: "{{ shared_rc_install_dir }}/bin-shared"
|
||||||
|
|
||||||
- name: General | Facts | System | Linux
|
- name: General | Facts | System | Linux
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
rc_conf: /dev/null
|
rc_conf: /dev/null
|
||||||
sudoers_install_dir: /etc/sudoers.d/
|
sudoers_install_dir: /etc/sudoers.d/
|
||||||
sudoers_config: /etc/sudoers
|
sudoers_config: /etc/sudoers
|
||||||
shutdown_command: sudo shutdown -h now
|
shutdown_command: sudo shutdown -h now
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
|
|
||||||
|
|
||||||
- name: General | Facts | System | FreeBSD
|
- name: General | Facts | System | FreeBSD
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
rc_conf: /etc/rc.conf
|
rc_conf: /etc/rc.conf
|
||||||
sudoers_install_dir: /usr/local/etc/sudoers.d/
|
sudoers_install_dir: /usr/local/etc/sudoers.d/
|
||||||
shutdown_command: sudo shutdown -p now
|
shutdown_command: sudo shutdown -p now
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
|
|
||||||
- name: General | Facts | System | Report File Names
|
- name: General | Facts | System | Report File Names
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
lynis_report: "lynis_hardness_check.txt"
|
lynis_report: "lynis_hardness_check.txt"
|
||||||
nmap_report: "nmap_port_check.txt"
|
nmap_report: "nmap_port_check.txt"
|
||||||
|
|
||||||
|
|
||||||
- name: General | Facts | System | Ansible Branch
|
- name: General | Facts | System | Ansible Branch
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
branch: main
|
branch: main
|
||||||
when: branch is not defined
|
when: branch is not defined
|
||||||
|
|
||||||
|
- name: General | Facts | System | runit (Devuan)
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
runit_script_dir: /etc/sv
|
||||||
|
runit_service_dir: /etc/service
|
||||||
|
when: ansible_pkg_mgr == "apt"
|
||||||
@@ -2,12 +2,12 @@
|
|||||||
# Define users and groups per OS type.
|
# Define users and groups per OS type.
|
||||||
|
|
||||||
- name: General | Facts | User | Linux
|
- name: General | Facts | User | Linux
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
root_group: root
|
root_group: root
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
|
|
||||||
|
|
||||||
- name: General | Facts | User | FreeBSD
|
- name: General | Facts | User | FreeBSD
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
root_group: wheel
|
root_group: wheel
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
## Load Config File ##
|
## Load Config File ##
|
||||||
|
|
||||||
- name: Miner | Facts | Config File | Download
|
- name: Miner | Facts | Config File | Download
|
||||||
shell: "scp {{ file_server }}:{{ config_file_remote }} {{ config_file_local }}; chmod 700 {{ config_file_local }}"
|
ansible.builtin.shell: "scp {{ file_server }}:{{ config_file_remote }} {{ config_file_local }}; chmod 700 {{ config_file_local }}"
|
||||||
|
|
||||||
- name: Miner | Facts | Config File | Load Wallets
|
- name: Miner | Facts | Config File | Load Wallets
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
wallet_xmr: "{{ lookup('ini', 'xmr section={{config_section_wallet}} file={{config_file_local}}') }}"
|
wallet_xmr: "{{ lookup('ini', 'xmr section={{config_section_wallet}} file={{config_file_local}}') }}"
|
||||||
wallet_eth: "{{ lookup('ini', 'eth section={{config_section_wallet}} file={{config_file_local}}') }}"
|
wallet_eth: "{{ lookup('ini', 'eth section={{config_section_wallet}} file={{config_file_local}}') }}"
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
## Verify ##
|
## Verify ##
|
||||||
|
|
||||||
- name: Miner | Facts | Config File | DEBUG
|
- name: Miner | Facts | Config File | DEBUG
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: "{{ item }}"
|
var: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- wallet_xmr
|
- wallet_xmr
|
||||||
@@ -25,4 +25,4 @@
|
|||||||
## Clean Up ##
|
## Clean Up ##
|
||||||
|
|
||||||
- name: Miner | Facts | Config File | Delete
|
- name: Miner | Facts | Config File | Delete
|
||||||
shell: "mv {{ config_file_local }} ~/TRASH/"
|
ansible.builtin.shell: "mv {{ config_file_local }} ~/TRASH/"
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# Create arrays of pools per coin.
|
# Create arrays of pools per coin.
|
||||||
|
|
||||||
- name: Miner | Facts | Pools
|
- name: Miner | Facts | Pools
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nanopool_xmr:
|
nanopool_xmr:
|
||||||
- { "priority": 1, "name": "xmr-us-east1.nanopool.org:14433" }
|
- { "priority": 1, "name": "xmr-us-east1.nanopool.org:14433" }
|
||||||
- { "priority": 2, "name": "xmr-us-west1.nanopool.org:14433" }
|
- { "priority": 2, "name": "xmr-us-west1.nanopool.org:14433" }
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
# CPU #
|
# CPU #
|
||||||
|
|
||||||
- name: Miner | Facts | Pools | Set GPU to Nanopool Eth
|
- name: Miner | Facts | Pools | Set GPU to Nanopool Eth
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
cpu_pool: "{{ nanopool_xmr }}"
|
cpu_pool: "{{ nanopool_xmr }}"
|
||||||
when: nanominer_cpu == "xmr" and nanominer_cpu_pool == "nanopool"
|
when: nanominer_cpu == "xmr" and nanominer_cpu_pool == "nanopool"
|
||||||
|
|
||||||
@@ -42,17 +42,17 @@
|
|||||||
# GPU #
|
# GPU #
|
||||||
|
|
||||||
- name: Miner | Facts | Pools | Set GPU to Nanopool Eth
|
- name: Miner | Facts | Pools | Set GPU to Nanopool Eth
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
gpu_pool: "{{ nanopool_eth }}"
|
gpu_pool: "{{ nanopool_eth }}"
|
||||||
when: nanominer_gpu == "eth" and nanominer_gpu_pool == "nanopool"
|
when: nanominer_gpu == "eth" and nanominer_gpu_pool == "nanopool"
|
||||||
|
|
||||||
- name: Miner | Facts | Pools | Set GPU to Etherpool Eth
|
- name: Miner | Facts | Pools | Set GPU to Etherpool Eth
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
gpu_pool: "{{ ethermine_eth }}"
|
gpu_pool: "{{ ethermine_eth }}"
|
||||||
when: nanominer_gpu == "eth" and nanominer_gpu_pool == "etherpool"
|
when: nanominer_gpu == "eth" and nanominer_gpu_pool == "etherpool"
|
||||||
|
|
||||||
- name: Miner | Facts | Pools | Set GPU to F2Pool Eth
|
- name: Miner | Facts | Pools | Set GPU to F2Pool Eth
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
gpu_pool: "{{ f2pool_eth }}"
|
gpu_pool: "{{ f2pool_eth }}"
|
||||||
when: nanominer_gpu == "eth" and nanominer_gpu_pool == "f2pool"
|
when: nanominer_gpu == "eth" and nanominer_gpu_pool == "f2pool"
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
## Validate ##
|
## Validate ##
|
||||||
|
|
||||||
- name: Miner | Facts | Pools | DEBUG
|
- name: Miner | Facts | Pools | DEBUG
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: "{{ item }}"
|
var: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- cpu_pool
|
- cpu_pool
|
||||||
|
|||||||
@@ -4,21 +4,21 @@
|
|||||||
## Global ##
|
## Global ##
|
||||||
|
|
||||||
- name: Miner | Facts | System | Global 1
|
- name: Miner | Facts | System | Global 1
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
file_server: '{{ user }}@leet'
|
file_server: '{{ user }}@leet'
|
||||||
check_alive_start: "[[ `ps -ef | grep -v 'grep' | grep -v '/bin/sh -c' | grep -v $$ | grep -c '"
|
check_alive_start: "[[ `ps -ef | grep -v 'grep' | grep -v '/bin/sh -c' | grep -v $$ | grep -c '"
|
||||||
check_alive_end: "'` == '0' ]] &&"
|
check_alive_end: "'` == '0' ]] &&"
|
||||||
combined_log_file: "{{ user_mfn.home }}/log.txt"
|
combined_log_file: "{{ user_mfn.home }}/log.txt"
|
||||||
|
|
||||||
- name: Miner | Facts | System | Global 2
|
- name: Miner | Facts | System | Global 2
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
use_combined_log_file: ">> {{ combined_log_file }} 2>&1"
|
use_combined_log_file: ">> {{ combined_log_file }} 2>&1"
|
||||||
|
|
||||||
|
|
||||||
## Config File ##
|
## Config File ##
|
||||||
|
|
||||||
- name: Miner | Facts | System | My Config File
|
- name: Miner | Facts | System | My Config File
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
config_file_remote: "InstallFiles/Miners/miner.ini"
|
config_file_remote: "InstallFiles/Miners/miner.ini"
|
||||||
config_file_local: "{{ user_mfn.home }}/miner.ini"
|
config_file_local: "{{ user_mfn.home }}/miner.ini"
|
||||||
config_section_wallet: wallet
|
config_section_wallet: wallet
|
||||||
@@ -31,20 +31,20 @@
|
|||||||
## Nanominer ##
|
## Nanominer ##
|
||||||
|
|
||||||
- name: Miner | Facts | System | nanominer 1
|
- name: Miner | Facts | System | nanominer 1
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nanominer_home: "{{ user_mfn.home }}/nanominer"
|
nanominer_home: "{{ user_mfn.home }}/nanominer"
|
||||||
nanominer_version: "3.4.3" # Download link: https://github.com/nanopool/nanominer/releases
|
nanominer_version: "3.4.3" # Download link: https://github.com/nanopool/nanominer/releases
|
||||||
nanominer_script: "{{ user_mfn.home }}/nanominer.sh"
|
nanominer_script: "{{ user_mfn.home }}/nanominer.sh"
|
||||||
|
|
||||||
- name: Miner | Facts | System | nanominer 2
|
- name: Miner | Facts | System | nanominer 2
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nanominer_bin: "{{ nanominer_home }}/nanominer-linux-{{ nanominer_version }}"
|
nanominer_bin: "{{ nanominer_home }}/nanominer-linux-{{ nanominer_version }}"
|
||||||
nanominer_tar_remote: "InstallFiles/Miners/nanominer/*{{ nanominer_version }}*.tar.gz"
|
nanominer_tar_remote: "InstallFiles/Miners/nanominer/*{{ nanominer_version }}*.tar.gz"
|
||||||
nanominer_config: "{{ nanominer_home }}/config.ini"
|
nanominer_config: "{{ nanominer_home }}/config.ini"
|
||||||
nanominer_logs: "{{ nanominer_home}}/logs"
|
nanominer_logs: "{{ nanominer_home}}/logs"
|
||||||
|
|
||||||
- name: Miner | Facts | System | nanominer 3
|
- name: Miner | Facts | System | nanominer 3
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nanominer_tar_local: "{{ nanominer_bin }}.tar.gz"
|
nanominer_tar_local: "{{ nanominer_bin }}.tar.gz"
|
||||||
nanominer_exec: "{{ nanominer_bin }}/nanominer"
|
nanominer_exec: "{{ nanominer_bin }}/nanominer"
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
## Miner Array ##
|
## Miner Array ##
|
||||||
|
|
||||||
- name: Miner | Facts | System | Miner Array
|
- name: Miner | Facts | System | Miner Array
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
miners:
|
miners:
|
||||||
- { "name": "xmr_stak_cpu", "enabled": '{{ (xmr_stak_cpu != false) }}', "command": "{{ user_mfn.home }}/xmr_stak_cpu.sh {{ use_combined_log_file }}" }
|
- { "name": "xmr_stak_cpu", "enabled": '{{ (xmr_stak_cpu != false) }}', "command": "{{ user_mfn.home }}/xmr_stak_cpu.sh {{ use_combined_log_file }}" }
|
||||||
- { "name": "ethminer", "enabled": '{{ (ethminer != false) }}', "command": "{{ user_mfn.home }}/ethminer.sh {{ use_combined_log_file }}" }
|
- { "name": "ethminer", "enabled": '{{ (ethminer != false) }}', "command": "{{ user_mfn.home }}/ethminer.sh {{ use_combined_log_file }}" }
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
# System related variables.
|
# System related variables.
|
||||||
|
|
||||||
- name: Facts | Server | System | FreeBSD
|
- name: Facts | Server | System | FreeBSD
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ansible_python_interpreter: "/usr/local/bin/python3.8"
|
ansible_python_interpreter: "/usr/local/bin/python3.8"
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
@@ -3,14 +3,14 @@
|
|||||||
# This is only for Workstation devices with UIs.
|
# This is only for Workstation devices with UIs.
|
||||||
|
|
||||||
- name: Workstation | Facts | Packages | Parrot OS Fixes
|
- name: Workstation | Facts | Packages | Parrot OS Fixes
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
ansible_pkg_mgr: "apt"
|
ansible_pkg_mgr: "apt"
|
||||||
ansible_python_interpreter: "/usr/bin/python3"
|
ansible_python_interpreter: "/usr/bin/python3"
|
||||||
when: ansible_distribution == "Parrot OS"
|
when: ansible_distribution == "Parrot OS"
|
||||||
|
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | Consistent
|
- name: Workstation | Facts | Package | Consistent
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
firefox: firefox
|
firefox: firefox
|
||||||
firefox_esr: firefox-esr
|
firefox_esr: firefox-esr
|
||||||
thunderbird: thunderbird
|
thunderbird: thunderbird
|
||||||
@@ -26,55 +26,122 @@
|
|||||||
dmenu: dmenu
|
dmenu: dmenu
|
||||||
sassc: sassc
|
sassc: sassc
|
||||||
ffmpeg: ffmpeg
|
ffmpeg: ffmpeg
|
||||||
|
wireless_tools: wireless-tools
|
||||||
|
macbook_wifi_driver: broadcom-sta-dkms
|
||||||
|
xz: xz
|
||||||
|
mesa: mesa
|
||||||
|
mesa_utils: mesa-utils
|
||||||
|
ninja: ninja
|
||||||
|
notify_send: libnotify
|
||||||
|
fyi: fyi
|
||||||
|
gtk3: gtk3
|
||||||
|
xz_libs: xz
|
||||||
|
cpp: libstdc++
|
||||||
|
c_libs: glibc
|
||||||
|
cpp_libs: libstdc++
|
||||||
|
z_libs: zlib
|
||||||
|
bzip: bzip2
|
||||||
|
dunst: dunst
|
||||||
|
android_jdk: openjdk
|
||||||
|
ncurses: ncurses
|
||||||
|
android_fastboot: fastboot
|
||||||
|
android_adb: adb
|
||||||
|
android_sdkmanager: sdkmanager
|
||||||
|
android_udev: android-udev
|
||||||
|
gnome_boxes: gnome-boxes
|
||||||
|
rhythmbox: rhythmbox
|
||||||
|
vlc: vlc
|
||||||
|
vlc_plugins: vlc-plugins-all
|
||||||
|
blueman: blueman
|
||||||
|
mpv: mpv
|
||||||
|
transmission_gtk: transmission-gtk
|
||||||
|
transmission_qt: transmission-qt
|
||||||
|
libreoffice: libreoffice
|
||||||
|
strawberry: strawberry
|
||||||
|
dict_en: hunspell-en_us
|
||||||
|
dict_es: hunspell-es_any
|
||||||
|
|
||||||
|
|
||||||
|
- name: Workstation | Facts | Package | apt (All Distros)
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
xz: xz-utils
|
||||||
|
mesa: libglu1-mesa
|
||||||
|
mesa_utils: libglu1-mesa
|
||||||
|
ninja: ninja-build
|
||||||
|
notify_send: libnotify-bin
|
||||||
|
gtk3: libgtk-3-dev
|
||||||
|
xz_libs: liblzma-dev
|
||||||
|
cpp: libstdc++-12-dev
|
||||||
|
c_libs: libc6:amd64
|
||||||
|
cpp_libs: libstdc++6
|
||||||
|
z_libs: lib32z1
|
||||||
|
bzip: libbz2-1.0
|
||||||
|
android_jdk: default-jdk
|
||||||
|
ncurses: libncurses-dev
|
||||||
|
android_udev: android-udev-rules
|
||||||
|
vlc_plugins: libavcodec-extra
|
||||||
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | Pop_OS!
|
- name: Workstation | Facts | Package | Pop_OS!
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: true
|
flatpak_distro: true
|
||||||
firefox_esr: firefox
|
firefox_esr: firefox
|
||||||
when: ansible_distribution == "Pop!_OS"
|
when: ansible_distribution == "Pop!_OS"
|
||||||
|
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | Ubuntu
|
- name: Workstation | Facts | Package | Ubuntu
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: true
|
flatpak_distro: true
|
||||||
firefox_esr: firefox
|
firefox_esr: firefox
|
||||||
dmenu: suckless-tools
|
dmenu: suckless-tools
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
|
- name: Workstation | Facts | Package | Debian & Devuan
|
||||||
- name: Workstation | Facts | Package | Debian
|
ansible.builtin.set_fact:
|
||||||
set_fact:
|
|
||||||
flatpak_distro: true
|
flatpak_distro: true
|
||||||
dmenu: suckless-tools
|
dmenu: suckless-tools
|
||||||
when: ansible_distribution == "Debian"
|
firefox: firefox-esr
|
||||||
|
when: ansible_distribution in ("Debian", "Devuan")
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | Mint
|
- name: Workstation | Facts | Package | Mint
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: true
|
flatpak_distro: true
|
||||||
firefox_esr: firefox
|
firefox_esr: firefox
|
||||||
when: ansible_distribution == "Linux Mint"
|
when: ansible_distribution == "Linux Mint"
|
||||||
|
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | Parrot OS
|
- name: Workstation | Facts | Package | Parrot OS
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: true
|
flatpak_distro: true
|
||||||
firefox_esr: firefox-esr
|
|
||||||
when: ansible_distribution == "Parrot OS"
|
when: ansible_distribution == "Parrot OS"
|
||||||
|
|
||||||
|
- name: Workstation | Facts | Package | Apt w/o LibVirt
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
gnome_boxes: htop
|
||||||
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
and ansible_service_mgr not in ("systemd", "sysvinit")
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | Arch + Manjaro
|
|
||||||
set_fact:
|
- name: Workstation | Facts | Package | pacman (All Distros)
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
macbook_wifi_driver: broadcom-wl-dkms
|
||||||
|
android_jdk: jdk-openjdk
|
||||||
|
android_fastboot: android-tools
|
||||||
|
android_adb: android-tools
|
||||||
|
libreoffice: libreoffice-still
|
||||||
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
|
- name: Workstation | Facts | Package | Arch / Manjaro / Artix
|
||||||
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: true
|
flatpak_distro: true
|
||||||
firefox_esr: firefox
|
|
||||||
psutil: python-psutil
|
psutil: python-psutil
|
||||||
appimagelauncher: appimagelauncher
|
#appimagelauncher: appimagelauncher # No longer in the repos, AUR.
|
||||||
when: ansible_distribution == "Archlinux"
|
font_awesome: ttf-font-awesome
|
||||||
|
wireless_tools: wireless_tools
|
||||||
|
nfs: nfs-utils
|
||||||
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | FreeBSD
|
- name: Workstation | Facts | Package | FreeBSD
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: false
|
flatpak_distro: false
|
||||||
psutil: py38-psutil
|
psutil: py38-psutil
|
||||||
ansible_python_interpreter: "/usr/local/bin/python3.8"
|
ansible_python_interpreter: "/usr/local/bin/python3.8"
|
||||||
@@ -84,7 +151,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | Fedora
|
- name: Workstation | Facts | Package | Fedora
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: true
|
flatpak_distro: true
|
||||||
firefox_esr: firefox
|
firefox_esr: firefox
|
||||||
font_awesome: python3-XStatic-Font-Awesome
|
font_awesome: python3-XStatic-Font-Awesome
|
||||||
@@ -94,7 +161,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | openSUSE
|
- name: Workstation | Facts | Package | openSUSE
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: true
|
flatpak_distro: true
|
||||||
firefox_esr: firefox-esr-branding-openSUSE
|
firefox_esr: firefox-esr-branding-openSUSE
|
||||||
font_awesome: fontawesome-fonts
|
font_awesome: fontawesome-fonts
|
||||||
@@ -103,6 +170,6 @@
|
|||||||
|
|
||||||
|
|
||||||
- name: Workstation | Facts | Package | NixOS
|
- name: Workstation | Facts | Package | NixOS
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_distro: false
|
flatpak_distro: false
|
||||||
when: ansible_distribution == "NixOS"
|
when: ansible_distribution == "NixOS"
|
||||||
+9
-6
@@ -20,7 +20,7 @@ static const char *colors[][3] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "1:", "2:", "3:", "4:", "5:", "6:", "7:", "8:", "9:" };
|
static const char *tags[] = { "1 : ", "2 : ", "3 : ", "4 : ", "5 : ", "6 : ", "7 : ", "8 : ", "9 : " };
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* xprop(1):
|
/* xprop(1):
|
||||||
@@ -46,7 +46,7 @@ static const Layout layouts[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* key definitions */
|
/* key definitions */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod4Mask
|
||||||
#define TAGKEYS(KEY,TAG) \
|
#define TAGKEYS(KEY,TAG) \
|
||||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
@@ -69,13 +69,16 @@ static const char *raisevolcmd[] = {"amixer","-q","sset","Master","1%+",NULL};
|
|||||||
static Key keys[] = {
|
static Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||||
|
{ MODKEY, XK_d, spawn, {.v = dmenucmd } },
|
||||||
|
{ MODKEY, XK_b, spawn, {.v = dmenucmd } },
|
||||||
|
{ MODKEY, XK_space, spawn, {.v = dmenucmd } },
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||||
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
|
||||||
{ MODKEY, XK_b, togglebar, {0} },
|
//{ MODKEY, XK_b, togglebar, {0} },
|
||||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
//{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||||
{ MODKEY, XK_Return, zoom, {0} },
|
{ MODKEY, XK_Return, zoom, {0} },
|
||||||
@@ -84,8 +87,8 @@ static Key keys[] = {
|
|||||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||||
{ MODKEY, XK_space, setlayout, {0} },
|
//{ MODKEY, XK_space, setlayout, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
//{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ function volume-usage {
|
|||||||
EOF
|
EOF
|
||||||
return $1
|
return $1
|
||||||
}
|
}
|
||||||
alias volume-help="volume-usage"
|
#alias volume-help="volume-usage"
|
||||||
alias vol-h="volume-help"
|
#alias vol-h="volume-help"
|
||||||
|
|
||||||
function volume {
|
function volume {
|
||||||
|
|
||||||
@@ -135,9 +135,9 @@ function volume {
|
|||||||
echo "$0 $1 $2"
|
echo "$0 $1 $2"
|
||||||
return 7
|
return 7
|
||||||
}
|
}
|
||||||
alias vol="volume "
|
#alias vol="volume "
|
||||||
alias vol-="volume - "
|
#alias vol-="volume - "
|
||||||
alias vol+="volume + "
|
#alias vol+="volume + "
|
||||||
|
|
||||||
function volume-display {
|
function volume-display {
|
||||||
if [[ "$1" == "-v" || "$1" == "--verbose" || "$1" == "verbose" ]]; then
|
if [[ "$1" == "-v" || "$1" == "--verbose" || "$1" == "verbose" ]]; then
|
||||||
@@ -146,7 +146,7 @@ function volume-display {
|
|||||||
amixer sget Master | egrep -o '[0-9]{1,3}%' | head -n 1
|
amixer sget Master | egrep -o '[0-9]{1,3}%' | head -n 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
alias "vol-d"="volume-display"
|
#alias "vol-d"="volume-display"
|
||||||
|
|
||||||
## TBD/TODO ##
|
## TBD/TODO ##
|
||||||
|
|
||||||
|
|||||||
@@ -12,12 +12,16 @@ if [[ -z "$HOSTNAME" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
EXTRA="$1"
|
EXTRA="$1"
|
||||||
TAG="System"
|
|
||||||
DATE="`date "+%Y%m%d-%H%M%S"`"
|
DATE="`date "+%Y%m%d-%H%M%S"`"
|
||||||
BACKUP_DIR="/srv/backup"
|
BACKUP_DIR="/srv/backup"
|
||||||
BASENAME="Backup"
|
BASENAME="Backup"
|
||||||
|
|
||||||
|
TAG="System"
|
||||||
BACKUP="$BACKUP_DIR/$BASENAME.$DATE.$HOSTNAME.$TAG.zip"
|
BACKUP="$BACKUP_DIR/$BASENAME.$DATE.$HOSTNAME.$TAG.zip"
|
||||||
|
|
||||||
|
TAG2="Data"
|
||||||
|
BACKUP2="${BACKUP//$TAG/$TAG2}"
|
||||||
|
|
||||||
## Initialization ##
|
## Initialization ##
|
||||||
|
|
||||||
echo "*** Creating Backup Directory ***"
|
echo "*** Creating Backup Directory ***"
|
||||||
@@ -31,15 +35,19 @@ sudo chown -Rv root:root "$BACKUP_DIR"
|
|||||||
echo "*** Removing Old Backups ***"
|
echo "*** Removing Old Backups ***"
|
||||||
cd "$BACKUP_DIR"
|
cd "$BACKUP_DIR"
|
||||||
sudo mv -v "$BASENAME"*"$TAG"* TRASH/
|
sudo mv -v "$BASENAME"*"$TAG"* TRASH/
|
||||||
|
sudo mv -v "$BASENAME"*"$TAG2"* TRASH/
|
||||||
sudo rm -v TRASH/*
|
sudo rm -v TRASH/*
|
||||||
|
|
||||||
## Main
|
## Main
|
||||||
|
|
||||||
|
# System Backup
|
||||||
|
|
||||||
echo "*** Creating backup at '$BACKUP' ***"
|
echo "*** Creating backup at '$BACKUP' ***"
|
||||||
sudo zip -rv "$BACKUP" \
|
sudo zip -rv "$BACKUP" \
|
||||||
/etc /var/{log,mail,spool} /srv /boot \
|
/etc /var/{log,mail,spool} /srv /boot \
|
||||||
/usr/local/etc $EXTRA \
|
/usr/local/etc $EXTRA \
|
||||||
-x "/srv/backup/*" -x "/srv/sftp/*"
|
-x "/srv/backup/*" -x "/srv/sftp/*" \
|
||||||
|
-x "*/.gradle/" -x "*/app/build/*"
|
||||||
status="$?"
|
status="$?"
|
||||||
|
|
||||||
if [[ "$status" != 0 ]]; then
|
if [[ "$status" != 0 ]]; then
|
||||||
@@ -54,4 +62,27 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo -e "\n\n"
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
# Data Backup
|
||||||
|
|
||||||
|
echo "*** Creating backup at '$BACKUP2' ***"
|
||||||
|
sudo zip -rv "$BACKUP2" \
|
||||||
|
/root /home /srv/sftp \
|
||||||
|
-x "*/.gradle/" -x "*/app/build/*"
|
||||||
|
status="$?"
|
||||||
|
|
||||||
|
if [[ "$status" != 0 ]]; then
|
||||||
|
echo "*** ERROR: Failed to create '$BACKUP2', file may be incorrect. ***"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -e "$BACKUP2" ]]; then
|
||||||
|
ls -alh "$BACKUP2"
|
||||||
|
echo "*** '$BACKUP2' created successfully! ***"
|
||||||
|
else
|
||||||
|
echo "*** '$BACKUP2' not found! ***"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
Executable
+115
@@ -0,0 +1,115 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# 20260819 - Hyperling
|
||||||
|
# Alert the user every so often once the battery is low.
|
||||||
|
|
||||||
|
## Setup ##
|
||||||
|
|
||||||
|
echo "`date` - Checking Active Programs"
|
||||||
|
|
||||||
|
ps -ef | grep battery_nag.sh | grep -v grep | grep -v "sh -c" | grep -v kill | grep -v $$
|
||||||
|
|
||||||
|
active=`ps -ef | grep battery_nag.sh | grep -v grep | grep -v "sh -c" | grep -v kill | grep -vc $$`
|
||||||
|
if (( "$active" >= 1 )); then
|
||||||
|
echo "Program already running, exiting. Number of processes: $active"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "`date` - Loading Functions"
|
||||||
|
|
||||||
|
which battery.function || {
|
||||||
|
echo "ERROR: Battery function not found, exiting."
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
source battery.function
|
||||||
|
|
||||||
|
## Params ##
|
||||||
|
|
||||||
|
echo "`date` - Parsing Parameters"
|
||||||
|
|
||||||
|
typeset -i alert sleep
|
||||||
|
|
||||||
|
# Default to 20%.
|
||||||
|
alert=20
|
||||||
|
if [[ -n "$1" ]]; then
|
||||||
|
echo -n "alert changed from '$alert' "
|
||||||
|
alert="$1"
|
||||||
|
echo "to '$alert'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default to 5 minutes.
|
||||||
|
sleep=300
|
||||||
|
if [[ -n "$2" ]]; then
|
||||||
|
echo -n "sleep changed from '$sleep' "
|
||||||
|
sleep="$2"
|
||||||
|
echo "to '$sleep'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default to true.
|
||||||
|
accelerate="Y"
|
||||||
|
if [[ -n "$3" ]]; then
|
||||||
|
echo -n "accelerate changed from '$accelerate' "
|
||||||
|
accelerate="$3"
|
||||||
|
echo "to '$accelerate'"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Alerting when under ${alert}%."
|
||||||
|
echo "Notifying every ${sleep} seconds."
|
||||||
|
if [[ "$accelerate" == "Y" ]]; then
|
||||||
|
echo -n "Speeding up notifications as % gets lower."
|
||||||
|
else
|
||||||
|
echo -n "Notifcations staying persistent."
|
||||||
|
fi
|
||||||
|
echo " (accelerate == $accelerate)"
|
||||||
|
|
||||||
|
## Main ##
|
||||||
|
|
||||||
|
echo "`date` - Starting Loop"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
|
||||||
|
batt=`battery-display`
|
||||||
|
batt=${batt//%/}
|
||||||
|
|
||||||
|
if (( batt <= alert )); then
|
||||||
|
title="Battery is below ${alert}%"
|
||||||
|
message="Currently at ${batt}%"
|
||||||
|
cmd="`which fyi 2>/dev/null || which notify-send 2>/dev/null`"
|
||||||
|
if [[ -z "$cmd" ]]; then
|
||||||
|
echo "ERROR: No command found to send notification, exiting."
|
||||||
|
echo "Please install 'fyi' or 'notify-send' to use this script."
|
||||||
|
echo "If not using a DE, also ensure 'dunst' or similar is running."
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
echo "`date` - Attempting to report battery level at ${batt}."
|
||||||
|
|
||||||
|
$cmd "$title" "$message"
|
||||||
|
status="$?"
|
||||||
|
|
||||||
|
if [[ "$status" == 0 ]]; then
|
||||||
|
echo -n "`date` - Success! "
|
||||||
|
else
|
||||||
|
echo -n "`date` - ERROR: "
|
||||||
|
fi
|
||||||
|
echo "Nag returned status ${status}."
|
||||||
|
else
|
||||||
|
echo "`date` - Battery at ${batt}%, did not nag."
|
||||||
|
fi
|
||||||
|
|
||||||
|
time=$sleep
|
||||||
|
if [[ "$accelerate" == "Y" && $batt -lt $alert ]]; then
|
||||||
|
# Bash only returns whole numbers, so things like 20/11 only provide 1.
|
||||||
|
# Likewise, if the battery is full, 20/100 returns 0, which is bad. :)
|
||||||
|
if (( batt > 0 )); then
|
||||||
|
time=$(( time / (alert / batt) ))
|
||||||
|
else
|
||||||
|
time=10
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# Showing a notification every 10 seconds makes it persistent.
|
||||||
|
# Any more than that casues multiple to stack which is unnecessary.
|
||||||
|
if (( time < 10 )); then
|
||||||
|
time=10
|
||||||
|
fi
|
||||||
|
echo "`date` - Sleeping for ${time}."
|
||||||
|
sleep $time
|
||||||
|
done
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# 2023-12-04 Hyperling
|
# 2023-12-04 Hyperling
|
||||||
# Lower resolution of audio and convert to mp3. Also
|
# Lower the resolution of audio and convert to mp3.
|
||||||
# Also see: compress-video.sh
|
# Also see: compress-video.sh
|
||||||
|
|
||||||
## Setup ##
|
## Setup ##
|
||||||
@@ -36,7 +36,8 @@ function usage() {
|
|||||||
Compress audio to mp3. Can handle folders and work recursively.
|
Compress audio to mp3. Can handle folders and work recursively.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
-q QUALITY : Integer for the maximum length of either media dimension.
|
-q QUALITY : Integer for audio bitrate to transcode to.
|
||||||
|
Defaults to 256k. No lower than 192k suggested.
|
||||||
-l LOCATION : The specific media or folder which needs compressed.
|
-l LOCATION : The specific media or folder which needs compressed.
|
||||||
-r : Recursively shrink media based on the location passed.
|
-r : Recursively shrink media based on the location passed.
|
||||||
-f : Force the media to be shrunk even if a file already exists for it.
|
-f : Force the media to be shrunk even if a file already exists for it.
|
||||||
@@ -181,8 +182,8 @@ $search "$location" | sort | while read media; do
|
|||||||
|
|
||||||
if [[ -n "$delete" ]]; then
|
if [[ -n "$delete" ]]; then
|
||||||
echo -n " DELETE: "
|
echo -n " DELETE: "
|
||||||
if [[ -d ~/TRASH ]]; then
|
if [[ -d $HOME/TRASH ]]; then
|
||||||
mv -v "$media" ~/TRASH/
|
mv -v "$media" $HOME/TRASH/
|
||||||
else
|
else
|
||||||
rm -v "$media"
|
rm -v "$media"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ size=2000
|
|||||||
|
|
||||||
# Strings
|
# Strings
|
||||||
tag="shrunk"
|
tag="shrunk"
|
||||||
|
use_tag="Y"
|
||||||
date_YYYYMMDD="`date "+%Y%m%d"`"
|
date_YYYYMMDD="`date "+%Y%m%d"`"
|
||||||
location="."
|
location="."
|
||||||
search="ls"
|
search="ls"
|
||||||
@@ -28,7 +29,7 @@ function usage() {
|
|||||||
# Parameters:
|
# Parameters:
|
||||||
# 1) The exit status to use.
|
# 1) The exit status to use.
|
||||||
status=$1
|
status=$1
|
||||||
echo "Usage: $PROG [-s SIZE] [-l LOCATION] [-A | [-r] [-f] [-d] [-c]] [-h] [-x] [-t]" >&2
|
echo "Usage: $PROG [-s SIZE] [-l LOCATION] [-A | [-r] [-f] [-d] [-c] [-e | -t] [-h] [-x] [-n]" >&2
|
||||||
cat <<- EOF
|
cat <<- EOF
|
||||||
Compress JPG or PNG image(s). Can handle folders and work recursively.
|
Compress JPG or PNG image(s). Can handle folders and work recursively.
|
||||||
|
|
||||||
@@ -42,17 +43,18 @@ function usage() {
|
|||||||
-F : FORCE the image to be shrunk even if the file is already shrunk.
|
-F : FORCE the image to be shrunk even if the file is already shrunk.
|
||||||
-d : Delete the original image if the compressed image is smaller.
|
-d : Delete the original image if the compressed image is smaller.
|
||||||
-c : Clean the filename of underscores, dashes, 'IMG', etc.
|
-c : Clean the filename of underscores, dashes, 'IMG', etc.
|
||||||
|
-e | -t : Format timestamp to the expanded model.
|
||||||
-A : Resursively Force, Delete, and Clean.
|
-A : Resursively Force, Delete, and Clean.
|
||||||
-h : Display this usage text.
|
-h : Display this usage text.
|
||||||
-x : Enable BASH debugging.
|
-x : Enable BASH debugging.
|
||||||
-t : Format timestamp.
|
-n : No file extension.
|
||||||
EOF
|
EOF
|
||||||
exit $status
|
exit $status
|
||||||
}
|
}
|
||||||
|
|
||||||
## Parameters ##
|
## Parameters ##
|
||||||
|
|
||||||
while getopts ":s:l:rfFdcAhxt" opt; do
|
while getopts ":s:l:rfFdcetAhxn" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
s) in_size="$OPTARG" && size="$in_size" ;;
|
s) in_size="$OPTARG" && size="$in_size" ;;
|
||||||
l) location="$OPTARG" ;;
|
l) location="$OPTARG" ;;
|
||||||
@@ -62,10 +64,11 @@ while getopts ":s:l:rfFdcAhxt" opt; do
|
|||||||
d) delete="Y" ;;
|
d) delete="Y" ;;
|
||||||
c) clean="Y" ;;
|
c) clean="Y" ;;
|
||||||
e) expand="Y" ;;
|
e) expand="Y" ;;
|
||||||
A) recurse="Y" && search="find" && force="Y" && delete="Y" && expand="Y" ;;
|
t) expand="Y" ;;
|
||||||
|
A) recurse="Y" && search="find" && force="Y" && delete="Y" ;;
|
||||||
h) usage 0 ;;
|
h) usage 0 ;;
|
||||||
x) set -x ;;
|
x) set -x ;;
|
||||||
t) format_time="Y" ;;
|
n) use_tag="N" ;;
|
||||||
*) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;;
|
*) echo "ERROR: Option $OPTARG not recognized." >&2 && usage 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -114,6 +117,12 @@ $search "$location" | sort | while read image; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
new_image="${image//.$extension/}.$tag-$date_YYYYMMDD.$size.$extension"
|
new_image="${image//.$extension/}.$tag-$date_YYYYMMDD.$size.$extension"
|
||||||
|
if [[ "$use_tag" == "N" ]]; then
|
||||||
|
new_image="$image"
|
||||||
|
new_image="${new_image//.$extension/}"
|
||||||
|
new_image="${new_image//.$tag/}"
|
||||||
|
new_image="$new_image.$tag.$extension"
|
||||||
|
fi
|
||||||
|
|
||||||
## Clean Filename ##
|
## Clean Filename ##
|
||||||
# Prevent directory from having its name cleaned too.
|
# Prevent directory from having its name cleaned too.
|
||||||
@@ -132,9 +141,7 @@ $search "$location" | sort | while read image; do
|
|||||||
# Date Data
|
# Date Data
|
||||||
new_image_exp="${TEMP:0:4}-${TEMP:4:2}-${TEMP:6:2}"
|
new_image_exp="${TEMP:0:4}-${TEMP:4:2}-${TEMP:6:2}"
|
||||||
# Time Data
|
# Time Data
|
||||||
if [[ "$format_time" == "Y" ]]; then
|
new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}"
|
||||||
new_image_exp="${new_image_exp}_${TEMP:8:2}-${TEMP:10:2}-${TEMP:12:2}"
|
|
||||||
fi
|
|
||||||
# Remainder Data
|
# Remainder Data
|
||||||
if [[ "${TEMP:14:1}" == "." ]]; then
|
if [[ "${TEMP:14:1}" == "." ]]; then
|
||||||
SEP=""
|
SEP=""
|
||||||
@@ -156,7 +163,7 @@ $search "$location" | sort | while read image; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Skip if a compressed image was already created today.
|
# Skip if a compressed image was already created today.
|
||||||
if [[ -e "$new_image" || -e $new_image_clean ]]; then
|
if [[ (-e "$new_image" || -e $new_image_clean) && $use_tag == "Y" ]]; then
|
||||||
echo " SKIP: Image has already been shrunk previously, moving on."
|
echo " SKIP: Image has already been shrunk previously, moving on."
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@@ -208,8 +215,8 @@ $search "$location" | sort | while read image; do
|
|||||||
|
|
||||||
if [[ -n "$delete" ]]; then
|
if [[ -n "$delete" ]]; then
|
||||||
echo -n " DELETE: "
|
echo -n " DELETE: "
|
||||||
if [[ -d ~/TRASH ]]; then
|
if [[ -d $HOME/TRASH ]]; then
|
||||||
mv -v "$image" ~/TRASH/
|
mv -v "$image" $HOME/TRASH/
|
||||||
else
|
else
|
||||||
rm -v "$image"
|
rm -v "$image"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -225,8 +225,8 @@ $search_command "$input" | sort | while read file; do
|
|||||||
if [[ -e "$newfile" || -e "$new_video_clean" ]]; then
|
if [[ -e "$newfile" || -e "$new_video_clean" ]]; then
|
||||||
if [[ "$force" == "Y" ]]; then
|
if [[ "$force" == "Y" ]]; then
|
||||||
echo "FORCE: Removing '$newfile'."
|
echo "FORCE: Removing '$newfile'."
|
||||||
if [[ -d ~/TRASH ]]; then
|
if [[ -d $HOME/TRASH ]]; then
|
||||||
mv -v "$newfile" "$new_video_clean" ~/TRASH/ 2>/dev/null
|
mv -v "$newfile" "$new_video_clean" $HOME/TRASH/ 2>/dev/null
|
||||||
else
|
else
|
||||||
rm -v "$newfile" "$new_video_clean" 2>/dev/null
|
rm -v "$newfile" "$new_video_clean" 2>/dev/null
|
||||||
fi
|
fi
|
||||||
@@ -279,8 +279,8 @@ $search_command "$input" | sort | while read file; do
|
|||||||
|
|
||||||
if [[ -n "$delete" ]]; then
|
if [[ -n "$delete" ]]; then
|
||||||
echo -n "Original has been deleted: "
|
echo -n "Original has been deleted: "
|
||||||
if [[ -d ~/TRASH ]]; then
|
if [[ -d $HOME/TRASH ]]; then
|
||||||
mv -v "$file" ~/TRASH/
|
mv -v "$file" $HOME/TRASH/
|
||||||
else
|
else
|
||||||
rm -v "$file"
|
rm -v "$file"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Executable
+89
@@ -0,0 +1,89 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
# 2026-10-10 Hyperling
|
||||||
|
# Stop a system from going into swap due to LLMs.
|
||||||
|
|
||||||
|
### Tuning ###
|
||||||
|
|
||||||
|
typeset -i sleep=10 full_pct=98 high_pct=90
|
||||||
|
|
||||||
|
### Functions ###
|
||||||
|
|
||||||
|
restart_service() {
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
echo "ERROR: Service name must be passed to restart_service()."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
sv restart $1 || echo "$1 failed to restart, ignoring."
|
||||||
|
}
|
||||||
|
|
||||||
|
# While we could loop over `ollama ps` and stop them, this ensures that the UIs
|
||||||
|
# do not sit around waiting for responses from the dead LLMs. It bring them up
|
||||||
|
# in a fresh state so that work can continue from a more clean slate.
|
||||||
|
restart_llms() {
|
||||||
|
restart_service ollama
|
||||||
|
#restart_service zeroclaw
|
||||||
|
#restart_service open-webui
|
||||||
|
#restart_service qwen-code
|
||||||
|
}
|
||||||
|
|
||||||
|
### Main ###
|
||||||
|
|
||||||
|
typeset -i {total,used}_{ram,swap}=0 \
|
||||||
|
used_{ram,swap}_pct=0 \
|
||||||
|
last_{ram,swap}_pct=100 \
|
||||||
|
count=0
|
||||||
|
|
||||||
|
while [[ true ]]; do
|
||||||
|
|
||||||
|
count=$(expr $count + 1 )
|
||||||
|
echo "$(date +'%Y-%m-%d @ %H:%M:%S') - Loop $count"
|
||||||
|
|
||||||
|
# RAM #
|
||||||
|
|
||||||
|
total_ram=$(free | awk '/^Mem:/ {print $2}')
|
||||||
|
used_ram=$(free | awk '/^Mem:/ {print $3}')
|
||||||
|
used_ram_pct=$( \
|
||||||
|
awk -v used="$used_ram" -v total="$total_ram" \
|
||||||
|
'BEGIN {printf "%d",(used/total)*100}' \
|
||||||
|
)
|
||||||
|
|
||||||
|
echo "Current RAM usage is $used_ram_pct%, was $last_ram_pct% last loop."
|
||||||
|
|
||||||
|
# Swap #
|
||||||
|
|
||||||
|
total_swap=$(free | awk '/^Swap:/ {print $2}')
|
||||||
|
used_swap=$(free | awk '/^Swap:/ {print $3}')
|
||||||
|
used_swap_pct=$( \
|
||||||
|
awk -v used="$used_swap" -v total="$total_swap" \
|
||||||
|
'BEGIN {printf "%d",(used/total)*100}' \
|
||||||
|
)
|
||||||
|
|
||||||
|
echo "Current swap usage is $used_swap_pct%, was $last_swap_pct% last loop."
|
||||||
|
|
||||||
|
# If RAM is full and swap is growing then restart LLM services.
|
||||||
|
if [ $used_ram_pct -gt $full_pct ] &&
|
||||||
|
[ $used_swap_pct -gt $last_swap_pct ]
|
||||||
|
then
|
||||||
|
echo "WARNING: RAM full and swap is growing. Restarting LLMs."
|
||||||
|
restart_llms
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If both are high then restart LLM services.
|
||||||
|
if [ $used_ram_pct -ge $high_pct ] &&
|
||||||
|
[ $used_swap_pct -ge $high_pct ]
|
||||||
|
then
|
||||||
|
echo "WARNING: RAM and swap both high. Restarting LLMs."
|
||||||
|
restart_llms
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Finish #
|
||||||
|
|
||||||
|
echo -e "Check finished, sleeping for ${sleep}...\n"
|
||||||
|
|
||||||
|
last_ram_pct=$used_ram_pct
|
||||||
|
last_swap_pct=$used_swap_pct
|
||||||
|
|
||||||
|
sleep $sleep
|
||||||
|
done
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
nixos_working_dir=~/nixos-config-deleteme
|
nixos_working_dir=$HOME/nixos-config-deleteme
|
||||||
nixos_working_exe=activate.sh
|
nixos_working_exe=activate.sh
|
||||||
|
|
||||||
## Functions ##
|
## Functions ##
|
||||||
|
|||||||
Executable
+5
@@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
source /usr/local/bin/volume.function
|
||||||
|
|
||||||
|
volume $@
|
||||||
@@ -0,0 +1,433 @@
|
|||||||
|
# This file has been auto-generated by i3-config-wizard(1).
|
||||||
|
# It will not be overwritten, so edit it as you like.
|
||||||
|
#
|
||||||
|
# Should you change your keyboard layout some time, delete
|
||||||
|
# this file and re-run i3-config-wizard(1).
|
||||||
|
#
|
||||||
|
|
||||||
|
# i3 config file (v4)
|
||||||
|
#
|
||||||
|
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
|
||||||
|
|
||||||
|
set $FIREFOX "sh -c '(firefox || firefox-esr || firefox-flatpak)'"
|
||||||
|
set $TRANSMISSION "sh -c '(transmission || transmission-qt || transmission-gtk || transmission-flatpak)'"
|
||||||
|
|
||||||
|
# Use the `xev` command to see the name and code of a keyboard key.
|
||||||
|
|
||||||
|
set $mod Mod4
|
||||||
|
set $alt Mod1
|
||||||
|
set $ctrl Control
|
||||||
|
set $shift Shift
|
||||||
|
|
||||||
|
# Font for window titles. Will also be used by the bar unless a different font
|
||||||
|
# is used in the bar {} block below.
|
||||||
|
font pango:monospace 8
|
||||||
|
|
||||||
|
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
||||||
|
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||||
|
#font pango:DejaVu Sans Mono 8
|
||||||
|
|
||||||
|
# Start XDG autostart .desktop files using dex. See also
|
||||||
|
# https://wiki.archlinux.org/index.php/XDG_Autostart
|
||||||
|
exec --no-startup-id dex --autostart --environment i3
|
||||||
|
|
||||||
|
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
|
||||||
|
# they are included here as an example. Modify as you see fit.
|
||||||
|
|
||||||
|
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
|
||||||
|
# screen before suspend. Use loginctl lock-session to lock your screen.
|
||||||
|
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
|
||||||
|
|
||||||
|
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
||||||
|
# and nm-applet is a desktop environment-independent system tray GUI for it.
|
||||||
|
exec --no-startup-id nm-applet
|
||||||
|
|
||||||
|
# Use pactl to adjust volume in PulseAudio.
|
||||||
|
set $refresh_i3status killall -SIGUSR1 i3status
|
||||||
|
#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
|
||||||
|
#bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
|
||||||
|
#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
|
||||||
|
#bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
|
||||||
|
|
||||||
|
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||||
|
floating_modifier $mod
|
||||||
|
|
||||||
|
# move tiling windows via drag & drop by left-clicking into the title bar,
|
||||||
|
# or left-clicking anywhere into the window while holding the floating modifier.
|
||||||
|
tiling_drag modifier titlebar
|
||||||
|
|
||||||
|
# start a terminal
|
||||||
|
bindsym $mod+Return exec i3-sensible-terminal
|
||||||
|
#bindsym $mod+Return exec st
|
||||||
|
|
||||||
|
# kill focused window
|
||||||
|
#bindsym $mod+Shift+q kill
|
||||||
|
bindsym $mod+q kill
|
||||||
|
|
||||||
|
# start dmenu (a program launcher)
|
||||||
|
bindsym $mod+d exec --no-startup-id dmenu_run
|
||||||
|
bindsym $mod+b exec --no-startup-id dmenu_run
|
||||||
|
bindsym $mod+space exec --no-startup-id dmenu_run
|
||||||
|
# A more modern dmenu replacement is rofi:
|
||||||
|
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
|
||||||
|
# There also is i3-dmenu-desktop which only displays applications shipping a
|
||||||
|
# .desktop file. It is a wrapper around dmenu, so you need that installed.
|
||||||
|
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
|
||||||
|
|
||||||
|
# change focus
|
||||||
|
#bindsym $mod+j focus left
|
||||||
|
#bindsym $mod+k focus down
|
||||||
|
#bindsym $mod+l focus up
|
||||||
|
#bindsym $mod+semicolon focus right
|
||||||
|
|
||||||
|
# alternatively, you can use the cursor keys:
|
||||||
|
bindsym $mod+Left focus left
|
||||||
|
bindsym $mod+Down focus down
|
||||||
|
bindsym $mod+Up focus up
|
||||||
|
bindsym $mod+Right focus right
|
||||||
|
|
||||||
|
# move focused window
|
||||||
|
#bindsym $mod+Shift+j move left
|
||||||
|
#bindsym $mod+Shift+k move down
|
||||||
|
#bindsym $mod+Shift+l move up
|
||||||
|
#bindsym $mod+Shift+semicolon move right
|
||||||
|
|
||||||
|
# alternatively, you can use the cursor keys:
|
||||||
|
bindsym $mod+Shift+Left move left
|
||||||
|
bindsym $mod+Shift+Down move down
|
||||||
|
bindsym $mod+Shift+Up move up
|
||||||
|
bindsym $mod+Shift+Right move right
|
||||||
|
|
||||||
|
# split in horizontal orientation
|
||||||
|
bindsym $mod+h split h
|
||||||
|
|
||||||
|
# split in vertical orientation
|
||||||
|
bindsym $mod+v split v
|
||||||
|
|
||||||
|
# enter fullscreen mode for the focused container
|
||||||
|
bindsym $mod+f fullscreen toggle
|
||||||
|
|
||||||
|
# change container layout (stacked, tabbed, toggle split)
|
||||||
|
bindsym $mod+s layout stacking
|
||||||
|
bindsym $mod+w layout tabbed
|
||||||
|
bindsym $mod+e layout toggle split
|
||||||
|
|
||||||
|
# toggle tiling / floating
|
||||||
|
bindsym $mod+Shift+space floating toggle
|
||||||
|
|
||||||
|
# change focus between tiling / floating windows
|
||||||
|
#bindsym $mod+space focus mode_toggle
|
||||||
|
|
||||||
|
# focus the parent container
|
||||||
|
bindsym $mod+a focus parent
|
||||||
|
|
||||||
|
# focus the child container
|
||||||
|
#bindsym $mod+d focus child
|
||||||
|
|
||||||
|
|
||||||
|
## Extra Program Shortcuts ##
|
||||||
|
|
||||||
|
# Theming.
|
||||||
|
bindsym $mod+t exec lxappearance
|
||||||
|
|
||||||
|
# Manage files.
|
||||||
|
bindsym $mod+m exec thunar
|
||||||
|
|
||||||
|
# Internet.
|
||||||
|
bindsym $mod+i exec $FIREFOX
|
||||||
|
|
||||||
|
# Code.
|
||||||
|
bindsym $mod+c exec codium-flatpak
|
||||||
|
|
||||||
|
|
||||||
|
## Brightness ##
|
||||||
|
# light requires sudo privileges unless video group and udev are configured.
|
||||||
|
|
||||||
|
set $b_time 3000
|
||||||
|
set $b_micro 5
|
||||||
|
set $b_small 10
|
||||||
|
set $b_large 20
|
||||||
|
|
||||||
|
# Use the bracket keys to change the brightness.
|
||||||
|
bindsym $ctrl+bracketleft exec --no-startup-id "light -U $b_micro && notify-send -t $b_time 'Brightness - ' $(light -G)"
|
||||||
|
bindsym $ctrl+bracketright exec --no-startup-id "light -A $b_micro && notify-send -t $b_time 'Brightness + ' $(light -G)"
|
||||||
|
bindsym $mod+bracketleft exec --no-startup-id "light -U $b_small && notify-send -t $b_time 'Brightness -- ' $(light -G)"
|
||||||
|
bindsym $mod+bracketright exec --no-startup-id "light -A $b_small && notify-send -t $b_time 'Brightness ++ ' $(light -G)"
|
||||||
|
bindsym $shift+$mod+bracketleft exec --no-startup-id "light -U $b_large && notify-send -t $b_time 'Brightness ---' $(light -G)"
|
||||||
|
bindsym $shift+$mod+bracketright exec --no-startup-id "light -A $b_large && notify-send -t $b_time 'Brightness +++' $(light -G)"
|
||||||
|
|
||||||
|
# Also get the actual brightness keys to work!!
|
||||||
|
bindsym $ctrl+XF86MonBrightnessUp exec --no-startup-id "light -A $b_micro && notify-send -t $b_time 'Brightness + ' $(light -G)"
|
||||||
|
bindsym $ctrl+XF86MonBrightnessDown exec --no-startup-id "light -U $b_micro && notify-send -t $b_time 'Brightness - ' $(light -G)"
|
||||||
|
bindsym XF86MonBrightnessUp exec --no-startup-id "light -A $b_small && notify-send -t $b_time 'Brightness ++ ' $(light -G)"
|
||||||
|
bindsym XF86MonBrightnessDown exec --no-startup-id "light -U $b_small && notify-send -t $b_time 'Brightness -- ' $(light -G)"
|
||||||
|
bindsym $shift+XF86MonBrightnessUp exec --no-startup-id "light -A $b_large && notify-send -t $b_time 'Brightness +++' $(light -G)"
|
||||||
|
bindsym $shift+XF86MonBrightnessDown exec --no-startup-id "light -U $b_large && notify-send -t $b_time 'Brightness ---' $(light -G)"
|
||||||
|
|
||||||
|
|
||||||
|
## Keyboard Brightness ##
|
||||||
|
|
||||||
|
# Use same timing and step size settings as above.
|
||||||
|
|
||||||
|
# Macbooks tend to use 'sysfs/leds/smc::kbd_backlight'
|
||||||
|
# NovaCustom laptop is 'sysfs/leds/system76_acpi::kbd_backlight'
|
||||||
|
# Some other laptops may be 'sysfs/class/leds/...', use ìght -L`to find out.
|
||||||
|
bindsym $ctrl+XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_micro && notify-send -t $b_time 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym $ctrl+XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_micro && notify-send -t $b_time 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_small && notify-send -t $b_time 'Keyboard Brightness ++ ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_small && notify-send -t $b_time 'Keyboard Brightness -- ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym $shift+XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_large && notify-send -t $b_time 'Keyboard Brightness +++' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym $shift+XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_large && notify-send -t $b_time 'Keyboard Brightness ---' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
|
||||||
|
bindsym $ctrl+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_micro && notify-send -t $b_time 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym $ctrl+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_micro && notify-send -t $b_time 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym $mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_small && notify-send -t $b_time 'Keyboard Brightness ++ ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym $mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_small && notify-send -t $b_time 'Keyboard Brightness -- ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym $shift+$mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_large && notify-send -t $b_time 'Keyboard Brightness +++' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
bindsym $shift+$mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_large && notify-send -t $b_time 'Keyboard Brightness ---' $(light -s sysfs/leds/smc::kbd_backlight -G)"
|
||||||
|
|
||||||
|
|
||||||
|
## Volume ##
|
||||||
|
# The volume function is from https://git.hyperling.com/me/env-ansible
|
||||||
|
|
||||||
|
set $v_time 1500
|
||||||
|
set $v_micro 5
|
||||||
|
set $v_small 10
|
||||||
|
set $v_large 25
|
||||||
|
|
||||||
|
# Use the comma and period keys to change volume.
|
||||||
|
bindsym $ctrl+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_micro && notify-send -t $v_time "Volume - " $(volume)'
|
||||||
|
bindsym $ctrl+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_micro && notify-send -t $v_time "Volume + " $(volume)'
|
||||||
|
bindsym $mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_small && notify-send -t $v_time "Volume -- " $(volume)'
|
||||||
|
bindsym $mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_small && notify-send -t $v_time "Volume ++ " $(volume)'
|
||||||
|
bindsym $shift+$mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_large && notify-send -t $v_time "Volume ---" $(volume)'
|
||||||
|
bindsym $shift+$mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_large && notify-send -t $v_time "Volume +++" $(volume)'
|
||||||
|
|
||||||
|
# Actual volume keys.
|
||||||
|
bindsym XF86AudioMute exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume mute && notify-send -t $v_time "Volume Muted" $(volume)'
|
||||||
|
bindsym $ctrl+XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_micro && notify-send -t $v_time "Volume + " $(volume)'
|
||||||
|
bindsym $ctrl+XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_micro && notify-send -t $v_time "Volume - " $(volume)'
|
||||||
|
bindsym XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_small && notify-send -t $v_time "Volume ++ " $(volume)'
|
||||||
|
bindsym XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_small && notify-send -t $v_time "Volume -- " $(volume)'
|
||||||
|
bindsym $shift+XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_large && notify-send -t $v_time "Volume +++ " $(volume)'
|
||||||
|
bindsym $shift+XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_large && notify-send -t $v_time "Volume --- " $(volume)'
|
||||||
|
|
||||||
|
bindsym $mod+slash exec pavucontrol
|
||||||
|
|
||||||
|
|
||||||
|
## Workspaces ##
|
||||||
|
|
||||||
|
# Define names for default workspaces for which we configure key bindings later on.
|
||||||
|
# We use variables to avoid repeating the names in multiple places.
|
||||||
|
# Command Line
|
||||||
|
set $ws1 "1 - CMD"
|
||||||
|
# Web Surfing
|
||||||
|
set $ws2 "2 - WEB"
|
||||||
|
# Programming
|
||||||
|
set $ws3 "3 - PRG"
|
||||||
|
# Android (Flutter, Qt, Kivy, etc)
|
||||||
|
set $ws4 "4 - AND"
|
||||||
|
# Chats
|
||||||
|
set $ws5 "5 - CHT"
|
||||||
|
# Other
|
||||||
|
set $ws6 "6 - OTH"
|
||||||
|
# Torrents
|
||||||
|
set $ws7 "7 - TOR"
|
||||||
|
# Music
|
||||||
|
set $ws8 "8 - MUS"
|
||||||
|
# Videos
|
||||||
|
set $ws9 "9 - VID"
|
||||||
|
# VPNs
|
||||||
|
set $ws0 "10 - VPN"
|
||||||
|
|
||||||
|
# switch to workspace
|
||||||
|
bindsym $mod+1 workspace number $ws1
|
||||||
|
bindsym $mod+2 workspace number $ws2
|
||||||
|
bindsym $mod+3 workspace number $ws3
|
||||||
|
bindsym $mod+4 workspace number $ws4
|
||||||
|
bindsym $mod+5 workspace number $ws5
|
||||||
|
bindsym $mod+6 workspace number $ws6
|
||||||
|
bindsym $mod+7 workspace number $ws7
|
||||||
|
bindsym $mod+8 workspace number $ws8
|
||||||
|
bindsym $mod+9 workspace number $ws9
|
||||||
|
bindsym $mod+0 workspace number $ws0
|
||||||
|
|
||||||
|
# move focused container to workspace
|
||||||
|
bindsym $mod+Shift+1 move container to workspace number $ws1
|
||||||
|
bindsym $mod+Shift+2 move container to workspace number $ws2
|
||||||
|
bindsym $mod+Shift+3 move container to workspace number $ws3
|
||||||
|
bindsym $mod+Shift+4 move container to workspace number $ws4
|
||||||
|
bindsym $mod+Shift+5 move container to workspace number $ws5
|
||||||
|
bindsym $mod+Shift+6 move container to workspace number $ws6
|
||||||
|
bindsym $mod+Shift+7 move container to workspace number $ws7
|
||||||
|
bindsym $mod+Shift+8 move container to workspace number $ws8
|
||||||
|
bindsym $mod+Shift+9 move container to workspace number $ws9
|
||||||
|
bindsym $mod+Shift+0 move container to workspace number $ws0
|
||||||
|
|
||||||
|
## Keep certain programs in certain tabs. ##
|
||||||
|
# Use the `xprop` command to find the class of a program.
|
||||||
|
# (?i) makes the regex case insensitive.
|
||||||
|
|
||||||
|
assign [class="Navigator"] $ws2
|
||||||
|
assign [class="(?i).*navigator.*"] $ws2
|
||||||
|
assign [class="(?i).*firefox.*"] $ws2
|
||||||
|
assign [class="(?i).*librewolf.*"] $ws2
|
||||||
|
assign [class="(?i).*brave.*"] $ws2
|
||||||
|
|
||||||
|
assign [class="(?i).*codium.*"] $ws3
|
||||||
|
assign [class="(?i).*code.*"] $ws3
|
||||||
|
|
||||||
|
assign [class="(?i).*flutter.*"] $ws4
|
||||||
|
assign [class="(?i).*jetbrains.*"] $ws4
|
||||||
|
|
||||||
|
assign [class="(?i).*signal.*"] $ws5
|
||||||
|
assign [class="(?i).*telegram.*"] $ws5
|
||||||
|
assign [class="(?i).*session.*"] $ws5
|
||||||
|
assign [class="(?i).*dino.*"] $ws5
|
||||||
|
|
||||||
|
assign [class="(?i).*pavucontrol.*"] $ws6
|
||||||
|
assign [class="(?i).*blueman.*"] $ws6
|
||||||
|
assign [class="(?i).*boxes.*"] $ws6
|
||||||
|
assign [class="(?i).*waydroid.*"] $ws6
|
||||||
|
|
||||||
|
assign [class="(?i).*transmission.*"] $ws7
|
||||||
|
|
||||||
|
assign [class="(?i).*rhythmbox.*"] $ws8
|
||||||
|
assign [class="(?i).*strawberry.*"] $ws8
|
||||||
|
|
||||||
|
assign [class="(?i).*vlc.*"] $ws9
|
||||||
|
assign [class="(?i).*mpv.*"] $ws9
|
||||||
|
|
||||||
|
assign [class="(?i).*vpn.*"] $ws0
|
||||||
|
assign [class="(?i).*mullvad.*"] $ws0
|
||||||
|
|
||||||
|
|
||||||
|
## Workspace Specific Workflows ##
|
||||||
|
bindsym $ctrl+$shift+1 workspace $ws1; exec "i3-sensible-terminal & gnome-system-monitor"
|
||||||
|
bindsym $ctrl+$shift+2 workspace $ws2; exec $FIREFOX
|
||||||
|
bindsym $ctrl+$shift+3 workspace $ws3; exec "(codium || vscodium || codium-flatpak || vscodium-flatpak)"
|
||||||
|
bindsym $ctrl+$shift+4 workspace $ws4; exec "android-studio || android-studio-flatpak"
|
||||||
|
bindsym $ctrl+$shift+5 workspace $ws5; exec "(signal || signal-flatpak) & (dino || dino-flatpak)"
|
||||||
|
# & (forkgram || forkgram-flatpak || telegram || telegram-flatpak)"
|
||||||
|
bindsym $alt+$shift+5 workspace $ws5; exec "(forkgram || forkgram-flatpak || telegram || telegram-flatpak) & (session || session-flatpak)"
|
||||||
|
bindsym $ctrl+$shift+6 workspace $ws6; exec "pavucontrol & blueman-manager"
|
||||||
|
bindsym $ctrl+$shift+7 workspace $ws7; exec $TRANSMISSION
|
||||||
|
bindsym $ctrl+$shift+8 workspace $ws8; exec strawberry
|
||||||
|
bindsym $ctrl+$shift+9 workspace $ws9; exec thunar
|
||||||
|
bindsym $ctrl+$shift+0 workspace $ws0; exec mullvad-vpn
|
||||||
|
|
||||||
|
|
||||||
|
## Reloads, Restarts, Exit ##
|
||||||
|
|
||||||
|
# reload the configuration file
|
||||||
|
bindsym $mod+Shift+c reload
|
||||||
|
|
||||||
|
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||||
|
bindsym $mod+Shift+r restart
|
||||||
|
|
||||||
|
# exit i3 (logs you out of your X session)
|
||||||
|
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
|
||||||
|
bindsym $mod+Shift+q exec "i3-msg exit"
|
||||||
|
|
||||||
|
# lock
|
||||||
|
bindsym $ctrl+$alt+l exec "i3lock -c 000000 -e -f && sleep 1 && xset dpms force off"
|
||||||
|
bindsym $ctrl+$mod+l exec "i3lock -c 000000 -e -f && sleep 1 && xset dpms force off"
|
||||||
|
bindsym $shift+$mod+l exec "i3lock -c 000000 -e -f && sleep 1 && xset dpms force off"
|
||||||
|
|
||||||
|
# shutdown entire system.
|
||||||
|
#bindsym $ctrl+$shift+q exec dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
|
||||||
|
bindsym $ctrl+$alt+$mod+q exec sudo shutdown -h now
|
||||||
|
bindsym $shift+$alt+$mod+q exec sudo shutdown -h now
|
||||||
|
bindsym $shift+$ctrl+$mod+q exec sudo shutdown -h now
|
||||||
|
|
||||||
|
# restart entire system.
|
||||||
|
bindsym $ctrl+$alt+$mod+r exec sudo shutdown -r now
|
||||||
|
bindsym $shift+$alt+$mod+r exec sudo shutdown -r now
|
||||||
|
bindsym $shift+$ctrl+$mod+r exec sudo shutdown -r now
|
||||||
|
|
||||||
|
# restart LLM programs
|
||||||
|
set $RESTART_LLMS "sudo sv restart ollama; sudo sv restart zeroclaw; sudo sv restart open-webui"
|
||||||
|
bindsym $ctrl+$alt+delete exec $RESTART_LLMS
|
||||||
|
bindsym $shift+$alt+delete exec $RESTART_LLMS
|
||||||
|
bindsym $shift+$ctrl+delete exec $RESTART_LLMS
|
||||||
|
|
||||||
|
|
||||||
|
## Resizing (Disabled) ##
|
||||||
|
|
||||||
|
# resize window (you can also use the mouse for that)
|
||||||
|
#mode "resize" {
|
||||||
|
# # These bindings trigger as soon as you enter the resize mode
|
||||||
|
#
|
||||||
|
# # Pressing left will shrink the window’s width.
|
||||||
|
# # Pressing right will grow the window’s width.
|
||||||
|
# # Pressing up will shrink the window’s height.
|
||||||
|
# # Pressing down will grow the window’s height.
|
||||||
|
# bindsym j resize shrink width 10 px or 10 ppt
|
||||||
|
# bindsym k resize grow height 10 px or 10 ppt
|
||||||
|
# bindsym l resize shrink height 10 px or 10 ppt
|
||||||
|
# bindsym semicolon resize grow width 10 px or 10 ppt
|
||||||
|
#
|
||||||
|
# # same bindings, but for the arrow keys
|
||||||
|
# bindsym Left resize shrink width 10 px or 10 ppt
|
||||||
|
# bindsym Down resize grow height 10 px or 10 ppt
|
||||||
|
# bindsym Up resize shrink height 10 px or 10 ppt
|
||||||
|
# bindsym Right resize grow width 10 px or 10 ppt
|
||||||
|
#
|
||||||
|
# # back to normal: Enter or Escape or $mod+r
|
||||||
|
# bindsym Return mode "default"
|
||||||
|
# bindsym Escape mode "default"
|
||||||
|
# bindsym $mod+r mode "default"
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
#bindsym $mod+r mode "resize"
|
||||||
|
|
||||||
|
|
||||||
|
## Taskbar ##
|
||||||
|
|
||||||
|
# Start i3bar to display a workspace bar (plus the system information i3status
|
||||||
|
# finds out, if available)
|
||||||
|
bar {
|
||||||
|
status_command i3status
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
## Startup Applications ##
|
||||||
|
|
||||||
|
# Workspace 1
|
||||||
|
exec --no-startup-id i3-sensible-terminal
|
||||||
|
exec --no-startup-id gnome-system-monitor
|
||||||
|
|
||||||
|
# Respective Workspaces
|
||||||
|
exec --no-startup-id mullvad-vpn
|
||||||
|
exec --no-startup-id $TRANSMISSION
|
||||||
|
|
||||||
|
# Set defaults for laptop backlights.
|
||||||
|
exec --no-startup-id "light -S 20; light -N 5; light -O"
|
||||||
|
|
||||||
|
# Set the correct keymap.
|
||||||
|
exec_always --no-startup-id setxkbmap -layout us -variant altgr-intl
|
||||||
|
|
||||||
|
# Notifications (allows fyi and notify-send to work)
|
||||||
|
exec_always --no-startup-id "killall dunst; dunst"
|
||||||
|
|
||||||
|
# Audio
|
||||||
|
exec --no-startup-id "sleep 00; dbus-launch --exit-with-session i3"
|
||||||
|
exec_always --no-startup-id "sleep 00; killall pipewire wireplumber pipewire-pulse"
|
||||||
|
exec_always --no-startup-id "sleep 01; pipewire >~/Reports/pipewire.log 2>&1 &"
|
||||||
|
exec_always --no-startup-id "sleep 02; wireplumber >~/Reports/wireplumber.log 2>&1 &"
|
||||||
|
exec_always --no-startup-id "sleep 03; pipewire-pulse >~/Reports/pipewire-pulse.log 2>&1 &"
|
||||||
|
exec --no-startup-id "sleep 04; bash -c 'source /usr/local/bin/volume.function && volume 25'"
|
||||||
|
|
||||||
|
# Wallpaper
|
||||||
|
exec_always --no-startup-id feh --recursive --randomize --bg-fill ~/Pictures/Wallpapers
|
||||||
|
|
||||||
|
# Compositor
|
||||||
|
exec_always --no-startup-id "killall picom; picom -f --backend xrender"
|
||||||
|
|
||||||
|
# Battery
|
||||||
|
exec_always --no-startup-id bash -c 'pkill -ef "bash `which battery_nag.sh`" >~/Reports/battery_nag.log 2>&1; battery_nag.sh >>~/Reports/battery_nag.log 2>&1'
|
||||||
|
|
||||||
|
# Redshift
|
||||||
|
#exec_always --no-startup-id "killall redshift-gtk; redshift-gtk"
|
||||||
|
#exec_always --no-startup-id "killall redshift; redshift -l 35.19540:-111.65720 -t 6500K:1100K"
|
||||||
|
exec_always --no-startup-id "killall redshift; killall redshift-gtk; sleep 1; redshift -x; redshift-gtk -l 35.19540:-111.65720 -t 6500K:1100K"
|
||||||
+37
-18
@@ -4,25 +4,44 @@
|
|||||||
"save_loc2": "~/.var/app/com.vscodium.codium/config/VSCodium/{{ user_desc }}/settings.json",
|
"save_loc2": "~/.var/app/com.vscodium.codium/config/VSCodium/{{ user_desc }}/settings.json",
|
||||||
"END_COMMENTS": "",
|
"END_COMMENTS": "",
|
||||||
|
|
||||||
|
"update.showReleaseNotes": false,
|
||||||
"workbench.startupEditor": "none",
|
"workbench.startupEditor": "none",
|
||||||
"editor.rulers": [
|
|
||||||
80, 120, 200
|
|
||||||
],
|
|
||||||
"files.trimTrailingWhitespace": true,
|
|
||||||
"editor.tabSize": 3,
|
|
||||||
"editor.insertSpaces": false,
|
|
||||||
"files.insertFinalNewline": true,
|
|
||||||
"[html]": {
|
|
||||||
"files.insertFinalNewline": false
|
|
||||||
},
|
|
||||||
"files.trimFinalNewlines": true,
|
|
||||||
"git.confirmSync": false,
|
"git.confirmSync": false,
|
||||||
|
|
||||||
"[dart]": {
|
"editor.rulers": [
|
||||||
"editor.formatOnSave": true,
|
80, 120, 200,
|
||||||
"editor.formatOnType": true,
|
],
|
||||||
"editor.selectionHighlight": false,
|
|
||||||
"editor.tabCompletion": "onlySnippets",
|
"files.trimFinalNewlines": true,
|
||||||
"editor.wordBasedSuggestions": "off"
|
"files.trimTrailingWhitespace": true,
|
||||||
}
|
|
||||||
|
"editor.tabSize": 3,
|
||||||
|
"editor.insertSpaces": false,
|
||||||
|
|
||||||
|
"editor.autoClosingBrackets": "never",
|
||||||
|
"editor.autoClosingQuotes": "never",
|
||||||
|
|
||||||
|
"files.insertFinalNewline": true,
|
||||||
|
"[html]": {
|
||||||
|
"files.insertFinalNewline": false,
|
||||||
|
},
|
||||||
|
|
||||||
|
"[dart]": {
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.formatOnType": true,
|
||||||
|
"editor.selectionHighlight": false,
|
||||||
|
"editor.tabCompletion": "onlySnippets",
|
||||||
|
"editor.wordBasedSuggestions": "off",
|
||||||
|
},
|
||||||
|
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["*.json", "*.jsonc"],
|
||||||
|
"schema": {
|
||||||
|
"allowTrailingCommas": true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"redhat.telemetry.enabled": false,
|
||||||
}
|
}
|
||||||
@@ -1,2 +1,8 @@
|
|||||||
|
|
||||||
%sudo ALL=(ALL) ALL
|
%sudo ALL=(ALL) ALL
|
||||||
|
|
||||||
|
# Allow anyone in the sudo group to shutdown or reboot without a password.
|
||||||
|
%sudo ALL=(ALL) NOPASSWD: /sbin/shutdown, /usr/sbin/shutdown, /sbin/reboot, /usr/sbin/reboot
|
||||||
|
|
||||||
|
# Allow the sudo group to manage runit services.
|
||||||
|
%sudo ALL=(ALL) NOPASSWD: /sbin/sv, /usr/sbin/sv, /sbin/sv, /usr/sbin/sv
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,22 @@
|
|||||||
|
# title
|
||||||
|
|
||||||
|
NAME
|
||||||
|
|
||||||
|
# desc
|
||||||
|
|
||||||
|
CONTENT
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Recorded and edited YYYY-MM-DD.
|
||||||
|
Recorded YYYY-MM-DD, edited YYYY-MM-DD.
|
||||||
|
|
||||||
|
[blog.hyperling.com/TBD](https://blog.hyperling.com/TBD)
|
||||||
|
|
||||||
|
# tags
|
||||||
|
|
||||||
|
-
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
|
,
|
||||||
@@ -2,252 +2,236 @@
|
|||||||
# Harmonize systems rather than doing everything manually. :)
|
# Harmonize systems rather than doing everything manually. :)
|
||||||
|
|
||||||
# Setup of any device connected to this repo.
|
# Setup of any device connected to this repo.
|
||||||
- name: Main | Default Setup
|
- name: Local | Main
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
connection: local
|
connection: local
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
####### Gather #######
|
####### Header #######
|
||||||
# Load facts for all systems.
|
|
||||||
|
|
||||||
- include_tasks: facts/general/gather.yml
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/provision_config.yml
|
|
||||||
|
|
||||||
- include_tasks: facts/general/system.yml
|
|
||||||
- include_tasks: facts/general/package.yml
|
|
||||||
- include_tasks: facts/general/service.yml
|
|
||||||
- include_tasks: facts/general/user.yml
|
|
||||||
|
|
||||||
|
|
||||||
####### NixOS #######
|
|
||||||
# Install the .nix files and do a little data setup.
|
|
||||||
|
|
||||||
- name: Main | NixOS Setup
|
|
||||||
block:
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/nixos.yml
|
|
||||||
|
|
||||||
|
|
||||||
# TBD if we are going to use this many, then just have IF statements
|
|
||||||
# and use blocks within the General area for NixOS vs not-NixOS.
|
|
||||||
- include_tasks: tasks/general/software/swap.yml
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/groups.yml
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/users.yml
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/sudo.yml
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/doas.yml
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/scripts/root.yml
|
|
||||||
- include_tasks: tasks/general/scripts/user.yml
|
|
||||||
- include_tasks: tasks/general/scripts/install.yml
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/cron/ansible.yml
|
|
||||||
|
|
||||||
# psutil does not work in NixOS. Cannot figure out how to fix it. Maybe
|
|
||||||
# time to start looking into home-manager but still not wanting to
|
|
||||||
# maintain two different GNOME setups. HMMMM!
|
|
||||||
- include_tasks: tasks/workstation/shared/settings/gnome.yml
|
|
||||||
when: workstation == true
|
|
||||||
|
|
||||||
# Try including these. Really need to get NixOS working with the rest!
|
|
||||||
#- include_tasks: tasks/general/software/telegraf.yml # "Could not find a module for unknown.""
|
|
||||||
- include_tasks: tasks/general/tests/services.yml
|
|
||||||
- include_tasks: tasks/general/tests/lynis.yml
|
|
||||||
- include_tasks: tasks/general/tests/nmap.yml
|
|
||||||
|
|
||||||
- name: NixOS | Complete
|
|
||||||
meta: end_play
|
|
||||||
|
|
||||||
when: ansible_distribution == "NixOS"
|
|
||||||
|
|
||||||
|
|
||||||
####### General #######
|
|
||||||
# Basic setup for all enabled systems.
|
|
||||||
|
|
||||||
- name: Main | General Setup
|
|
||||||
block:
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/swap.yml
|
|
||||||
- include_tasks: tasks/general/software/packages.yml
|
|
||||||
- include_tasks: tasks/general/software/services.yml
|
|
||||||
- include_tasks: tasks/general/software/sendmail.yml
|
|
||||||
when: ansible_system == "FreeBSD"
|
|
||||||
|
|
||||||
# Gather again in case missing programs have now been installed.
|
|
||||||
- include_tasks: facts/general/gather.yml
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/groups.yml
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/users.yml
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/sudo.yml
|
|
||||||
- include_tasks: tasks/general/acct_mgmt/doas.yml
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/scripts/root.yml
|
|
||||||
- include_tasks: tasks/general/scripts/user.yml
|
|
||||||
- include_tasks: tasks/general/scripts/install.yml
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/cron/ansible.yml
|
|
||||||
|
|
||||||
# TODO Need to refactor. Maybe tasks/general/cron/freebsd.yml
|
|
||||||
- include_tasks: tasks/workstation/freebsd/cron/ansible.yml
|
|
||||||
when: ansible_system == "FreeBSD"
|
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/metasploit.yml
|
|
||||||
when: pentesting == true
|
|
||||||
|
|
||||||
when: provision == true
|
|
||||||
|
|
||||||
|
- name: Main | Header
|
||||||
|
ansible.builtin.include_tasks: tasks/header.yml
|
||||||
|
|
||||||
####### Workstations #######
|
####### Workstations #######
|
||||||
# Additional setup for systems with GUI.
|
|
||||||
|
|
||||||
- name: Main | Workstation Setup
|
# Additional setup for systems with GUI.
|
||||||
|
- name: Main | Workstation
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- include_tasks: facts/workstation/package.yml
|
- ansible.builtin.include_tasks: facts/workstation/package.yml
|
||||||
|
|
||||||
# Set Up Desktop Environments #
|
## Desktop Environments ##
|
||||||
- include_tasks: tasks/workstation/freebsd/software/gpu.yml
|
- ansible.builtin.include_tasks: tasks/workstation/freebsd/software/gpu.yml
|
||||||
when: ansible_system == "FreeBSD" and bsd_gpu == true
|
when: ansible_system == "FreeBSD"
|
||||||
|
and bsd_gpu
|
||||||
|
and internet
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/freebsd/software/gnome.yml
|
# Window Managers without true Desktop Environments #
|
||||||
when: ansible_system == "FreeBSD"
|
- ansible.builtin.include_tasks: tasks/workstation/shared/software/dwm.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/linux/software/gnome.yml
|
- ansible.builtin.include_tasks: tasks/workstation/shared/software/i3.yml
|
||||||
when: ansible_system == "Linux"
|
when: internet
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/shared/software/dwm.yml
|
# Polished Desktop Environments #
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/freebsd/software/gnome.yml
|
||||||
|
when: ansible_system == "FreeBSD"
|
||||||
|
and internet
|
||||||
|
|
||||||
# Software Tasks #
|
- name: Main | Workstation | Fancy Desktop Environments
|
||||||
- include_tasks: tasks/workstation/linux/software/packages.yml
|
block:
|
||||||
when: ansible_system == "Linux"
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/linux/software/lutris.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/gnome.yml
|
||||||
when: ansible_system == "Linux"
|
when: ansible_service_mgr == "systemd"
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/linux/software/vscodium.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/cinnamon.yml
|
||||||
when: ansible_system == "Linux"
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/linux/software/brave.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/lxqt.yml
|
||||||
when: ansible_pkg_mgr in ("apt", "dnf", "zypper") and not mobile
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/linux/software/vpn.yml
|
when: ansible_system == "Linux"
|
||||||
when: ansible_system == "Linux"
|
and internet
|
||||||
|
# TBD: Implement this: and extra_desktops
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/freebsd/software/packages.yml
|
## Software Tasks ##
|
||||||
when: ansible_system == "FreeBSD"
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/mac-os/software/brew.yml
|
- name: Main | Workstation | Linux
|
||||||
when: ansible_system == "Darwin"
|
block:
|
||||||
|
|
||||||
# Configuration Tasks #
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/packages.yml
|
||||||
- include_tasks: tasks/workstation/shared/settings/gnome.yml
|
|
||||||
when: not mobile
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/linux/cron/ansible.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/tlp.yml
|
||||||
when: ansible_system == "Linux" and not mobile
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/shared/settings/nfs.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/lutris.yml
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/shared/settings/rdp.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/vscodium.yml
|
||||||
when: rdp == true
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/shared/settings/vnc.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/vpn.yml
|
||||||
when: vnc == true
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/shared/settings/services.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/nodejs.yml
|
||||||
|
|
||||||
# Final Tasks (SLOW) #
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/hugo.yml
|
||||||
- include_tasks: tasks/workstation/linux/software/flutter.yml
|
|
||||||
when: ansible_system == "Linux"
|
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/linux/software/android.yml
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/brave.yml
|
||||||
when: ansible_system == "Linux"
|
when: ansible_pkg_mgr in ("apt", "dnf", "zypper") and not mobile
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/linux/software/flatpaks.yml
|
when: ansible_system == "Linux"
|
||||||
when: ansible_system == "Linux" and flatpak_distro
|
and internet
|
||||||
|
|
||||||
when: workstation == true
|
- ansible.builtin.include_tasks: tasks/workstation/freebsd/software/packages.yml
|
||||||
|
when: ansible_system == "FreeBSD"
|
||||||
|
and internet
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/mac-os/software/brew.yml
|
||||||
|
when: ansible_system == "Darwin"
|
||||||
|
and internet
|
||||||
|
|
||||||
|
## Configuration Tasks ##
|
||||||
|
|
||||||
|
- name: Main | Workstation | Configuration
|
||||||
|
block:
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/gnome.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/cinnamon.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/xdg_autostart.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/linux/cron/ansible.yml
|
||||||
|
when: ansible_system == "Linux"
|
||||||
|
|
||||||
|
when: not mobile
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/nfs.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/rdp.yml
|
||||||
|
when: rdp
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/vnc.yml
|
||||||
|
when: vnc
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/services.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/templates.yml
|
||||||
|
|
||||||
|
## Final Tasks (SLOW) ##
|
||||||
|
|
||||||
|
- name: Main | Workstation | Linux [Slow]
|
||||||
|
block:
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/flatpaks.yml
|
||||||
|
when: flatpak_distro
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/java.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/flutter.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/android.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/linux/software/llm.yml
|
||||||
|
|
||||||
|
when: ansible_system == "Linux"
|
||||||
|
and internet
|
||||||
|
|
||||||
|
when: workstation
|
||||||
|
|
||||||
# No longer mining, this is now considered deprecated.
|
# No longer mining, this is now considered deprecated.
|
||||||
# ####### Miners #######
|
# ####### Miners #######
|
||||||
#
|
#
|
||||||
# # Additional setup for miners.
|
# # Additional setup for miners.
|
||||||
# - name: Main | Miner Setup
|
# - name: Main | Miner
|
||||||
# block:
|
# block:
|
||||||
#
|
#
|
||||||
# ##### Setup #####
|
# ##### Setup #####
|
||||||
# - include_tasks: tasks/miner/debug.yml
|
# - ansible.builtin.include_tasks: tasks/miner/debug.yml
|
||||||
#
|
#
|
||||||
# - include_tasks: tasks/miner/acct_mgmt/users.yml
|
# - ansible.builtin.include_tasks: tasks/miner/acct_mgmt/users.yml
|
||||||
#
|
#
|
||||||
# - include_tasks: facts/miner/system.yml
|
# - ansible.builtin.include_tasks: facts/miner/system.yml
|
||||||
# - include_tasks: facts/miner/config.yml
|
# - ansible.builtin.include_tasks: facts/miner/config.yml
|
||||||
# - include_tasks: facts/miner/pool.yml
|
# - ansible.builtin.include_tasks: facts/miner/pool.yml
|
||||||
#
|
#
|
||||||
# ##### Installations #####
|
# ##### Installations #####
|
||||||
# ### CPU SECTION ###
|
# ### CPU SECTION ###
|
||||||
# # Monero #
|
# # Monero #
|
||||||
# - include_tasks: tasks/miner/software/xmr-stak-cpu.yml
|
# - ansible.builtin.include_tasks: tasks/miner/software/xmr-stak-cpu.yml
|
||||||
# when: xmr_stak_cpu is defined
|
# when: xmr_stak_cpu is defined
|
||||||
#
|
#
|
||||||
# ### GPU Section ###
|
# ### GPU Section ###
|
||||||
# ## Drivers ##
|
# ## Drivers ##
|
||||||
# - include_tasks: tasks/miner/drivers/amdgpu.yml
|
# - ansible.builtin.include_tasks: tasks/miner/drivers/amdgpu.yml
|
||||||
# when: ansible_distribution == "Ubuntu" and amdgpu == true
|
# when: ansible_distribution == "Ubuntu" and amdgpu
|
||||||
#
|
#
|
||||||
# # Ethereum #
|
# # Ethereum #
|
||||||
# - include_tasks: tasks/miner/software/ethminer.yml
|
# - ansible.builtin.include_tasks: tasks/miner/software/ethminer.yml
|
||||||
# when: ethminer == true
|
# when: ethminer
|
||||||
#
|
#
|
||||||
# - include_tasks: tasks/miner/software/nanominer.yml
|
# - ansible.builtin.include_tasks: tasks/miner/software/nanominer.yml
|
||||||
# when: nanominer == true
|
# when: nanominer
|
||||||
#
|
#
|
||||||
# ##### Scheduling #####
|
# ##### Scheduling #####
|
||||||
# - include_tasks: tasks/miner/cron/ansible.yml
|
# - ansible.builtin.include_tasks: tasks/miner/cron/ansible.yml
|
||||||
# - include_tasks: tasks/miner/cron/mfn.yml
|
# - ansible.builtin.include_tasks: tasks/miner/cron/mfn.yml
|
||||||
#
|
#
|
||||||
# when: miner == true
|
# when: miner
|
||||||
|
|
||||||
|
|
||||||
####### Servers #######
|
####### Servers #######
|
||||||
# Easy to deploy server configurations.
|
|
||||||
|
|
||||||
- name: Main | Server Setup
|
# Easy to deploy server configurations.
|
||||||
|
- name: Main | Server
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/services.yml
|
- name: Main | Server | Services
|
||||||
|
ansible.builtin.include_tasks: tasks/server/software/services.yml
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/certbot.yml
|
- block:
|
||||||
when: certbot == true
|
|
||||||
- include_tasks: tasks/server/cron/certbot.yml
|
|
||||||
when: certbot == true
|
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/onlyoffice.yml
|
- name: Main | Server | Certbot
|
||||||
when: onlyoffice == true and ansible_pkg_mgr == "apt"
|
ansible.builtin.include_tasks: tasks/server/software/certbot.yml
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/influxdb1.yml
|
- name: Main | Server | Certbot Cron
|
||||||
when: influxdb1 == true and ansible_pkg_mgr == "apt"
|
ansible.builtin.include_tasks: tasks/server/cron/certbot.yml
|
||||||
|
when: certbot
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/influxdb2.yml
|
- block:
|
||||||
when: influxdb2 == true and ansible_pkg_mgr == "apt"
|
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/grafana.yml
|
- name: Main | Server | OnlyOffice
|
||||||
when: grafana == true and ansible_pkg_mgr == "apt"
|
ansible.builtin.include_tasks: tasks/server/software/onlyoffice.yml
|
||||||
|
when: onlyoffice
|
||||||
|
|
||||||
- include_tasks: tasks/server/software/hugo.yml
|
- ansible.builtin.include_tasks: tasks/server/software/influxdb1.yml
|
||||||
when: hugo == true
|
when: influxdb1
|
||||||
|
|
||||||
when: server == true
|
- ansible.builtin.include_tasks: tasks/server/software/influxdb2.yml
|
||||||
|
when: influxdb2
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/server/software/grafana.yml
|
||||||
|
when: grafana
|
||||||
|
|
||||||
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/server/software/hugo.yml
|
||||||
|
when: hugo
|
||||||
|
|
||||||
|
when: server
|
||||||
|
|
||||||
####### Reporting #######
|
####### Reporting #######
|
||||||
|
|
||||||
# Provide information for analysis.
|
# Provide information for analysis.
|
||||||
|
- name: Main | Reporting
|
||||||
|
block:
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/telegraf.yml
|
- ansible.builtin.include_tasks: tasks/general/software/telegraf.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
- include_tasks: tasks/general/tests/services.yml
|
- ansible.builtin.include_tasks: tasks/general/tests/services.yml
|
||||||
- include_tasks: tasks/general/tests/lynis.yml
|
|
||||||
- include_tasks: tasks/general/tests/nmap.yml
|
- ansible.builtin.include_tasks: tasks/general/tests/lynis.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/tests/nmap.yml
|
||||||
|
|
||||||
|
####### Footer #######
|
||||||
|
|
||||||
|
- name: Main | Footer
|
||||||
|
ansible.builtin.include_tasks: tasks/footer.yml
|
||||||
@@ -5,14 +5,26 @@
|
|||||||
|
|
||||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
LOCAL=$DIR/local.yml
|
LOCAL="$DIR/local.yml"
|
||||||
|
TEST="$DIR/test.yml"
|
||||||
URL="https://git.hyperling.com/me/env-ansible"
|
URL="https://git.hyperling.com/me/env-ansible"
|
||||||
BRANCH="main"
|
if [[ -z $BRANCH ]]; then
|
||||||
|
export BRANCH="main"
|
||||||
|
fi
|
||||||
|
|
||||||
|
LINUX_HOSTS_DIR=/etc/ansible
|
||||||
|
LINUX_HOSTS_FILE="$LINUX_HOSTS_DIR/hosts"
|
||||||
|
FREEBSD_HOSTS_DIR="/usr/local/etc/ansible"
|
||||||
|
FREEBSD_HOSTS_FILE="$FREEBSD_HOSTS_DIR/hosts"
|
||||||
|
|
||||||
|
HOSTS_DIR="$LINUX_HOSTS_DIR"
|
||||||
|
HOSTS_FILE="$LINUX_HOSTS_FILE"
|
||||||
|
|
||||||
config_dir="/usr/local/etc/hyperling-scm"
|
config_dir="/usr/local/etc/hyperling-scm"
|
||||||
general_config="$config_dir/general.ini"
|
general_config="$config_dir/general.ini"
|
||||||
workstation_config="$config_dir/workstation.ini"
|
workstation_config="$config_dir/workstation.ini"
|
||||||
server_config="$config_dir/server.ini"
|
server_config="$config_dir/server.ini"
|
||||||
|
branch=""
|
||||||
|
|
||||||
## Functions ##
|
## Functions ##
|
||||||
|
|
||||||
@@ -20,7 +32,7 @@ server_config="$config_dir/server.ini"
|
|||||||
function usage {
|
function usage {
|
||||||
cat <<- EOF
|
cat <<- EOF
|
||||||
|
|
||||||
$PROG [-l] [-b branch_name] [-g] [-w] [-s] [-f] [-h]
|
$PROG [-l | -t] [-b branch_name] [-g] [-w] [-s] [-f] [-h]
|
||||||
Program to initialize synchronization with Hyperling's Ansible configuration.
|
Program to initialize synchronization with Hyperling's Ansible configuration.
|
||||||
$URL
|
$URL
|
||||||
|
|
||||||
@@ -28,11 +40,12 @@ function usage {
|
|||||||
-l : Run the local playbook associated with this $PROG.
|
-l : Run the local playbook associated with this $PROG.
|
||||||
This is helpful for development or just saving bandwidth.
|
This is helpful for development or just saving bandwidth.
|
||||||
It also provides prettier colors than the plaintext from ansible-pull. ;)
|
It also provides prettier colors than the plaintext from ansible-pull. ;)
|
||||||
|
-t : Run the test playbook which has a much smaller set of includes.
|
||||||
-b branch_name : Download and run a specific branch. Default is $BRANCH.
|
-b branch_name : Download and run a specific branch. Default is $BRANCH.
|
||||||
-g : Enable the General config with test contents.
|
-g : Enable the General config with test contents.
|
||||||
-w : Enable the Workstation config with test contents.
|
-w : Enable the Workstation config with test contents.
|
||||||
-s : Enable the Server config with test contents.
|
-s : Enable the Server config with test contents.
|
||||||
-f : Display this system's facts.
|
-f : Display this system's facts.
|
||||||
-h : Display this help text.
|
-h : Display this help text.
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -41,14 +54,15 @@ function usage {
|
|||||||
|
|
||||||
## Parameter Parsing ##
|
## Parameter Parsing ##
|
||||||
|
|
||||||
while getopts ":lb:gwsfh" arg; do
|
while getopts ":ltb:gwsfh" arg; do
|
||||||
case $arg in
|
case $arg in
|
||||||
l) local="Y" && echo "Running $LOCAL as the playbook." ;;
|
l) local="Y" && echo "Running $LOCAL as the playbook." ;;
|
||||||
|
t) test="Y" && echo "Running $TEST as the playbook." ;;
|
||||||
b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;;
|
b) branch="$OPTARG" && echo "Using branch $branch instead of $BRANCH." ;;
|
||||||
g) create_general="Y" && echo "Requested '$general_config'." ;;
|
g) create_general="Y" && echo "Generating test '$general_config'." ;;
|
||||||
w) create_workstation="Y" && echo "Requested '$workstation_config'." ;;
|
w) create_workstation="Y" && echo "Generating test '$workstation_config'." ;;
|
||||||
s) create_server="Y" && echo "Requested '$server_config'." ;;
|
s) create_server="Y" && echo "Generating test '$server_config'." ;;
|
||||||
f) show_facts="Y" ;;
|
f) show_facts="Y" && echo "Displaying ansible facts then exiting." ;;
|
||||||
h) usage ;;
|
h) usage ;;
|
||||||
*) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;;
|
*) echo "ERROR: Parameter $OPTARG was not recognized." && usage 1 ;;
|
||||||
esac
|
esac
|
||||||
@@ -60,9 +74,14 @@ if [[ ! -z $1 && $1 != "-"* ]]; then
|
|||||||
usage 1
|
usage 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$local" && "$branch" == "" ]]; then
|
if [[ "$branch" == "" ]]; then
|
||||||
echo "Using default branch $BRANCH."
|
|
||||||
branch="$BRANCH"
|
branch="$BRANCH"
|
||||||
|
if [[ -z "$local" ]]; then
|
||||||
|
echo "Running against default branch '$branch'."
|
||||||
|
else
|
||||||
|
echo "Set branch to '$branch'."
|
||||||
|
fi
|
||||||
|
echo " "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$create_general" && -f "$general_config" ]]; then
|
if [[ -n "$create_general" && -f "$general_config" ]]; then
|
||||||
@@ -92,52 +111,52 @@ if [[ `which ansible > /dev/null; echo $?` != 0 ]]; then
|
|||||||
if [[ $os == *Debian* || $os == *Ubuntu* || $os == *"Pop!_OS"* || $os == *Mint* || $os == *Parrot* ]]; then
|
if [[ $os == *Debian* || $os == *Ubuntu* || $os == *"Pop!_OS"* || $os == *Mint* || $os == *Parrot* ]]; then
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y ansible git <<< N
|
sudo apt install -y ansible git <<< N
|
||||||
sudo mkdir -p /etc/ansible
|
|
||||||
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
|
|
||||||
elif [[ $os == *FreeBSD* ]]; then
|
elif [[ $os == *FreeBSD* ]]; then
|
||||||
sudo pkg install -y py38-ansible git
|
sudo pkg install -y -g py*-ansible git
|
||||||
sudo mkdir -p /usr/local/etc/ansible
|
HOSTS_DIR="$FREEBSD_HOSTS_DIR"
|
||||||
sudo sh -c 'echo "localhost ansible_connection=local" > /usr/local/etc/ansible/hosts'
|
HOSTS_FILE="$FREEBSD_HOSTS_FILE"
|
||||||
elif [[ $os == *Arch* || $os == *Manjaro* || $os == *Artix* ]]; then
|
elif [[ $os == *Arch* || $os == *Manjaro* || $os == *Artix* ]]; then
|
||||||
sudo pacman -Sy --noconfirm ansible git
|
sudo pacman -Sy --noconfirm ansible git
|
||||||
sudo mkdir -p /etc/ansible
|
|
||||||
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
|
|
||||||
elif [[ $os == *Darwin* ]]; then
|
elif [[ $os == *Darwin* ]]; then
|
||||||
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||||
echo "TESTING - EXIT!"
|
|
||||||
exit 0
|
|
||||||
brew install ansible git
|
brew install ansible git
|
||||||
|
HOSTS_DIR=""
|
||||||
|
HOSTS_FILE=""
|
||||||
elif [[ $os == *Fedora* ]]; then
|
elif [[ $os == *Fedora* ]]; then
|
||||||
sudo dnf install -y ansible git python3-libselinux
|
sudo dnf install -y ansible git python3-libselinux
|
||||||
sudo mkdir -p /etc/ansible
|
|
||||||
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
|
|
||||||
elif [[ $os == *openSUSE* ]]; then
|
elif [[ $os == *openSUSE* ]]; then
|
||||||
sudo zypper install -y ansible git
|
sudo zypper install -y ansible git
|
||||||
sudo mkdir -p /etc/ansible
|
|
||||||
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
|
|
||||||
elif [[ $os == *NixOS* ]]; then
|
elif [[ $os == *NixOS* ]]; then
|
||||||
$DIR/files/scripts/nixos.sh -b $branch
|
$DIR/files/scripts/nixos.sh -b $branch
|
||||||
sudo mkdir -p /etc/ansible
|
|
||||||
sudo sh -c 'echo "localhost ansible_connection=local" > /etc/ansible/hosts'
|
|
||||||
else
|
else
|
||||||
echo -e "ERROR: OS not detected."
|
echo -e "ERROR: OS not recognized."
|
||||||
echo -e "$os"
|
echo -e "$os"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "Installed!"
|
echo -e "- Installed!\n"
|
||||||
|
|
||||||
|
if [[ -n $HOSTS_DIR && -n $HOSTS_FILE ]]; then
|
||||||
|
echo "Ensuring hosts file exists..."
|
||||||
|
if [[ ! -e $HOSTS_FILE ]]; then
|
||||||
|
sudo mkdir -pv $HOSTS_DIR
|
||||||
|
sudo sh -c "echo 'localhost ansible_connection=local' > $HOSTS_FILE"
|
||||||
|
fi
|
||||||
|
echo "$HOSTS_FILE: '`cat $HOSTS_FILE`'"
|
||||||
|
echo -e "- Hosts file created successfully!\n"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$show_facts" == "Y" ]]; then
|
if [[ "$show_facts" == "Y" ]]; then
|
||||||
echo "Showing Ansible Facts"
|
echo "Showing Ansible Facts"
|
||||||
ansible localhost -m setup --connection=local
|
ansible localhost -m setup --connection=local
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#echo "Adding Ansible Collections..."
|
#echo "Adding Ansible Collections..."
|
||||||
#ansible-galaxy collection install community.general
|
#ansible-galaxy collection install community.general
|
||||||
#echo "Added!"
|
#echo "- Added!"
|
||||||
|
|
||||||
# Create basic layouts if configs do not exist and are requested.
|
# Create basic layouts if configs do not exist and are requested.
|
||||||
|
|
||||||
if [[ -n "$create_general"
|
if [[ -n "$create_general"
|
||||||
|| -n "$create_workstation"
|
|| -n "$create_workstation"
|
||||||
|| -n "$create_server" ]]
|
|| -n "$create_server" ]]
|
||||||
@@ -145,6 +164,7 @@ then
|
|||||||
sudo mkdir -pv "$config_dir"
|
sudo mkdir -pv "$config_dir"
|
||||||
MARK1="BEGIN"
|
MARK1="BEGIN"
|
||||||
MARK2="END"
|
MARK2="END"
|
||||||
|
echo "Creating placeholder config files..."
|
||||||
fi
|
fi
|
||||||
if [[ -n "$create_general" && ! -f "$general_config" ]]; then
|
if [[ -n "$create_general" && ! -f "$general_config" ]]; then
|
||||||
function print_general_contents {
|
function print_general_contents {
|
||||||
@@ -191,20 +211,52 @@ if [[ -n "$create_server" && ! -f "$server_config" ]]; then
|
|||||||
print_server_contents | sudo tee "$server_config"
|
print_server_contents | sudo tee "$server_config"
|
||||||
ls -lh "$server_config"
|
ls -lh "$server_config"
|
||||||
fi
|
fi
|
||||||
|
if [[ -n "$create_general"
|
||||||
|
|| -n "$create_workstation"
|
||||||
|
|| -n "$create_server" ]]
|
||||||
|
then
|
||||||
|
echo " "
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Verifying this is the only run..."
|
||||||
|
ps -ef | grep ansible-playbook | grep -v grep
|
||||||
|
ansible_exists="$?"
|
||||||
|
lock_file=/tmp/ansible-playbook.lock
|
||||||
|
if [[ "$ansible_exists" == 0 ]]; then
|
||||||
|
echo "- Playbook is already being executed. Exiting."
|
||||||
|
exit 0
|
||||||
|
elif [[ -e "$lock_file" ]]; then
|
||||||
|
echo "- Removing lock file."
|
||||||
|
sudo mv -v "$lock_file" "${lock_file}.disabled"
|
||||||
|
else
|
||||||
|
echo "- No processes or lockfile found."
|
||||||
|
fi
|
||||||
|
echo " "
|
||||||
|
|
||||||
echo "Provisioning Ansible..."
|
echo "Provisioning Ansible..."
|
||||||
if [[ $local == "Y" ]]; then
|
status=""
|
||||||
|
if [[ "$test" == "Y" ]]; then
|
||||||
|
sudo ansible-playbook $TEST
|
||||||
|
status=$?
|
||||||
|
elif [[ "$local" == "Y" ]]; then
|
||||||
sudo ansible-playbook $LOCAL
|
sudo ansible-playbook $LOCAL
|
||||||
|
status=$?
|
||||||
else
|
else
|
||||||
sudo ansible-pull -U $URL.git --checkout $branch
|
sudo ansible-pull -U $URL.git --checkout $branch
|
||||||
|
status=$?
|
||||||
|
fi
|
||||||
|
if [[ "$status" == 0 ]]; then
|
||||||
|
echo -e "- Provisioned!\n"
|
||||||
|
else
|
||||||
|
echo -e "\nERROR: Playbook failed with status $status, exiting."
|
||||||
|
exit $status
|
||||||
fi
|
fi
|
||||||
echo "Provisioned!"
|
|
||||||
|
|
||||||
echo "Mounting all drives..."
|
echo "Mounting all drives..."
|
||||||
mount -a
|
mount -a
|
||||||
echo "Mounted!"
|
echo -e "- Mounted!\n"
|
||||||
|
|
||||||
echo "Don't forget to set any new users' passwords!"
|
echo -e "Don't forget to set any new users' passwords!\n"
|
||||||
|
|
||||||
## Finish ##
|
## Finish ##
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
---
|
||||||
|
# All the tasks which need run to successfully end the playbook.
|
||||||
|
|
||||||
|
####### Footer #######
|
||||||
|
- name: Footer
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Footer | Notify
|
||||||
|
ansible.builtin.include_tasks: tasks/general/acct_mgmt/notify.yml
|
||||||
|
vars:
|
||||||
|
notify_message: "Provisioning Finished"
|
||||||
|
|
||||||
|
- name: Footer | Lock | Remove
|
||||||
|
ansible.builtin.include_tasks: tasks/general/tests/lock_remove.yml
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# Install and configure doas.
|
# Install and configure doas.
|
||||||
|
|
||||||
- name: General | Software | DoAs | Facts
|
- name: General | Software | DoAs | Facts
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
doas_config: |
|
doas_config: |
|
||||||
permit persist :wheel as root
|
permit persist :wheel as root
|
||||||
permit persist :admin as root
|
permit persist :admin as root
|
||||||
@@ -11,43 +11,46 @@
|
|||||||
doas_conf_file_bsd: /usr/local/etc/doas.conf
|
doas_conf_file_bsd: /usr/local/etc/doas.conf
|
||||||
|
|
||||||
- name: General | Software | DoAs | Install
|
- name: General | Software | DoAs | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- doas
|
- doas
|
||||||
register: doas_install
|
register: doas_install
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Software | DoAs | Configure [Linux]
|
- name: General | Software | DoAs | Configure [Linux]
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ doas_conf_file_linux }}"
|
path: "{{ doas_conf_file_linux }}"
|
||||||
block: |
|
block: |
|
||||||
{{ doas_config }}
|
{{ doas_config }}
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | doas Linux'
|
marker: '# {mark} MANAGED BY ANSIBLE | doas Linux'
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "644"
|
||||||
when: not doas_install.failed and ansible_system in ("Linux")
|
when: not doas_install.failed and ansible_system in ("Linux")
|
||||||
|
|
||||||
- name: General | Software | DoAs | Configure [BSD]
|
- name: General | Software | DoAs | Configure [BSD]
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ doas_conf_file_linux }}"
|
path: "{{ doas_conf_file_linux }}"
|
||||||
block: |
|
block: |
|
||||||
{{ doas_config }}
|
{{ doas_config }}
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | doas BSD'
|
marker: '# {mark} MANAGED BY ANSIBLE | doas BSD'
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "644"
|
||||||
when: not doas_install.failed and ansible_system in ("FreeBSD")
|
when: not doas_install.failed and ansible_system in ("FreeBSD")
|
||||||
|
|
||||||
- name: General | Software | DoAs | Configure [Other]
|
- name: General | Software | DoAs | Configure [Other]
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
block: |
|
block: |
|
||||||
{{ doas_config }}
|
{{ doas_config }}
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | doas Other'
|
marker: '# {mark} MANAGED BY ANSIBLE | doas Other'
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "644"
|
||||||
loop:
|
loop:
|
||||||
- "{{ doas_conf_file_linux }}"
|
- "{{ doas_conf_file_linux }}"
|
||||||
- "{{ doas_conf_file_bsd }}"
|
- "{{ doas_conf_file_bsd }}"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
- name: General | Account Management | System Groups
|
- name: General | Account Management | System Groups
|
||||||
group:
|
group:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
system: yes
|
system: true
|
||||||
state: present
|
state: present
|
||||||
loop:
|
loop:
|
||||||
- sudo
|
- sudo
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
# Create and manage permissions for notify log.
|
||||||
|
|
||||||
|
- name: General | Notify | Update File
|
||||||
|
ansible.builtin.shell: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- touch "{{ notify_log_file }}"
|
||||||
|
- chmod 777 "{{ notify_log_file }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
|
- name: General | Notify | Add Message
|
||||||
|
ansible.builtin.shell : echo "'Ansible' '{{ notify_message }} @ `date`'" >> "{{ notify_log_file }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
@@ -2,19 +2,19 @@
|
|||||||
# Set up directory and files for specifying software needs rather than using hosts file.
|
# Set up directory and files for specifying software needs rather than using hosts file.
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Variables 1
|
- name: General | Account Management | Provisioning Configuration | Variables 1
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
prov_dir: "/usr/local/etc/hyperling-scm"
|
prov_dir: "/usr/local/etc/hyperling-scm"
|
||||||
provision_variables: []
|
provision_variables: []
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Variables 2
|
- name: General | Account Management | Provisioning Configuration | Variables 2
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
gen_file: "{{ prov_dir }}/general.ini"
|
gen_file: "{{ prov_dir }}/general.ini"
|
||||||
wrk_file: "{{ prov_dir }}/workstation.ini"
|
wrk_file: "{{ prov_dir }}/workstation.ini"
|
||||||
mnr_file: "{{ prov_dir }}/miner.ini"
|
mnr_file: "{{ prov_dir }}/miner.ini"
|
||||||
srv_file: "{{ prov_dir }}/server.ini"
|
srv_file: "{{ prov_dir }}/server.ini"
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Create Directory
|
- name: General | Account Management | Provisioning Configuration | Create Directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ prov_dir }}"
|
path: "{{ prov_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -23,11 +23,11 @@
|
|||||||
## General ##
|
## General ##
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | General | Create
|
- name: General | Account Management | Provisioning Configuration | General | Create
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ gen_file }}"
|
path: "{{ gen_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config'
|
||||||
block: |
|
block: |
|
||||||
; Please note that all portions require lowercase keys and values.
|
[global]
|
||||||
;
|
|
||||||
;;;;;;;;;;;;;;;;;;;; Basic Options ;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;; Basic Options ;;;;;;;;;;;;;;;;;;;;
|
||||||
;
|
;
|
||||||
; enable : Provide true for the provision to occur.
|
; enable : Provide true for the provision to occur.
|
||||||
@@ -49,6 +49,17 @@
|
|||||||
; nmap is already provided for reporting
|
; nmap is already provided for reporting
|
||||||
; Default: false
|
; Default: false
|
||||||
;
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | General | Create | Git Polling
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ gen_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Git Polling'
|
||||||
|
block: |
|
||||||
;;;;;;;;;;;;;;;;;;;; Git Polling ;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;; Git Polling ;;;;;;;;;;;;;;;;;;;;
|
||||||
;
|
;
|
||||||
; For syncing this machine to a Git repository of this Ansible project
|
; For syncing this machine to a Git repository of this Ansible project
|
||||||
@@ -74,6 +85,17 @@
|
|||||||
; Example: Ansible, ansible-setup, my-env
|
; Example: Ansible, ansible-setup, my-env
|
||||||
; Default: env-ansible
|
; Default: env-ansible
|
||||||
;
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | General | Create | Swap File
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ gen_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Swap File'
|
||||||
|
block: |
|
||||||
;;;;;;;;;;;;;;;;;;;; Swap File ;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;; Swap File ;;;;;;;;;;;;;;;;;;;;
|
||||||
;
|
;
|
||||||
; swap_block : Set to the block size if dd should create a swapfile.
|
; swap_block : Set to the block size if dd should create a swapfile.
|
||||||
@@ -90,6 +112,17 @@
|
|||||||
; Example: /usr/local/swap
|
; Example: /usr/local/swap
|
||||||
; Default: /swapfile
|
; Default: /swapfile
|
||||||
;
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | General | Create | Sync Frequency
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ gen_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Sync Frequency'
|
||||||
|
block: |
|
||||||
;;;;;;;;;;;;;;;;;;;; Sync Frequency ;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;; Sync Frequency ;;;;;;;;;;;;;;;;;;;;
|
||||||
;
|
;
|
||||||
; no_telem : Set to true to avoid setting up telemetry services.
|
; no_telem : Set to true to avoid setting up telemetry services.
|
||||||
@@ -101,51 +134,150 @@
|
|||||||
; Slows down the rate of services such as telegraf and cron.
|
; Slows down the rate of services such as telegraf and cron.
|
||||||
; Default: false
|
; Default: false
|
||||||
;
|
;
|
||||||
;;;;;;;;;;;;;;;;;;;; Server Shortcut ;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | General | Create | Server Shortcuts
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ gen_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Server Shortcuts'
|
||||||
|
block: |
|
||||||
|
;;;;;;;;;;;;;;;;;;;; Server Shortcuts ;;;;;;;;;;;;;;;;;;;;
|
||||||
;
|
;
|
||||||
; For typing `prod` and getting straight to a server, like in env-termux.
|
; For typing `prod` and getting straight to a server, like in env-termux.
|
||||||
;
|
;
|
||||||
; prod_host : Branch to use on this machine.
|
; Imagine the command:
|
||||||
|
; `ssh prod_user@prod_host:prod_port`
|
||||||
|
;
|
||||||
|
; prod_host : Hostname for the production server.
|
||||||
; Example: myserver.com, mywebhost.net
|
; Example: myserver.com, mywebhost.net
|
||||||
; Default: hyperling.com
|
; Default: hyperling.com
|
||||||
;
|
;
|
||||||
; prod_port : Provide the git host that the machine should poll.
|
; prod_port : Port for the production server.
|
||||||
; Example: 22, 222, 2222
|
; Example: 22, 222, 2222
|
||||||
; Default: 22
|
; Default: 22
|
||||||
;
|
;
|
||||||
; prod_user : Port of the server host to use for SSH requests.
|
; prod_user : Username for accessing the production server.
|
||||||
; Example: jim, bob, jeff, anne
|
; Example: jim, bob, jeff, anne
|
||||||
; Default: user
|
; Default: user
|
||||||
;
|
;
|
||||||
[global]
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config'
|
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | General | Create | Sync Shortcuts
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ gen_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Sync Shortcuts'
|
||||||
|
block: |
|
||||||
|
;;;;;;;;;;;;;;;;;;;;; Sync Shortcuts ;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;
|
||||||
|
; Imagine the command:
|
||||||
|
; `rsync -auPhz --delete -e 'ssh -p prod_data_port' ./mydata-MASTER/ \
|
||||||
|
; prod_data_user@prod_data_host:/prod_data_dir/mydata-clone
|
||||||
|
; `
|
||||||
|
;
|
||||||
|
; prod_data_host : Branch to use on this machine.
|
||||||
|
; Example: sftp.myserver.com, sftp.mywebhost.net
|
||||||
|
; Default: hyperling.com
|
||||||
|
;
|
||||||
|
; prod_data_port : Provide the git host that the machine should poll.
|
||||||
|
; Example: 22, 222, 2222
|
||||||
|
; Default: 22
|
||||||
|
;
|
||||||
|
; prod_data_user : Port of the server host to use for SSH requests.
|
||||||
|
; Example: jim, bob, jeff, anne
|
||||||
|
; Default: user
|
||||||
|
;
|
||||||
|
; prod_data_dir : Port of the server host to use for SSH requests.
|
||||||
|
; Example: /srv/sftp/
|
||||||
|
; Default: /srv/sftp/
|
||||||
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | General | Create | Tunnel
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ gen_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config | Tunnel'
|
||||||
|
block: |
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Tunnel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;
|
||||||
|
; Create a runit script which maintains an SSH tunnel to a remote server.
|
||||||
|
;
|
||||||
|
; ssh -v -H -R tunnel_remote_port:localhost:tunnel_local_port \
|
||||||
|
; [-p tunnel_ssh_port] tunnel_remote_host
|
||||||
|
;
|
||||||
|
; tunnel_local_port (default=8080)
|
||||||
|
; Local HTTP port which need forwarded to a remote server.
|
||||||
|
; Example: http://localhost:8080
|
||||||
|
;
|
||||||
|
; tunnel_remote_host (default=false)
|
||||||
|
; Remote server including username (such as user@example.com) which will
|
||||||
|
; serve the port. Server should preferably have a reverse proxy in order
|
||||||
|
; to encrypt the traffic, otherwise the local server should use HTTPS.
|
||||||
|
;
|
||||||
|
; tunnel_remote_port (default=8080)
|
||||||
|
; Port which should host the service on the remote server. This is what
|
||||||
|
; will get typed into web browsers or used by the reverse proxy. Should
|
||||||
|
; be > 1024. Also, /etc/ssh/sshd_config will need AllowTcpForwarding and
|
||||||
|
; GatewayPorts set to yes, then sshd will need to be reloaded.
|
||||||
|
; Example: http://example.com:8080
|
||||||
|
;
|
||||||
|
; tunnel_ssh_port (default=22)
|
||||||
|
; Port which the remote server exposes ssh.
|
||||||
|
; Example: ssh -p 2222 user@example.com
|
||||||
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | General | Load
|
- name: General | Account Management | Provisioning Configuration | General | Load
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
provision: "{{ lookup('ini', 'enable file={{gen_file}} default=false') | bool }}"
|
provision: "{{ lookup('ini', 'enable file={{gen_file}} default=false') | bool }}"
|
||||||
user: "{{ lookup('ini', 'user file={{gen_file}} default=ling') }}"
|
user: "{{ lookup('ini', 'user file={{gen_file}} default=user' ) }}"
|
||||||
user_desc: "{{ lookup('ini', 'user_desc file={{gen_file}} default=Hyperling') }}"
|
user_desc: "{{ lookup('ini', 'user_desc file={{gen_file}} default=User' ) }}"
|
||||||
branch: "{{ lookup('ini', 'branch file={{gen_file}} default=main') }}"
|
branch: "{{ lookup('ini', 'branch file={{gen_file}} default=main' ) }}"
|
||||||
pentesting: "{{ lookup('ini', 'pentesting file={{gen_file}} default=false') | bool }}"
|
pentesting: "{{ lookup('ini', 'pentesting file={{gen_file}} default=false') | bool }}"
|
||||||
no_telem: "{{ lookup('ini', 'no_telem file={{gen_file}} default=false') | bool }}"
|
no_telem: "{{ lookup('ini', 'no_telem file={{gen_file}} default=false') | bool }}"
|
||||||
battery: "{{ lookup('ini', 'battery file={{gen_file}} default=false') | bool }}"
|
battery: "{{ lookup('ini', 'battery file={{gen_file}} default=false') | bool }}"
|
||||||
swap_block: "{{ lookup('ini', 'swap_block file={{gen_file}} default=false') }}"
|
swap_block: "{{ lookup('ini', 'swap_block file={{gen_file}} default=false') }}"
|
||||||
swap_count: "{{ lookup('ini', 'swap_count file={{gen_file}} default=1') }}"
|
swap_count: "{{ lookup('ini', 'swap_count file={{gen_file}} default=1' ) | int }}"
|
||||||
swap_file: "{{ lookup('ini', 'swap_file file={{gen_file}} default=/swapfile') }}"
|
swap_file: "{{ lookup('ini', 'swap_file file={{gen_file}} default=/swapfile') }}"
|
||||||
sshd_port: "{{ lookup('ini', 'sshd_port file={{gen_file}} default=22') }}"
|
sshd_port: "{{ lookup('ini', 'sshd_port file={{gen_file}} default=22' ) | int }}"
|
||||||
git_host: "{{ lookup('ini', 'git_host file={{gen_file}} default=git.hyperling.com') }}"
|
git_host: "{{ lookup('ini', 'git_host file={{gen_file}} default=git.hyperling.com') }}"
|
||||||
git_user: "{{ lookup('ini', 'git_user file={{gen_file}} default=me') }}"
|
git_user: "{{ lookup('ini', 'git_user file={{gen_file}} default=me') }}"
|
||||||
git_project: "{{ lookup('ini', 'git_project file={{gen_file}} default=env-ansible') }}"
|
git_project: "{{ lookup('ini', 'git_project file={{gen_file}} default=env-ansible') }}"
|
||||||
git_ssh_port: "{{ lookup('ini', 'git_ssh_port file={{gen_file}} default=22') }}"
|
git_ssh_port: "{{ lookup('ini', 'git_ssh_port file={{gen_file}} default=22') | int }}"
|
||||||
prod_host: "{{ lookup('ini', 'prod_host file={{gen_file}} default=hyperling.com') }}"
|
prod_host: "{{ lookup('ini', 'prod_host file={{gen_file}} default=hyperling.com') }}"
|
||||||
prod_port: "{{ lookup('ini', 'prod_port file={{gen_file}} default=22') }}"
|
prod_port: "{{ lookup('ini', 'prod_port file={{gen_file}} default=22') | int }}"
|
||||||
prod_user: "{{ lookup('ini', 'prod_user file={{gen_file}} default=user') }}"
|
prod_user: "{{ lookup('ini', 'prod_user file={{gen_file}} default=user') }}"
|
||||||
|
prod_data_host: "{{ lookup('ini', 'prod_data_host file={{gen_file}} default=hyperling.com') }}"
|
||||||
|
prod_data_port: "{{ lookup('ini', 'prod_data_port file={{gen_file}} default=22') | int }}"
|
||||||
|
prod_data_user: "{{ lookup('ini', 'prod_data_user file={{gen_file}} default=user') }}"
|
||||||
|
prod_data_dir: "{{ lookup('ini', 'prod_data_dir file={{gen_file}} default=/srv/sftp') }}"
|
||||||
|
tunnel_local_port: "{{ lookup('ini', 'tunnel_local_port file={{gen_file}} default=8080' ) | int }}"
|
||||||
|
tunnel_remote_host: "{{ lookup('ini', 'tunnel_remote_host file={{gen_file}} default=false') }}"
|
||||||
|
tunnel_remote_port: "{{ lookup('ini', 'tunnel_remote_port file={{gen_file}} default=8080' ) | int }}"
|
||||||
|
tunnel_ssh_port: "{{ lookup('ini', 'tunnel_ssh_port file={{gen_file}} default=22' ) | int }}"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | General | Boolean Check | swap_block
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
swap_block: "{{ swap_block | bool }}"
|
||||||
|
when: swap_block in ("false")
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | General | List
|
- name: General | Account Management | Provisioning Configuration | General | List
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
provision_variables: "{{ provision_variables | combine(item) }}"
|
provision_variables: "{{ provision_variables | combine(item) }}"
|
||||||
loop:
|
loop:
|
||||||
- { 'provision': "{{ provision }}" }
|
- { 'provision': "{{ provision }}" }
|
||||||
@@ -166,15 +298,25 @@
|
|||||||
- { 'prod_host': "{{ prod_host }}" }
|
- { 'prod_host': "{{ prod_host }}" }
|
||||||
- { 'prod_port': "{{ prod_port }}" }
|
- { 'prod_port': "{{ prod_port }}" }
|
||||||
- { 'prod_user': "{{ prod_user }}" }
|
- { 'prod_user': "{{ prod_user }}" }
|
||||||
|
- { 'prod_data_host': "{{ prod_data_host }}" }
|
||||||
|
- { 'prod_data_port': "{{ prod_data_port }}" }
|
||||||
|
- { 'prod_data_user': "{{ prod_data_user }}" }
|
||||||
|
- { 'prod_data_dir': "{{ prod_data_dir }}" }
|
||||||
|
- { 'tunnel_local_port': "{{ tunnel_local_port }}" }
|
||||||
|
- { 'tunnel_remote_host': "{{ tunnel_remote_host }}" }
|
||||||
|
- { 'tunnel_remote_port': "{{ tunnel_remote_port }}" }
|
||||||
|
- { 'tunnel_ssh_port': "{{ tunnel_ssh_port }}" }
|
||||||
|
|
||||||
|
|
||||||
## Workstation ##
|
## Workstation ##
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Workstation | Create
|
- name: General | Account Management | Provisioning Configuration | Workstation | Create | Main Options
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ wrk_file }}"
|
path: "{{ wrk_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config'
|
||||||
block: |
|
block: |
|
||||||
;;;;;;; Available options - all require lowercase values ;;;;;;
|
[global]
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;; Main Options ;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;
|
;
|
||||||
; enable : Set to true for system to be considered a workstation.
|
; enable : Set to true for system to be considered a workstation.
|
||||||
;
|
;
|
||||||
@@ -189,6 +331,115 @@
|
|||||||
;
|
;
|
||||||
; gaming : Set to true for installation of gaming software (Steam, Lutris)
|
; gaming : Set to true for installation of gaming software (Steam, Lutris)
|
||||||
;
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | Workstation | Create | LLMs
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ wrk_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config | LLMs'
|
||||||
|
block: |
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LLMs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;
|
||||||
|
; ollama (default=true)
|
||||||
|
; Install and enable the ollama LLM manager.
|
||||||
|
; API: http://127.0.0.1:11434
|
||||||
|
;
|
||||||
|
; manage_models (default=true)
|
||||||
|
; Automatically choose and pull the models to use based on system
|
||||||
|
; resources. Otherwise leaves images alone but still handles config.
|
||||||
|
;
|
||||||
|
; hf_token (default=false)
|
||||||
|
; Token from Hugging Face which allows faster download speeds than anon.
|
||||||
|
; May help with ollama and also supposed to help with open-webui. Token
|
||||||
|
; needs set to something like hf_kjBCCLABEEABUVAKbjadbvkaksvBAVKBkjsDVK.
|
||||||
|
;
|
||||||
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | Workstation | Create | LLMs | GUIs
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ wrk_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config | LLMs | GUIs'
|
||||||
|
block: |
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LLMs: GUIs ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;
|
||||||
|
; zeroclaw (default=true)
|
||||||
|
; Install and enable the Zeroclaw web daemon, a minimalistic interface
|
||||||
|
; for many models and providers with negligible resource usage. Also
|
||||||
|
; installs the CLI tool zerocode as an alternative to the web GUI.
|
||||||
|
; URL: http://127.0.0.1:42617
|
||||||
|
;
|
||||||
|
; open_webui (default=false)
|
||||||
|
; Install and enable open-webui as a Docker container. Very polished web
|
||||||
|
; frontend for ollama and also handles other web LLMs through API calls.
|
||||||
|
; Container is over 1GB in size and consumes substantial resources!
|
||||||
|
; URL: http://localhost:3000
|
||||||
|
;
|
||||||
|
; open_webui_port (default=3000)
|
||||||
|
; Port on which to run the open-webui Docker instance.
|
||||||
|
;
|
||||||
|
; open_webui_key (default=PleaseEnsureTheKeyIsAtLeast32To64Characters)
|
||||||
|
; Secret key, allows persistence between runs. If not a public-facing
|
||||||
|
; system, then not critical. Use `openssl rand -hex 32` to create one.
|
||||||
|
;
|
||||||
|
; codium_config (default=true)
|
||||||
|
; Manage the config files for and Codium plugins. Cline and Continue are
|
||||||
|
; the recommended Codium extensions but need installed through the GUI.
|
||||||
|
; Currently handles:
|
||||||
|
; ~/.continue/config.yml
|
||||||
|
;
|
||||||
|
; qwen_code (default=true)
|
||||||
|
; Install and enable qwen-code as a daemon.
|
||||||
|
; URL: http://127.0.0.1:4170
|
||||||
|
;
|
||||||
|
; qwen_code_key (default='')
|
||||||
|
; API key for accessing the web GUI. Optional, not used if left blank.
|
||||||
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | Workstation | Create | LLMs | GUIs
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ wrk_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config | LLMs | GUIs'
|
||||||
|
block: |
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;; LLMs: MCPs / Sandboxes ;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;
|
||||||
|
; open_terminal (default=false)
|
||||||
|
; Docker container to be used with GUIs like open-webui so that agents
|
||||||
|
; have somewhere safe to execute commands. Also allows file read/writes.
|
||||||
|
; URL: http://127.0.0.1:8000
|
||||||
|
;
|
||||||
|
; open_terminal_port (default=8000)
|
||||||
|
; Port on which to run the open-terminal Docker instance.
|
||||||
|
;
|
||||||
|
; open_terminal_key (default=open-terminal-key)
|
||||||
|
; API key, needed in order to access the server. Required.
|
||||||
|
;
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | Workstation | Create | Other Options
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ wrk_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config | Other Options'
|
||||||
|
block: |
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;; Other Options ;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;
|
||||||
; rdp : Set to true for installation of RDP protocol
|
; rdp : Set to true for installation of RDP protocol
|
||||||
; CURRENTLY FREEBSD-ONLY
|
; CURRENTLY FREEBSD-ONLY
|
||||||
;
|
;
|
||||||
@@ -204,27 +455,60 @@
|
|||||||
; redmode : Set to true/false for automatially using Night Light in GNOME.
|
; redmode : Set to true/false for automatially using Night Light in GNOME.
|
||||||
; Default: true
|
; Default: true
|
||||||
;
|
;
|
||||||
[global]
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
marker: '; {mark} MANAGED BY ANSIBLE | Workstation Config'
|
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Workstation | Load
|
- name: General | Account Management | Provisioning Configuration | Workstation | Load
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
# Main
|
||||||
workstation: "{{ lookup('ini', 'enable file={{wrk_file}} default=false') | bool }}"
|
workstation: "{{ lookup('ini', 'enable file={{wrk_file}} default=false') | bool }}"
|
||||||
coding: "{{ lookup('ini', 'coding file={{wrk_file}} default=false') | bool }}"
|
coding: "{{ lookup('ini', 'coding file={{wrk_file}} default=false') | bool }}"
|
||||||
sdks: "{{ lookup('ini', 'sdks file={{wrk_file}} default=false') | bool }}"
|
sdks: "{{ lookup('ini', 'sdks file={{wrk_file}} default=false') | bool }}"
|
||||||
editing: "{{ lookup('ini', 'editing file={{wrk_file}} default=false') }}"
|
editing: "{{ lookup('ini', 'editing file={{wrk_file}} default=false') }}"
|
||||||
gaming: "{{ lookup('ini', 'gaming file={{wrk_file}} default=false') | bool }}"
|
gaming: "{{ lookup('ini', 'gaming file={{wrk_file}} default=false') | bool }}"
|
||||||
rdp: "{{ lookup('ini', 'rdp file={{wrk_file}} default=false') | bool }}"
|
# Other
|
||||||
vnc: "{{ lookup('ini', 'vnc file={{wrk_file}} default=false') | bool }}"
|
rdp: "{{ lookup('ini', 'rdp file={{wrk_file}} default=false') | bool }}"
|
||||||
bsd_gpu: "{{ lookup('ini', 'bsd_gpu file={{wrk_file}} default=false') | bool }}"
|
vnc: "{{ lookup('ini', 'vnc file={{wrk_file}} default=false') | bool }}"
|
||||||
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
|
bsd_gpu: "{{ lookup('ini', 'bsd_gpu file={{wrk_file}} default=false') | bool }}"
|
||||||
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | bool }}"
|
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
|
||||||
|
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | bool }}"
|
||||||
|
# LLMs
|
||||||
|
ollama_enabled: "{{ lookup('ini', 'ollama file={{wrk_file}} default=true' ) | bool }}"
|
||||||
|
manage_models: "{{ lookup('ini', 'manage_models file={{wrk_file}} default=true' ) | bool }}"
|
||||||
|
hf_token: "{{ lookup('ini', 'hf_token file={{wrk_file}} default=false') }}"
|
||||||
|
# LLM GUIs
|
||||||
|
zeroclaw_enabled: "{{ lookup('ini', 'zeroclaw file={{wrk_file}} default=true ') | bool }}"
|
||||||
|
open_webui_enabled: "{{ lookup('ini', 'open_webui file={{wrk_file}} default=false') | bool }}"
|
||||||
|
open_webui_port: "{{ lookup('ini', 'open_webui_port file={{wrk_file}} default=3000' ) | int }}"
|
||||||
|
open_webui_key: "{{ lookup('ini', 'open_webui_key file={{wrk_file}} default=PleaseEnsureTheKeyIsAtLeast32To64Characters') }}"
|
||||||
|
codium_config: "{{ lookup('ini', 'codium_config file={{wrk_file}} default=true' ) | bool }}"
|
||||||
|
qwen_code_enabled: "{{ lookup('ini', 'qwen_code file={{wrk_file}} default=true' ) | bool }}"
|
||||||
|
qwen_code_key : "{{ lookup('ini', 'qwen_code_key file={{wrk_file}} default=false') }}"
|
||||||
|
# LLM MCPs
|
||||||
|
open_terminal_enabled: "{{ lookup('ini', 'open_terminal file={{wrk_file}} default=false') | bool }}"
|
||||||
|
open_terminal_port: "{{ lookup('ini', 'open_terminal_port file={{wrk_file}} default=8000' ) | int }}"
|
||||||
|
open_terminal_key: "{{ lookup('ini', 'open_terminal_key file={{wrk_file}} default=false') }}"
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | editing
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
editing: "{{ editing | bool }}"
|
||||||
|
when: editing in ("true", "false")
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | qwen_code_key
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
qwen_code_key: "{{ qwen_code_key | bool }}"
|
||||||
|
when: qwen_code_key in ("false")
|
||||||
|
|
||||||
|
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | open_terminal_key
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
open_terminal_key: "{{ open_terminal_key | bool }}"
|
||||||
|
when: open_terminal_key in ("false")
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Workstation | List
|
- name: General | Account Management | Provisioning Configuration | Workstation | List
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
provision_variables: "{{ provision_variables | combine(item) }}"
|
provision_variables: "{{ provision_variables | combine(item) }}"
|
||||||
loop:
|
loop:
|
||||||
- { 'workstation': "{{ workstation }}" }
|
- { 'workstation': "{{ workstation }}" }
|
||||||
@@ -237,14 +521,28 @@
|
|||||||
- { 'bsd_gpu': "{{ bsd_gpu }}" }
|
- { 'bsd_gpu': "{{ bsd_gpu }}" }
|
||||||
- { 'mobile': "{{ mobile }}" }
|
- { 'mobile': "{{ mobile }}" }
|
||||||
- { 'redmode': "{{ redmode }}" }
|
- { 'redmode': "{{ redmode }}" }
|
||||||
|
- { 'ollama_enabled': "{{ ollama_enabled }}" }
|
||||||
|
- { 'manage_models': "{{ manage_models }}" }
|
||||||
|
- { 'hf_token': "{{ hf_token }}" }
|
||||||
|
- { 'zeroclaw_enabled': "{{ zeroclaw_enabled }}" }
|
||||||
|
- { 'open_webui_enabled': "{{ open_webui_enabled }}" }
|
||||||
|
- { 'open_webui_port': "{{ open_webui_port }}" }
|
||||||
|
- { 'open_webui_key': "{{ open_webui_key }}" }
|
||||||
|
- { 'codium_config': "{{ codium_config }}" }
|
||||||
|
- { 'qwen_code_enabled': "{{ qwen_code_enabled }}" }
|
||||||
|
- { 'qwen_code_key': "{{ qwen_code_key }}" }
|
||||||
|
- { 'open_terminal_enabled': "{{ open_terminal_enabled }}" }
|
||||||
|
- { 'open_terminal_port': "{{ open_terminal_port }}" }
|
||||||
|
- { 'open_terminal_key': "{{ open_terminal_key }}" }
|
||||||
|
|
||||||
# No longer mining, this is now considered deprecated.
|
# No longer mining, this is now considered deprecated.
|
||||||
### Miner ##
|
### Miner ##
|
||||||
#
|
#
|
||||||
#- name: General | Account Management | Provisioning Configuration | Miner | Create
|
#- name: General | Account Management | Provisioning Configuration | Miner | Create
|
||||||
# blockinfile:
|
# ansible.builtin.blockinfile:
|
||||||
# path: "{{ mnr_file }}"
|
# path: "{{ mnr_file }}"
|
||||||
# block: |
|
# block: |
|
||||||
|
# [global]
|
||||||
# ;;;;;;; Available options - all require lowercase values ;;;;;;
|
# ;;;;;;; Available options - all require lowercase values ;;;;;;
|
||||||
# ;
|
# ;
|
||||||
# ; enable : Set to true for system to be considered a miner.
|
# ; enable : Set to true for system to be considered a miner.
|
||||||
@@ -280,14 +578,15 @@
|
|||||||
# ; xmr_stak_cpu : Set to true for istallation
|
# ; xmr_stak_cpu : Set to true for istallation
|
||||||
# ; UNFINISHED/UNTESTED
|
# ; UNFINISHED/UNTESTED
|
||||||
# ;
|
# ;
|
||||||
# [global]
|
# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
# marker: '; {mark} MANAGED BY ANSIBLE | Miner Config'
|
# marker: '; {mark} MANAGED BY ANSIBLE | Miner Config'
|
||||||
# state: present
|
# state: present
|
||||||
# create: yes
|
# create: true
|
||||||
# backup: yes
|
# backup: true
|
||||||
|
# mode: "0644"
|
||||||
#
|
#
|
||||||
#- name: General | Account Management | Provisioning Configuration | Miner | Load
|
#- name: General | Account Management | Provisioning Configuration | Miner | Load
|
||||||
# set_fact:
|
# ansible.builtin.set_fact:
|
||||||
# miner: "{{ lookup('ini', 'enable file={{mnr_file}} default=false') | bool }}"
|
# miner: "{{ lookup('ini', 'enable file={{mnr_file}} default=false') | bool }}"
|
||||||
# amdgpu: "{{ lookup('ini', 'amdgpu file={{mnr_file}} default=false') | bool }}"
|
# amdgpu: "{{ lookup('ini', 'amdgpu file={{mnr_file}} default=false') | bool }}"
|
||||||
# nanominer: "{{ lookup('ini', 'nanominer file={{mnr_file}} default=false') | bool }}"
|
# nanominer: "{{ lookup('ini', 'nanominer file={{mnr_file}} default=false') | bool }}"
|
||||||
@@ -302,7 +601,7 @@
|
|||||||
# xmr_stak_cpu: "{{ lookup('ini', 'xmr_stak_cpu file={{mnr_file}} default=false') | bool }}"
|
# xmr_stak_cpu: "{{ lookup('ini', 'xmr_stak_cpu file={{mnr_file}} default=false') | bool }}"
|
||||||
#
|
#
|
||||||
#- name: General | Account Management | Provisioning Configuration | Miner | List
|
#- name: General | Account Management | Provisioning Configuration | Miner | List
|
||||||
# set_fact:
|
# ansible.builtin.set_fact:
|
||||||
# provision_variables: "{{ provision_variables | combine(item) }}"
|
# provision_variables: "{{ provision_variables | combine(item) }}"
|
||||||
# loop:
|
# loop:
|
||||||
# - { 'miner': "{{ miner }}" }
|
# - { 'miner': "{{ miner }}" }
|
||||||
@@ -322,9 +621,11 @@
|
|||||||
## Server ##
|
## Server ##
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Server | Create
|
- name: General | Account Management | Provisioning Configuration | Server | Create
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ srv_file }}"
|
path: "{{ srv_file }}"
|
||||||
|
marker: '; {mark} MANAGED BY ANSIBLE | Server Config'
|
||||||
block: |
|
block: |
|
||||||
|
[global]
|
||||||
;;;;;;; Parameters ;;;;;;
|
;;;;;;; Parameters ;;;;;;
|
||||||
;
|
;
|
||||||
; enable : Set to true for system to be considered a server.
|
; enable : Set to true for system to be considered a server.
|
||||||
@@ -349,14 +650,13 @@
|
|||||||
; hugo : Set to true to install HUGO static website generator.
|
; hugo : Set to true to install HUGO static website generator.
|
||||||
;
|
;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
[global]
|
|
||||||
marker: '; {mark} MANAGED BY ANSIBLE | Server Config'
|
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Server | Load
|
- name: General | Account Management | Provisioning Configuration | Server | Load
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
server: "{{ lookup('ini', 'enable file={{srv_file}} default=false') | bool }}"
|
server: "{{ lookup('ini', 'enable file={{srv_file}} default=false') | bool }}"
|
||||||
domain: "{{ lookup('ini', 'domain file={{srv_file}} default=hyperling.com') }}"
|
domain: "{{ lookup('ini', 'domain file={{srv_file}} default=hyperling.com') }}"
|
||||||
onlyoffice: "{{ lookup('ini', 'onlyoffice file={{srv_file}} default=false') | bool }}"
|
onlyoffice: "{{ lookup('ini', 'onlyoffice file={{srv_file}} default=false') | bool }}"
|
||||||
@@ -367,7 +667,7 @@
|
|||||||
hugo: "{{ lookup('ini', 'hugo file={{srv_file}} default=false') | bool }}"
|
hugo: "{{ lookup('ini', 'hugo file={{srv_file}} default=false') | bool }}"
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Server | List
|
- name: General | Account Management | Provisioning Configuration | Server | List
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
provision_variables: "{{ provision_variables | combine(item) }}"
|
provision_variables: "{{ provision_variables | combine(item) }}"
|
||||||
loop:
|
loop:
|
||||||
- { 'server': "{{ server }}" }
|
- { 'server': "{{ server }}" }
|
||||||
@@ -383,12 +683,17 @@
|
|||||||
## Exit if not turned on yet ##
|
## Exit if not turned on yet ##
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Exit Check
|
- name: General | Account Management | Provisioning Configuration | Exit Check
|
||||||
shell: echo "Please configure the config files in {{ prov_dir }} then try again." && exit 1
|
block:
|
||||||
when: provision != true
|
- name: General | Account Management | Provisioning Configuration | Exit Check | Message
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "Please configure the config files in {{ prov_dir }} then try again."
|
||||||
|
- name: General | Account Management | Provisioning Configuration | Exit Check | Exit
|
||||||
|
ansible.builtin.meta: end_play
|
||||||
|
when: not provision
|
||||||
|
|
||||||
|
|
||||||
## Display values ##
|
## Display values ##
|
||||||
|
|
||||||
- name: General | Account Management | Provisioning Configuration | Print
|
- name: General | Account Management | Provisioning Configuration | Print
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: provision_variables
|
var: provision_variables
|
||||||
@@ -2,32 +2,33 @@
|
|||||||
# Ensure the proper users have sudo access.
|
# Ensure the proper users have sudo access.
|
||||||
|
|
||||||
- name: General | Account Management | Sudo | Copy Ansible
|
- name: General | Account Management | Sudo | Copy Ansible
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: sudo/sudoers_ansible
|
src: sudo/sudoers_ansible
|
||||||
dest: "{{ sudoers_install_dir }}"
|
dest: "{{ sudoers_install_dir }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ root_group }}"
|
group: "{{ root_group }}"
|
||||||
mode: 0440
|
mode: "0440"
|
||||||
|
|
||||||
- name: General | Account Management | Sudo | Copy Sudo Group
|
- name: General | Account Management | Sudo | Copy Sudo Group
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: sudo/sudoers_sudo
|
src: sudo/sudoers_sudo
|
||||||
dest: "{{ sudoers_install_dir }}"
|
dest: "{{ sudoers_install_dir }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ root_group }}"
|
group: "{{ root_group }}"
|
||||||
mode: 0440
|
mode: "0440"
|
||||||
|
|
||||||
# Disable these two lines in openSUSE default configuration.
|
# Disable these two lines in openSUSE default configuration.
|
||||||
#Defaults targetpw # ask for the password of the target user i.e. root
|
#Defaults targetpw # ask for the password of the target user i.e. root
|
||||||
#ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!
|
#ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!
|
||||||
- name: General | Account Management | Sudo | Disable openSUSE Root PW Prompt
|
- name: General | Account Management | Sudo | Disable openSUSE Root PW Prompt
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ sudoers_config }}"
|
path: "{{ sudoers_config }}"
|
||||||
regexp: '{{ item.key }}'
|
regexp: '{{ item.key }}'
|
||||||
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "644"
|
||||||
loop:
|
loop:
|
||||||
- { "key": '^[\#]?Defaults targetpw', "value": '#Defaults targetpw'}
|
- { "key": '^[\#]?Defaults targetpw', "value": '#Defaults targetpw'}
|
||||||
- { "key": '^[\#]?ALL ALL\=\(ALL\) ALL', "value": '#ALL ALL=(ALL) ALL'}
|
- { "key": '^[\#]?ALL ALL\=\(ALL\) ALL', "value": '#ALL ALL=(ALL) ALL'}
|
||||||
+367
-170
@@ -4,62 +4,62 @@
|
|||||||
## Variables ##
|
## Variables ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Use BASH (Default)
|
- name: General | Account Management | Users | Use BASH (Default)
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
user_shell: "{{ bash_exec.stdout }}"
|
user_shell: "{{ bash_exec.stdout }}"
|
||||||
|
|
||||||
- name: General | Account Management | Users | Allow BASH (Arch)
|
- name: General | Account Management | Users | Allow BASH (Arch)
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/shells
|
path: /etc/shells
|
||||||
regexp: "{{ bash_exec.stdout }}"
|
regexp: "{{ bash_exec.stdout }}"
|
||||||
line: "{{ bash_exec.stdout }}"
|
line: "{{ bash_exec.stdout }}"
|
||||||
insertbefore: "# End of file"
|
insertbefore: "# End of file"
|
||||||
backup: yes
|
backup: true
|
||||||
create: no
|
create: false
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == "Archlinux"
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
#- name: General | Account Management | Users | Use ZSH (Arch+Manjaro)
|
#- name: General | Account Management | Users | Use ZSH (Arch+Manjaro)
|
||||||
# set_fact:
|
# ansible.builtin.set_fact:
|
||||||
# user_shell: "{{ zsh_exec.stdout }}"
|
# user_shell: "{{ zsh_exec.stdout }}"
|
||||||
# when: ansible_distribution == "Archlinux"
|
# when: ansible_pkg_mgr == "pacman"
|
||||||
#
|
#
|
||||||
#- name: General | Account Management | Users | Allow ZSH (Arch)
|
#- name: General | Account Management | Users | Allow ZSH (Arch)
|
||||||
# lineinfile:
|
# ansible.builtin.lineinfile:
|
||||||
# path: /etc/shells
|
# path: /etc/shells
|
||||||
# regexp: "{{ zsh_exec.stdout }}"
|
# regexp: "{{ zsh_exec.stdout }}"
|
||||||
# line: "{{ zsh_exec.stdout }}"
|
# line: "{{ zsh_exec.stdout }}"
|
||||||
# insertbefore: "# End of file"
|
# insertbefore: "# End of file"
|
||||||
# backup: yes
|
# backup: true
|
||||||
# create: no
|
# create: false
|
||||||
# state: present
|
# state: present
|
||||||
# when: ansible_distribution == "Archlinux"
|
# when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
|
|
||||||
## Root ##
|
## Root ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Root
|
- name: General | Account Management | Users | Root
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: root
|
name: root
|
||||||
shell: "{{ bash_exec.stdout }}"
|
shell: "{{ bash_exec.stdout }}"
|
||||||
create_home: yes
|
create_home: true
|
||||||
generate_ssh_key: yes
|
generate_ssh_key: true
|
||||||
register: user_root
|
register: user_root
|
||||||
|
|
||||||
|
|
||||||
## Scheduler ##
|
## Scheduler ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Ansible
|
- name: General | Account Management | Users | Ansible
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: ansible
|
name: ansible
|
||||||
comment: Ansible
|
comment: Ansible
|
||||||
system: yes
|
system: true
|
||||||
register: user_ansible
|
register: user_ansible
|
||||||
|
|
||||||
|
|
||||||
## Superuser ##
|
## Superuser ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | User
|
- name: General | Account Management | Users | User
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: "{{ user }}"
|
name: "{{ user }}"
|
||||||
comment: "{{ user_desc }}"
|
comment: "{{ user_desc }}"
|
||||||
groups:
|
groups:
|
||||||
@@ -67,23 +67,26 @@
|
|||||||
- video
|
- video
|
||||||
- render
|
- render
|
||||||
- wheel
|
- wheel
|
||||||
append: yes
|
append: true
|
||||||
shell: "{{ user_shell }}"
|
shell: "{{ user_shell }}"
|
||||||
create_home: yes
|
create_home: true
|
||||||
generate_ssh_key: yes
|
generate_ssh_key: true
|
||||||
register: user_user
|
register: user_user
|
||||||
|
|
||||||
- name: General | Account Management | Users | User | Test Logging In
|
- name: General | Account Management | Users | User | Test Logging In
|
||||||
shell: "echo SUCCESS"
|
ansible.builtin.shell: "echo SUCCESS"
|
||||||
args:
|
args:
|
||||||
executable: "{{ user_shell }}"
|
executable: "{{ user_shell }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
|
|
||||||
## Folders ##
|
## Folders ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Root | Create Folders
|
- name: General | Account Management | Users | Root | Create Folders
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -94,7 +97,7 @@
|
|||||||
when: user_root.home != ""
|
when: user_root.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | User | Create Folders
|
- name: General | Account Management | Users | User | Create Folders
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -103,31 +106,59 @@
|
|||||||
- "{{ user_user.home }}/TRASH"
|
- "{{ user_user.home }}/TRASH"
|
||||||
- "{{ user_user.home }}/Downloads"
|
- "{{ user_user.home }}/Downloads"
|
||||||
- "{{ user_user.home }}/Reports"
|
- "{{ user_user.home }}/Reports"
|
||||||
|
- "{{ user_user.home }}/Torrentz"
|
||||||
|
- "{{ user_user.home }}/Seedz"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: user_user.home != ""
|
when: user_user.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | User | Create Folders | Coding
|
- name: General | Account Management | Users | User | Create Folders | Coding
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_user.home }}/Code"
|
- "{{ user_user.home }}/Code"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: user_user.home != "" and coding == true
|
when: user_user.home != "" and coding
|
||||||
|
|
||||||
- name: General | Account Management | Users | Home Permissions
|
- name: General | Account Management | Users | Home Permissions
|
||||||
shell: "chmod 700 {{ user_user.home }}/../*"
|
ansible.builtin.shell: "chmod 700 {{ user_user.home }}/../*"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
|
|
||||||
## Files ##
|
## Files ##
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | Files | Profile Variables
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
export_path_additions: export PATH="$HOME/bin:{{ shared_rc_bin }}:$PATH:{{ global_bin }}"
|
||||||
|
export_path_sbin: export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
|
||||||
|
#export_terminal: export TERMINAL="alacritty" # colors look weird.
|
||||||
|
export_terminal: export TERMINAL="kitty"
|
||||||
|
export_browser: |
|
||||||
|
function find-firefox {
|
||||||
|
which firefox 2>/dev/null ||
|
||||||
|
which firefox-esr 2>/dev/null ||
|
||||||
|
which firefox-flatpak 2>/dev/null
|
||||||
|
}
|
||||||
|
export BROWSER="`find-firefox`"
|
||||||
|
keyboard_settings: |
|
||||||
|
if [[ -n "$XDG_SESSION_ID" ]]; then
|
||||||
|
setxkbmap -layout us -variant altgr-intl
|
||||||
|
fi
|
||||||
|
export_notify: |
|
||||||
|
export NOTIFY="`which fyi 2>/dev/null || which notify-send 2>/dev/null`"
|
||||||
|
function notify() {
|
||||||
|
$NOTIFY $@
|
||||||
|
}
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | RC Variables
|
- name: General | Account Management | Users | Files | RC Variables
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
alias_cp: alias cp='cp -v'
|
alias_cp: alias cp='cp -v'
|
||||||
alias_mv: alias mv='mv -v'
|
alias_mv: alias mv='mv -v'
|
||||||
alias_rm: alias rm='echo "Use mv ~/TRASH/ instead!"'
|
alias_rm: alias rm='echo "Use mv ~/TRASH/ instead!"'
|
||||||
export_path_additions: export PATH="~/bin:"{{ global_bin }}":$PATH"
|
|
||||||
function_wttr: |
|
function_wttr: |
|
||||||
function weather() {
|
function weather() {
|
||||||
# 20210301 - Someone showed me an awesome weather API! Had to implement it!
|
# 20210301 - Someone showed me an awesome weather API! Had to implement it!
|
||||||
@@ -145,7 +176,39 @@
|
|||||||
fi
|
fi
|
||||||
curl "https://wttr.in/${1//\ /+}"
|
curl "https://wttr.in/${1//\ /+}"
|
||||||
}
|
}
|
||||||
export_PS1: export PS1='[\u@\h \w]\$ '
|
export_PS1: |
|
||||||
|
## Prompts ##
|
||||||
|
|
||||||
|
# Old Trusty
|
||||||
|
#export PS1='[\u@\h \w]\$ '
|
||||||
|
|
||||||
|
# 20251201 - Add time.
|
||||||
|
#export PS1='[\t \u@\h \w]\$ '
|
||||||
|
|
||||||
|
# 20251201 - Add colors.
|
||||||
|
# This helps to determine the color palette numbers:
|
||||||
|
# https://robotmoon.com/bash-prompt-generator/
|
||||||
|
# Colors have been moved to env-shared project's .rc_shared file.
|
||||||
|
|
||||||
|
if [[ "$USER" == "root" || $UID == 0 ]]; then
|
||||||
|
CLR_BRACKETS=$BOLD$YELLOW
|
||||||
|
CLR_TIME=$BOLD$ORANGE
|
||||||
|
CLR_USER=$BOLD$SCARLET
|
||||||
|
CLR_DIR=$BOLD$RED
|
||||||
|
CLR_PROMPT=$BOLD$GRAY
|
||||||
|
else
|
||||||
|
CLR_BRACKETS=$RESET
|
||||||
|
CLR_TIME=$BOLD$PURPLE
|
||||||
|
CLR_USER=$BOLD$ORANGE
|
||||||
|
CLR_DIR=$BOLD$GREEN
|
||||||
|
CLR_PROMPT=$RESET
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PS1='\[$CLR_BRACKETS\][\[$CLR_TIME\]\t \[$CLR_USER\]\u@\h \[$CLR_DIR\]\w\[$CLR_BRACKETS\]]\[$CLR_PROMPT\]\$ \[$RESET\]'
|
||||||
|
|
||||||
|
export PS2='\[$CLR_BRACKETS\](\[$CLR_TIME\]>\[$CLR_USER\]^\[$CLR_DIR\].\[$CLR_USER\]^\[$CLR_BRACKETS\])\[$CLR_TIME\]> \[$RESET\]'
|
||||||
|
|
||||||
|
## End Prompts ##
|
||||||
alias_remount: |
|
alias_remount: |
|
||||||
alias remount='
|
alias remount='
|
||||||
sudo umount /mnt/*
|
sudo umount /mnt/*
|
||||||
@@ -192,6 +255,12 @@
|
|||||||
{{ update_package_manager }}
|
{{ update_package_manager }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$only_flat" != "Y" && "$only_sys" != "Y" ]]; then
|
||||||
|
{{ update_npm }}
|
||||||
|
else
|
||||||
|
echo -e "\n*** Skipping NPM ***\n\n"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$shutdown" == "Y" && "{{ battery }}" == "True" ]]; then
|
if [[ "$shutdown" == "Y" && "{{ battery }}" == "True" ]]; then
|
||||||
echo -e "\n*** Only System Updates - Skipping Flatpak ***\n\n"
|
echo -e "\n*** Only System Updates - Skipping Flatpak ***\n\n"
|
||||||
elif [[ "$only_sys" == "Y" ]]; then
|
elif [[ "$only_sys" == "Y" ]]; then
|
||||||
@@ -243,7 +312,7 @@
|
|||||||
alias init-video='
|
alias init-video='
|
||||||
mkdir -v raw
|
mkdir -v raw
|
||||||
mkdir -v exports
|
mkdir -v exports
|
||||||
cp ~/Templates/*video* ./
|
cp $HOME/Templates/*video* ./
|
||||||
'
|
'
|
||||||
alias init-vid=init-video
|
alias init-vid=init-video
|
||||||
alias init-program='
|
alias init-program='
|
||||||
@@ -259,6 +328,7 @@
|
|||||||
}
|
}
|
||||||
function goodbye {
|
function goodbye {
|
||||||
update -yg
|
update -yg
|
||||||
|
bye
|
||||||
}
|
}
|
||||||
metasploit_aliases: |
|
metasploit_aliases: |
|
||||||
alias metasploit="msfconsole"
|
alias metasploit="msfconsole"
|
||||||
@@ -297,7 +367,7 @@
|
|||||||
alias trashed-cleanup="clean-trashed"
|
alias trashed-cleanup="clean-trashed"
|
||||||
alias trashed-clean="clean-trashed"
|
alias trashed-clean="clean-trashed"
|
||||||
function_check_trash: |
|
function_check_trash: |
|
||||||
function check-trash() {
|
function check-trash-old() {
|
||||||
unset OPTIND
|
unset OPTIND
|
||||||
unset clean
|
unset clean
|
||||||
unset network
|
unset network
|
||||||
@@ -392,14 +462,14 @@
|
|||||||
echo "Checking but not cleaning /var/mail..."
|
echo "Checking but not cleaning /var/mail..."
|
||||||
du -ha /var/mail | sort -h
|
du -ha /var/mail | sort -h
|
||||||
if [[ $clean == "Y" ]]; then
|
if [[ $clean == "Y" ]]; then
|
||||||
clean-trashed "~/"
|
clean-trashed "$HOME/"
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
alias check_trash="check-trash"
|
alias check_trash="check-trash"
|
||||||
alias_clean_trash: alias clean-trash='check-trash --clean'
|
alias_trash_check: alias trash-check='check-trash-old'
|
||||||
alias_trash_check: alias trash-check='check-trash'
|
alias_clean_trash: alias clean-trash='check-trash-old --clean'
|
||||||
alias_trash_clean: alias trash-clean='trash-check --clean'
|
alias_trash_clean: alias trash-clean='clean-trash'
|
||||||
alias_clean_dir: |
|
alias_clean_dir: |
|
||||||
function clean-dir() {
|
function clean-dir() {
|
||||||
sudo du -hs
|
sudo du -hs
|
||||||
@@ -453,6 +523,13 @@
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f ./prep.sh ]]; then
|
||||||
|
echo "Running prep.sh first..."
|
||||||
|
./prep.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
export BUILD_TIMESTAMP="`date`"
|
||||||
|
|
||||||
docker compose build &&
|
docker compose build &&
|
||||||
docker compose down &&
|
docker compose down &&
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
@@ -475,6 +552,13 @@
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f ./prep.sh ]]; then
|
||||||
|
echo "Running prep.sh first..."
|
||||||
|
./prep.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
export BUILD_TIMESTAMP="`date`"
|
||||||
|
|
||||||
docker compose pull &&
|
docker compose pull &&
|
||||||
docker compose build &&
|
docker compose build &&
|
||||||
docker compose down &&
|
docker compose down &&
|
||||||
@@ -519,6 +603,14 @@
|
|||||||
docker ps
|
docker ps
|
||||||
return;
|
return;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f ./prep.sh ]]; then
|
||||||
|
echo "Running prep.sh first..."
|
||||||
|
./prep.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
export BUILD_TIMESTAMP="`date`"
|
||||||
|
|
||||||
echo "*** Upgrading Images ***" &&
|
echo "*** Upgrading Images ***" &&
|
||||||
docker compose pull &&
|
docker compose pull &&
|
||||||
echo "*** Building Containers ***" &&
|
echo "*** Building Containers ***" &&
|
||||||
@@ -544,6 +636,11 @@
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -f ./prep.sh ]]; then
|
||||||
|
echo "Running prep.sh first..."
|
||||||
|
./prep.sh
|
||||||
|
fi
|
||||||
|
|
||||||
docker compose down &&
|
docker compose down &&
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
@@ -559,37 +656,11 @@
|
|||||||
alias docker-start="docker compose up -d && docker compose start"
|
alias docker-start="docker compose up -d && docker compose start"
|
||||||
alias docker-prep="docker compose pull && docker compose build"
|
alias docker-prep="docker compose pull && docker compose build"
|
||||||
alias_code_check: |
|
alias_code_check: |
|
||||||
alias code-check='
|
alias code-check='git-check $HOME/Code'
|
||||||
echo "Checking ~/Code directory for git changes."
|
|
||||||
ls -d ~/Code/* | while read project; do
|
|
||||||
if [[ ! -d $project ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
echo -e "\n*** `basename $project` ***"
|
|
||||||
cd $project
|
|
||||||
if [[ -d .git ]]; then
|
|
||||||
git ls-remote --exit-code --heads origin dev
|
|
||||||
dev_exists="$?"
|
|
||||||
if [[ "$dev_exists" == 0 ]]; then
|
|
||||||
git switch dev
|
|
||||||
elif [[ "$dev_exists" == 2 ]]; then
|
|
||||||
git switch main
|
|
||||||
else
|
|
||||||
echo "ERROR: Unknown status for dev_exists, '$dev_exists'."
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
git pull
|
|
||||||
git push
|
|
||||||
else
|
|
||||||
echo "Not a Git project, skipping!"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo -e "\nDone!"
|
|
||||||
'
|
|
||||||
alias code-sync='code-check'
|
alias code-sync='code-check'
|
||||||
alias_code_reset: |
|
alias_code_reset: |
|
||||||
alias code-reset='
|
alias code-reset='
|
||||||
ls -d ~/Code/* | while read project
|
ls -d $HOME/Code/* | while read project
|
||||||
do echo "*** `basename $project` ***"
|
do echo "*** `basename $project` ***"
|
||||||
cd $project
|
cd $project
|
||||||
git stash
|
git stash
|
||||||
@@ -600,12 +671,13 @@
|
|||||||
done
|
done
|
||||||
'
|
'
|
||||||
function_code_reseed: |
|
function_code_reseed: |
|
||||||
function git_projects_to_sync {
|
function git_projects_to_sync() {
|
||||||
# Projects should be followed by the current development branch name.
|
# Projects should be followed by the current development branch name.
|
||||||
cat <<- EOF
|
cat <<- EOF
|
||||||
env-ansible dev
|
env-ansible dev
|
||||||
env-docker dev
|
env-docker dev
|
||||||
env-termux dev
|
env-termux dev
|
||||||
|
env-shared dev
|
||||||
env-obtainium-hyperling dev
|
env-obtainium-hyperling dev
|
||||||
nodejs-website dev
|
nodejs-website dev
|
||||||
ebook-health-protocol dev
|
ebook-health-protocol dev
|
||||||
@@ -614,11 +686,8 @@
|
|||||||
ebook-narcissism-healing dev
|
ebook-narcissism-healing dev
|
||||||
ebook-forest-howto dev
|
ebook-forest-howto dev
|
||||||
ebook-template main
|
ebook-template main
|
||||||
flutter-expense-tracker dev
|
|
||||||
flutter-social-traveler-app dev
|
|
||||||
nodejs-social-traveler-server dev
|
|
||||||
misc-spare-change main
|
misc-spare-change main
|
||||||
flutter-buddy-website dev
|
flutter-expense-tracker dev
|
||||||
flutter-sunset-alarm dev
|
flutter-sunset-alarm dev
|
||||||
android-infinite-timer dev
|
android-infinite-timer dev
|
||||||
android-carb-up dev
|
android-carb-up dev
|
||||||
@@ -626,16 +695,14 @@
|
|||||||
android-45-minute-rule dev
|
android-45-minute-rule dev
|
||||||
android-tictactoe dev
|
android-tictactoe dev
|
||||||
hugo-jackanope dev
|
hugo-jackanope dev
|
||||||
hugo-website dev
|
hugo-recipes dev
|
||||||
|
hugo-rvr dev
|
||||||
|
nomadic-weather dev
|
||||||
|
nomadic-weather.wiki main
|
||||||
EOF
|
EOF
|
||||||
|
# Above EOF cannot be indented unless using a tab, which would be mixed with spaces.
|
||||||
}
|
}
|
||||||
function code-reseed {
|
function code_seed() {
|
||||||
# Unseed current projects.
|
|
||||||
echo -e "\n*** Move old projects to TRASH ***"
|
|
||||||
unseed_dir="$HOME/TRASH/`date +%Y%m%d_%H%M%S`_UnseededCodeProjects"
|
|
||||||
mkdir -pv "$unseed_dir"
|
|
||||||
mv -v ~/Code/* "$unseed_dir"/ 2>/dev/null
|
|
||||||
|
|
||||||
# Git repo information.
|
# Git repo information.
|
||||||
git_repo_ssh={{ git_repo_ssh }}
|
git_repo_ssh={{ git_repo_ssh }}
|
||||||
git_main_project={{ git_project }}
|
git_main_project={{ git_project }}
|
||||||
@@ -645,18 +712,34 @@
|
|||||||
git_projects_to_sync | while read git_project git_branch; do
|
git_projects_to_sync | while read git_project git_branch; do
|
||||||
echo -e "\n*** $git_project ***"
|
echo -e "\n*** $git_project ***"
|
||||||
|
|
||||||
# Project folder manipulation.
|
# Project folder name manipulation.
|
||||||
dest_folder="$git_project"
|
dest_folder="$git_project"
|
||||||
if [[ "$dest_folder" == "flutter-"* ]]; then
|
if [[ "$dest_folder" == "flutter-"* ]]; then
|
||||||
echo "Using '_' for Flutter Project"
|
echo "FLUTTER: Removing 'flutter-' and using '_' rather than '-'."
|
||||||
|
dest_folder="${dest_folder//flutter-/}"
|
||||||
dest_folder="${dest_folder//-/_}"
|
dest_folder="${dest_folder//-/_}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download of the project.
|
# Download the project.
|
||||||
git clone ${git_repo_ssh_basename}${git_project} \
|
if [[ ! -d $HOME/Code/$dest_folder ]]; then
|
||||||
--branch $git_branch ~/Code/$dest_folder
|
git clone ${git_repo_ssh_basename}${git_project} \
|
||||||
|
--branch $git_branch $HOME/Code/$dest_folder
|
||||||
|
else
|
||||||
|
echo "'$dest_folder' already exists, skipping."
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
alias code-seed="code_seed "
|
||||||
|
function code_reseed() {
|
||||||
|
# Unseed current projects.
|
||||||
|
echo -e "\n*** Move old projects to TRASH ***"
|
||||||
|
unseed_dir="$HOME/TRASH/`date +%Y%m%d_%H%M%S`_UnseededCodeProjects"
|
||||||
|
mkdir -pv "$unseed_dir"
|
||||||
|
mv -v $HOME/Code/* "$unseed_dir"/ 2>/dev/null
|
||||||
|
|
||||||
|
code_seed
|
||||||
|
}
|
||||||
|
alias code-reseed="code_reseed "
|
||||||
function_clean_filenames: |
|
function_clean_filenames: |
|
||||||
function clean-filenames() {
|
function clean-filenames() {
|
||||||
# Must provide the directory you'd like to clean all the filenames in.
|
# Must provide the directory you'd like to clean all the filenames in.
|
||||||
@@ -686,8 +769,6 @@
|
|||||||
done
|
done
|
||||||
echo -e "\nDone!\n"
|
echo -e "\nDone!\n"
|
||||||
}
|
}
|
||||||
alias_clone: |
|
|
||||||
alias clone="rsync -auPhz --delete --exclude '.gradle' --exclude 'app/build'"
|
|
||||||
export_hyperling: |
|
export_hyperling: |
|
||||||
export HYPERLING6="2a07:e03:3:80::1"
|
export HYPERLING6="2a07:e03:3:80::1"
|
||||||
export HYPERLING4="185.130.47.173"
|
export HYPERLING4="185.130.47.173"
|
||||||
@@ -697,22 +778,33 @@
|
|||||||
if [[ -e $DOCKER_SOURCE && $LOGNAME == "root" ]]; then
|
if [[ -e $DOCKER_SOURCE && $LOGNAME == "root" ]]; then
|
||||||
source $DOCKER_SOURCE
|
source $DOCKER_SOURCE
|
||||||
fi
|
fi
|
||||||
alias_scan: |
|
export_prod:
|
||||||
alias scan="nmap -A -p- --script=vuln"
|
export PROD_HOST="{{ prod_host }}"
|
||||||
|
export PROD_PORT="{{ prod_port }}"
|
||||||
|
export PROD_USER="{{ prod_user }}"
|
||||||
|
|
||||||
|
export PROD_GIT_HOST="{{ git_host }}"
|
||||||
|
export PROD_GIT_PORT="{{ git_ssh_port }}"
|
||||||
|
export PROD_GIT_USER="{{ git_user }}"
|
||||||
|
|
||||||
|
export PROD_DATA_HOST="{{ prod_data_host }}"
|
||||||
|
export PROD_DATA_PORT="{{ prod_data_port }}"
|
||||||
|
export PROD_DATA_USER="{{ prod_data_user }}"
|
||||||
|
export PROD_DATA_DIR="{{ prod_data_dir }}"
|
||||||
alias_prod: |
|
alias_prod: |
|
||||||
alias prod="ssh -p {{ prod_port }} {{ prod_user }}@{{ prod_host }}"
|
alias prod="ssh -p {{ prod_port }} {{ prod_user }}@{{ prod_host }}"
|
||||||
function_clean_code: |
|
function_clean_code: |
|
||||||
function clean-code {
|
function clean-code() {
|
||||||
echo -e "******* Android *******\n*** Build Caches ***"
|
echo -e "******* Android *******\n*** Build Caches ***"
|
||||||
find ~/Code/android-*/app -maxdepth 1 -type d -name "build" \
|
find $HOME/Code/android-*/app -maxdepth 1 -type d -name "build" \
|
||||||
-exec du -hs {} \; -exec rm -rf {} \;
|
-exec du -hs {} \; -exec rm -rf {} \;
|
||||||
echo -e "\n*** Gradle Caches ***"
|
echo -e "\n*** Gradle Caches ***"
|
||||||
find ~/Code/android-*/ -maxdepth 1 -type d -name ".gradle" \
|
find $HOME/Code/android-*/ -maxdepth 1 -type d -name ".gradle" \
|
||||||
-exec du -hs {} \; -exec rm -rf {} \;
|
-exec du -hs {} \; -exec rm -rf {} \;
|
||||||
|
|
||||||
echo -e "******* Flutter *******"
|
echo -e "******* Flutter *******"
|
||||||
ls ~/Code | grep flutter | while read project; do
|
ls $HOME/Code | grep flutter | while read project; do
|
||||||
cd ~/Code/$project
|
cd $HOME/Code/$project
|
||||||
pwd
|
pwd
|
||||||
flutter clean
|
flutter clean
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
@@ -720,7 +812,7 @@
|
|||||||
cd
|
cd
|
||||||
|
|
||||||
echo -e "******* PDFs *******"
|
echo -e "******* PDFs *******"
|
||||||
find ~/Code/ebook-* -name "*.pdf" -exec du -h {} \; -delete | sort -h
|
find $HOME/Code/ebook-* -name "*.pdf" -exec du -h {} \; -delete | sort -h
|
||||||
|
|
||||||
echo -e "\n*** Done! ***"
|
echo -e "\n*** Done! ***"
|
||||||
}
|
}
|
||||||
@@ -738,7 +830,7 @@
|
|||||||
alias system-killer="kill-system"
|
alias system-killer="kill-system"
|
||||||
function_update_sdks: |
|
function_update_sdks: |
|
||||||
if [[ "$workstation" == "true" && "$coding" == "true" ]]; then
|
if [[ "$workstation" == "true" && "$coding" == "true" ]]; then
|
||||||
function update-sdks {
|
function update-sdks() {
|
||||||
echo -e "******* Update SDKs *******\n*** Android - START ***"
|
echo -e "******* Update SDKs *******\n*** Android - START ***"
|
||||||
yes | sdkmanager --update
|
yes | sdkmanager --update
|
||||||
yes | sdkmanager --licenses
|
yes | sdkmanager --licenses
|
||||||
@@ -756,7 +848,7 @@
|
|||||||
alias sdk-updater="update-sdks"
|
alias sdk-updater="update-sdks"
|
||||||
fi
|
fi
|
||||||
function_ansible_vars: |
|
function_ansible_vars: |
|
||||||
function ansible-var-list {
|
function ansible-var-list() {
|
||||||
cat << EOF
|
cat << EOF
|
||||||
provision
|
provision
|
||||||
battery
|
battery
|
||||||
@@ -769,7 +861,7 @@
|
|||||||
domain
|
domain
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
function ansible-vars {
|
function ansible-vars() {
|
||||||
ansible-var-list | while read var; do
|
ansible-var-list | while read var; do
|
||||||
echo "$var = ${!var}"
|
echo "$var = ${!var}"
|
||||||
done
|
done
|
||||||
@@ -779,26 +871,15 @@
|
|||||||
alias chmod='chmod -c'
|
alias chmod='chmod -c'
|
||||||
alias_iftop: |
|
alias_iftop: |
|
||||||
alias iftop='sudo iftop'
|
alias iftop='sudo iftop'
|
||||||
alias_ls: |
|
|
||||||
alias l='ls'
|
|
||||||
alias ll='ls -alh'
|
|
||||||
alias lh='ls -ash'
|
|
||||||
alias_progs: |
|
alias_progs: |
|
||||||
alias progs='ps -ef'
|
alias progs='ps -ef'
|
||||||
alias_nethogs: |
|
alias_nethogs: |
|
||||||
alias nethogs='sudo nethogs'
|
alias nethogs='sudo nethogs'
|
||||||
alias_ansible_facts: |
|
alias_ansible_facts: |
|
||||||
alias ansible-facts='ansible localhost -m setup --connection=local'
|
alias ansible-facts='ansible localhost -m setup --connection=local'
|
||||||
function_now: |
|
|
||||||
function now {
|
|
||||||
date "+%Y%m%d-%H%M%S"
|
|
||||||
}
|
|
||||||
function today {
|
|
||||||
date "+%Y%m%d"
|
|
||||||
}
|
|
||||||
function_backup: |
|
function_backup: |
|
||||||
export BACKUP_DIR="/srv/backup"
|
export BACKUP_DIR="/srv/backup"
|
||||||
function backup {
|
function backup() {
|
||||||
/usr/local/bin/backup_system.sh
|
/usr/local/bin/backup_system.sh
|
||||||
}
|
}
|
||||||
alias backup-system="backup"
|
alias backup-system="backup"
|
||||||
@@ -811,7 +892,7 @@
|
|||||||
function_pull_prod_backups: |
|
function_pull_prod_backups: |
|
||||||
export DOCKER="Docker"
|
export DOCKER="Docker"
|
||||||
export SYSTEM="System"
|
export SYSTEM="System"
|
||||||
function pull_prod_backup {
|
function pull_prod_backup() {
|
||||||
if [[ -z "$1" || ("$1" != "$DOCKER" && "$1" != "$SYSTEM") ]]; then
|
if [[ -z "$1" || ("$1" != "$DOCKER" && "$1" != "$SYSTEM") ]]; then
|
||||||
echo "ERROR: Parameter 1 not correct, expecting '$DOCKER' or '$SYSTEM'."
|
echo "ERROR: Parameter 1 not correct, expecting '$DOCKER' or '$SYSTEM'."
|
||||||
return 1
|
return 1
|
||||||
@@ -836,10 +917,10 @@
|
|||||||
rmdir -v tmp
|
rmdir -v tmp
|
||||||
else
|
else
|
||||||
echo "Failed!"
|
echo "Failed!"
|
||||||
mv tmp ~/TRASH/"tmp_`now`"
|
mv tmp $HOME/TRASH/"tmp_`now`"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
function pull_prod_backups {
|
function pull_prod_backups() {
|
||||||
dir="ProductionBackups-Pulled`today`"
|
dir="ProductionBackups-Pulled`today`"
|
||||||
mkdir -pv "$dir"
|
mkdir -pv "$dir"
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
@@ -861,15 +942,8 @@
|
|||||||
alias prod-backup="pull_prod_backups"
|
alias prod-backup="pull_prod_backups"
|
||||||
alias pull-prod="pull_prod_backups"
|
alias pull-prod="pull_prod_backups"
|
||||||
alias prod-pull="pull_prod_backups"
|
alias prod-pull="pull_prod_backups"
|
||||||
function_log: |
|
|
||||||
function log {
|
|
||||||
echo -e "$1"
|
|
||||||
}
|
|
||||||
function blog {
|
|
||||||
echo -e "\n\n$1\n\n"
|
|
||||||
}
|
|
||||||
function_debian_upgrade: |
|
function_debian_upgrade: |
|
||||||
function debian-upgrade {
|
function debian-upgrade() {
|
||||||
typeset -l OLD NEW
|
typeset -l OLD NEW
|
||||||
OLD="$1"
|
OLD="$1"
|
||||||
NEW="$2"
|
NEW="$2"
|
||||||
@@ -940,9 +1014,9 @@
|
|||||||
alias upgrade-debian="debian-upgrade"
|
alias upgrade-debian="debian-upgrade"
|
||||||
function_ebook_convert: |
|
function_ebook_convert: |
|
||||||
# Regenerate all eBook projects at once.
|
# Regenerate all eBook projects at once.
|
||||||
function ebook-convert {
|
function ebook-convert() {
|
||||||
find ~/Code/ebook-* -name "*.pdf" -print -delete
|
find $HOME/Code/ebook-* -name "*.pdf" -print -delete
|
||||||
find ~/Code/ebook-* -name convert.sh -print -exec bash "{}" \;
|
find $HOME/Code/ebook-* -name convert.sh -print -exec bash "{}" \;
|
||||||
}
|
}
|
||||||
alias ebooks="ebook-convert"
|
alias ebooks="ebook-convert"
|
||||||
alias convert="ebook-convert"
|
alias convert="ebook-convert"
|
||||||
@@ -951,7 +1025,7 @@
|
|||||||
alias sudo="sudo "
|
alias sudo="sudo "
|
||||||
function_load_branch: |
|
function_load_branch: |
|
||||||
# Change a branch to point at another.
|
# Change a branch to point at another.
|
||||||
function load-branch {
|
function load-branch() {
|
||||||
rcvr="$1" # branch which we want to modify
|
rcvr="$1" # branch which we want to modify
|
||||||
base="$2" # branch with the changes we want
|
base="$2" # branch with the changes we want
|
||||||
|
|
||||||
@@ -1012,7 +1086,7 @@
|
|||||||
alias reset-stage="load-branch stage main"
|
alias reset-stage="load-branch stage main"
|
||||||
alias reset-dev="load-branch dev main"
|
alias reset-dev="load-branch dev main"
|
||||||
function check-code-branches {
|
function check-code-branches {
|
||||||
for dir in ~/Code/*/; do
|
for dir in $HOME/Code/*/; do
|
||||||
cd $dir
|
cd $dir
|
||||||
pwd
|
pwd
|
||||||
git ls-remote --heads
|
git ls-remote --heads
|
||||||
@@ -1024,7 +1098,7 @@
|
|||||||
alias check-branch="git ls-remote --heads"
|
alias check-branch="git ls-remote --heads"
|
||||||
alias branch-check="check-branch"
|
alias branch-check="check-branch"
|
||||||
alias_reload_bash: |
|
alias_reload_bash: |
|
||||||
alias reload-bash="source ~/.bashrc"
|
alias reload-bash="source $HOME/.bashrc"
|
||||||
alias bash-reload="reload-bash"
|
alias bash-reload="reload-bash"
|
||||||
alias shell-reload="reload-bash"
|
alias shell-reload="reload-bash"
|
||||||
alias reload-shell="reload-bash"
|
alias reload-shell="reload-bash"
|
||||||
@@ -1043,10 +1117,10 @@
|
|||||||
alias_flatpak_clean: |
|
alias_flatpak_clean: |
|
||||||
alias flatpak-clean="flatpak uninstall --unused"
|
alias flatpak-clean="flatpak uninstall --unused"
|
||||||
alias_commit: |
|
alias_commit: |
|
||||||
function commit_usage {
|
function commit_usage() {
|
||||||
echo 'Usage: commit "This is a commit message"'
|
echo 'Usage: commit "This is a commit message"'
|
||||||
}
|
}
|
||||||
function commit {
|
function commit() {
|
||||||
if [[ -z "$1" ]]; then
|
if [[ -z "$1" ]]; then
|
||||||
echo "ERROR: Message must be provided."
|
echo "ERROR: Message must be provided."
|
||||||
commit_usage
|
commit_usage
|
||||||
@@ -1063,9 +1137,127 @@
|
|||||||
status="$?"
|
status="$?"
|
||||||
return "$status"
|
return "$status"
|
||||||
}
|
}
|
||||||
|
function_loop: |
|
||||||
|
function loop() {
|
||||||
|
cmd="$@"
|
||||||
|
sleep=""
|
||||||
|
sleep_time=5
|
||||||
|
if [[ "$cmd" != *"sleep"* ]]; then
|
||||||
|
sleep='echo -e "`date` - Sleeping for $sleep_time... \n"; sleep $sleep_time'
|
||||||
|
fi
|
||||||
|
count=0
|
||||||
|
echo "Command='$cmd'"
|
||||||
|
while true; do
|
||||||
|
(( count++ ))
|
||||||
|
echo "`date` - Loop $count"
|
||||||
|
eval $cmd
|
||||||
|
eval $sleep
|
||||||
|
done;
|
||||||
|
}
|
||||||
|
alias try="loop "
|
||||||
|
source_shared: |
|
||||||
|
if [ -f $HOME/.rc_shared ]; then
|
||||||
|
source $HOME/.rc_shared
|
||||||
|
fi
|
||||||
|
process_notify_log: |
|
||||||
|
if [[ -e {{ notify_log_file }} ]]; then
|
||||||
|
cp "{{ notify_log_file }}" "{{ notify_log_file_wip }}" 1>/dev/null
|
||||||
|
echo -n "" > "{{ notify_log_file }}"
|
||||||
|
cat "{{ notify_log_file_wip }}" | while read title message; do
|
||||||
|
notify-send "$title" "$message"
|
||||||
|
done
|
||||||
|
sh -c "rm '{{ notify_log_file_wip }}'"
|
||||||
|
fi
|
||||||
|
function_reconnect: |
|
||||||
|
function reconnect() {
|
||||||
|
test_domain="git.hyperling.com"
|
||||||
|
test_connection() {
|
||||||
|
ping -c 3 $test_domain
|
||||||
|
status="$?"
|
||||||
|
echo "* Status Returned: '$status'"
|
||||||
|
return $status
|
||||||
|
}
|
||||||
|
test_connection &&
|
||||||
|
echo -e "\n* Looks good! Not trying anything." &&
|
||||||
|
return 0 ||
|
||||||
|
echo -e "\n* Connection failed, troubleshooting..."
|
||||||
|
|
||||||
|
show_connection() {
|
||||||
|
ip addr | grep ' UP '
|
||||||
|
ip addr | grep ' inet'
|
||||||
|
#ip addr | grep -i 'mullvad'
|
||||||
|
}
|
||||||
|
echo -e "\n* Current Connections:"
|
||||||
|
show_connection
|
||||||
|
|
||||||
|
reset_mullvad() {
|
||||||
|
mullvad disconnect && sleep 5 && mullvad connect && sleep 10
|
||||||
|
}
|
||||||
|
echo -e "\n* Turning Mullvad Off & On Again"
|
||||||
|
reset_mullvad
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
|
echo -e "\n* Checking Connections"
|
||||||
|
show_connection
|
||||||
|
|
||||||
|
echo -e "\n* Testing Again..."
|
||||||
|
test_connection &&
|
||||||
|
echo -e "\n* Looks good! Not trying anything else." &&
|
||||||
|
return 0 ||
|
||||||
|
echo -e "\n* Connection failed, troubleshooting more..."
|
||||||
|
|
||||||
|
reset_wifi() {
|
||||||
|
wifi off
|
||||||
|
sleep 5
|
||||||
|
wifi on
|
||||||
|
sleep 10
|
||||||
|
}
|
||||||
|
echo -e "\n* Turning WiFi Off & On Again"
|
||||||
|
reset_wifi
|
||||||
|
echo "Done!"
|
||||||
|
|
||||||
|
echo -e "\n* Testing Again..."
|
||||||
|
test_connection &&
|
||||||
|
echo -e "\n* Looks good now!" &&
|
||||||
|
return 0 ||
|
||||||
|
echo -e "\n* Connection still failed, maybe try rebooting?"
|
||||||
|
}
|
||||||
|
alias test_wifi="reconnect"
|
||||||
|
alias test_network="reconnect"
|
||||||
|
alias test_connection="reconnect"
|
||||||
|
alias test_connections="reconnect"
|
||||||
|
alias fix_wifi="reconnect"
|
||||||
|
alias fix_network="reconnect"
|
||||||
|
alias fix_connection="reconnect"
|
||||||
|
alias fix_connections="reconnect"
|
||||||
|
function_reset_android_studio: |
|
||||||
|
# Useful after Android Studio is closed improperly. Resets all settings.
|
||||||
|
function reset_android_studio() {
|
||||||
|
mv -v ~/.var/app/com.google.AndroidStudio ~/TRASH/com.google.AndroidStudio-`date +"%Y%m%d"`
|
||||||
|
}
|
||||||
|
alias reset-android-studio="reset_android_studio "
|
||||||
|
function_follow: |
|
||||||
|
function follow() {
|
||||||
|
tail -n +1 -F "$@"
|
||||||
|
}
|
||||||
|
alias chase="follow "
|
||||||
|
function_restart: |
|
||||||
|
function restart() {
|
||||||
|
prog="$1"
|
||||||
|
sudo sv restart $prog
|
||||||
|
follow /var/log/$prog/current
|
||||||
|
}
|
||||||
|
alias reload="restart "
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Common Variable
|
- name: General | Account Management | Users | Files | Common Variable
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
profile_common: |
|
||||||
|
{{ export_path_additions }}
|
||||||
|
{{ export_path_sbin }}
|
||||||
|
{{ export_terminal }}
|
||||||
|
{{ export_browser }}
|
||||||
|
{{ keyboard_settings }}
|
||||||
|
{{ export_notify }}
|
||||||
rc_common: |
|
rc_common: |
|
||||||
# Fixes "command not found" when using aliases within functions.
|
# Fixes "command not found" when using aliases within functions.
|
||||||
shopt -s expand_aliases
|
shopt -s expand_aliases
|
||||||
@@ -1082,7 +1274,7 @@
|
|||||||
export server="{{ server }}"
|
export server="{{ server }}"
|
||||||
export domain="{{ domain }}"
|
export domain="{{ domain }}"
|
||||||
|
|
||||||
{{ export_path_additions }}
|
{{ source_shared }}
|
||||||
{{ alias_cp }}
|
{{ alias_cp }}
|
||||||
{{ alias_mv }}
|
{{ alias_mv }}
|
||||||
{{ alias_rm }}
|
{{ alias_rm }}
|
||||||
@@ -1116,10 +1308,9 @@
|
|||||||
{{ function_code_reseed }}
|
{{ function_code_reseed }}
|
||||||
{{ function_clean_filenames }}
|
{{ function_clean_filenames }}
|
||||||
{{ function_clean_filenames_tree }}
|
{{ function_clean_filenames_tree }}
|
||||||
{{ alias_clone }}
|
|
||||||
{{ export_hyperling }}
|
{{ export_hyperling }}
|
||||||
{{ source_docker_env }}
|
{{ source_docker_env }}
|
||||||
{{ alias_scan }}
|
{{ export_prod }}
|
||||||
{{ alias_prod }}
|
{{ alias_prod }}
|
||||||
{{ function_clean_code }}
|
{{ function_clean_code }}
|
||||||
{{ alias_kill_battery }}
|
{{ alias_kill_battery }}
|
||||||
@@ -1128,14 +1319,11 @@
|
|||||||
{{ function_ansible_vars }}
|
{{ function_ansible_vars }}
|
||||||
{{ alias_permission_commands }}
|
{{ alias_permission_commands }}
|
||||||
{{ alias_iftop }}
|
{{ alias_iftop }}
|
||||||
{{ alias_ls }}
|
|
||||||
{{ alias_progs }}
|
{{ alias_progs }}
|
||||||
{{ alias_nethogs }}
|
{{ alias_nethogs }}
|
||||||
{{ alias_ansible_facts }}
|
{{ alias_ansible_facts }}
|
||||||
{{ function_now }}
|
|
||||||
{{ function_backup }}
|
{{ function_backup }}
|
||||||
{{ function_pull_prod_backups }}
|
{{ function_pull_prod_backups }}
|
||||||
{{ function_log }}
|
|
||||||
{{ function_debian_upgrade }}
|
{{ function_debian_upgrade }}
|
||||||
{{ function_ebook_convert }}
|
{{ function_ebook_convert }}
|
||||||
{{ alias_sudo }}
|
{{ alias_sudo }}
|
||||||
@@ -1146,26 +1334,55 @@
|
|||||||
{{ alias_docker_other }}
|
{{ alias_docker_other }}
|
||||||
{{ alias_flatpak_clean }}
|
{{ alias_flatpak_clean }}
|
||||||
{{ alias_commit }}
|
{{ alias_commit }}
|
||||||
|
{{ function_loop }}
|
||||||
|
{{ process_notify_log }}
|
||||||
|
{{ function_reconnect }}
|
||||||
|
{{ function_reset_android_studio }}
|
||||||
|
{{ function_follow }}
|
||||||
|
{{ function_restart }}
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | Files | .profile + .xsessionrc
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
|
block: |
|
||||||
|
{{ profile_common }}
|
||||||
|
|
||||||
|
[[ $(whoami) != "root" ]] &&
|
||||||
|
echo "`date` - Ansible .profile loaded successfully!"
|
||||||
|
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: false
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- ".profile"
|
||||||
|
- ".xprofile"
|
||||||
|
- ".xsessionrc"
|
||||||
|
when: user_user.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .bashrc
|
- name: General | Account Management | Users | Files | .bashrc
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}/.bashrc"
|
path: "{{ item }}/.bashrc"
|
||||||
block: |
|
block: |
|
||||||
{{ rc_common }}
|
{{ rc_common }}
|
||||||
|
|
||||||
|
# Export all functions! #
|
||||||
|
eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
|
||||||
|
|
||||||
[[ $(whoami) != "root" ]] &&
|
[[ $(whoami) != "root" ]] &&
|
||||||
echo "`date` - Ansible .bashrc loaded successfully!"
|
echo "`date` - Ansible .bashrc loaded successfully!"
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
|
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: false
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_root.home }}"
|
- "{{ user_root.home }}"
|
||||||
- "{{ user_user.home }}"
|
- "{{ user_user.home }}"
|
||||||
ignore_errors: yes
|
|
||||||
when: user_root.home != "" and user_user.home != ""
|
when: user_root.home != "" and user_user.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .zshrc
|
- name: General | Account Management | Users | Files | .zshrc
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}/.zshrc"
|
path: "{{ item }}/.zshrc"
|
||||||
block: |
|
block: |
|
||||||
{{ rc_common }}
|
{{ rc_common }}
|
||||||
@@ -1173,59 +1390,39 @@
|
|||||||
echo "`date` - Ansible .zshrc loaded successfully!"
|
echo "`date` - Ansible .zshrc loaded successfully!"
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
|
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: false
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_root.home }}"
|
- "{{ user_root.home }}"
|
||||||
- "{{ user_user.home }}"
|
- "{{ user_user.home }}"
|
||||||
ignore_errors: yes
|
|
||||||
when: user_root.home != "" and user_user.home != ""
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .vimrc
|
|
||||||
blockinfile:
|
|
||||||
path: "{{ item }}/.vimrc"
|
|
||||||
block: |
|
|
||||||
" Turn off syntax, flashy lights, etc. Make VIM into a basic editor.
|
|
||||||
syntax off
|
|
||||||
set nohlsearch
|
|
||||||
set noautoindent noautowrite noshowmatch wrapmargin=0 report=1 ts=3
|
|
||||||
set ignorecase
|
|
||||||
|
|
||||||
" Turn off auto-commenting.
|
|
||||||
autocmd Filetype * set fo-=c fo-=r fo-=o
|
|
||||||
|
|
||||||
" qq shortcut for immediately exiting all files without saving.
|
|
||||||
nnoremap qq :qa!<cr>
|
|
||||||
marker: '" {mark} MANAGED BY ANSIBLE | vimrc'
|
|
||||||
state: present
|
|
||||||
create: yes
|
|
||||||
backup: yes
|
|
||||||
loop:
|
|
||||||
- "{{ user_root.home }}"
|
|
||||||
- "{{ user_user.home }}"
|
|
||||||
ignore_errors: yes
|
|
||||||
when: user_root.home != "" and user_user.home != ""
|
when: user_root.home != "" and user_user.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Ownership
|
- name: General | Account Management | Users | Files | Ownership
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ user_user.home }}/{{ item }}"
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop:
|
loop:
|
||||||
- .bashrc
|
- .bashrc
|
||||||
- .zshrc
|
- .zshrc
|
||||||
- .vimrc
|
- .profile
|
||||||
|
- .xprofile
|
||||||
|
- .xsessionrc
|
||||||
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Helper Functions (Reset)
|
- name: General | Account Management | Users | Files | Helper Functions (Reset)
|
||||||
shell: "rm -v {{ global_bin }}/*.function"
|
ansible.builtin.shell: "rm -v {{ global_bin }}/*.function"
|
||||||
|
ignore_errors: true
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Helper Functions
|
- name: General | Account Management | Users | Files | Helper Functions
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ global_bin }}"
|
dest: "{{ global_bin }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ root_group }}"
|
group: "{{ root_group }}"
|
||||||
mode: 0755
|
mode: "0755"
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
- "functions/*.function"
|
- "functions/*.function"
|
||||||
@@ -7,20 +7,50 @@
|
|||||||
# $RANDOM / 50 can be up to about 650 seconds, or ~11 minutes.
|
# $RANDOM / 50 can be up to about 650 seconds, or ~11 minutes.
|
||||||
# $RANDOM / 100 can be up to about 320 seconds, or ~5 minutes.
|
# $RANDOM / 100 can be up to about 320 seconds, or ~5 minutes.
|
||||||
# This prevents multiple systems from hitting it at the exact same time.
|
# This prevents multiple systems from hitting it at the exact same time.
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Facts 01
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
#ansible_cron_log: "~/{{ ansible_hostname }}.ansible-pull.`date +'%Y%m%d-%H%M%S'`.log"
|
||||||
|
ansible_cron_log: "~/{{ ansible_hostname }}.ansible-pull.log"
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Facts 02
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
ansible_cron_log_old: "{{ ansible_cron_log }}.old"
|
||||||
|
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Log | Delete Old
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ ansible_cron_log_old }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Log | Check
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ ansible_cron_log }}"
|
||||||
|
register: ansible_cron_log_check
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Log | Rename [if >1MB]
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ ansible_cron_log }}"
|
||||||
|
dest: "{{ ansible_cron_log_old }}"
|
||||||
|
mode: "0755"
|
||||||
|
when: ansible_cron_log_check.stat.exists
|
||||||
|
and ansible_cron_log_check.stat.size > 1000000
|
||||||
|
|
||||||
|
|
||||||
- name: General | Cron | Ansible | Create Subscriber Job
|
- name: General | Cron | Ansible | Create Subscriber Job
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: "Ansible Sync"
|
name: "Ansible Sync"
|
||||||
minute: "*/30"
|
minute: "*/30"
|
||||||
job: "bash -c 'sleep $(( $RANDOM / 20 )); sudo {{ ansible_pull_exec.stdout }} -v -o -U {{ git_repo_http }} --checkout {{ branch }}'"
|
job: "bash -c 'sleep $(( $RANDOM / 20 )); sudo {{ ansible_pull_exec.stdout }} -v -o -U {{ git_repo_http }} --checkout {{ branch }} >>{{ ansible_cron_log }} 2>&1'"
|
||||||
state: present
|
state: present
|
||||||
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
||||||
|
|
||||||
- name: General | Cron | Ansible | Create Forced Weekly Subscriber Job
|
- name: General | Cron | Ansible | Create Forced Weekly Subscriber Job
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: "Ansible Weekly Forced Sync"
|
name: "Ansible Weekly Forced Sync"
|
||||||
special_time: daily
|
special_time: weekly
|
||||||
job: "bash -c 'sleep $(( $RANDOM / 1 )); sudo {{ ansible_pull_exec.stdout }} -v -U {{ git_repo_http }} --checkout {{ branch }}'"
|
job: "bash -c 'sleep $(( $RANDOM / 1 )); sudo {{ ansible_pull_exec.stdout }} -v -U {{ git_repo_http }} --checkout {{ branch }} >>{{ ansible_cron_log }} 2>&1'"
|
||||||
state: present
|
state: present
|
||||||
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
---
|
||||||
|
# 20261002 - Hyperling
|
||||||
|
# Move internet requiring code out of users.yml.
|
||||||
|
|
||||||
|
# Shared Environment Setup #
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | env-shared | Download / Update
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: https://git.hyperling.com/me/env-shared
|
||||||
|
version: "{{ branch }}"
|
||||||
|
dest: "{{ shared_rc_install_dir }}"
|
||||||
|
clone: true
|
||||||
|
force: true
|
||||||
|
update: true
|
||||||
|
#ignore_errors: true
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | env-shared | Install | .rc_shared
|
||||||
|
copy:
|
||||||
|
src: "{{ shared_rc_install_dir }}/rc_shared.sh"
|
||||||
|
dest: "{{ item }}/.rc_shared"
|
||||||
|
owner: root
|
||||||
|
group: "{{ root_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- "{{ user_root.home }}"
|
||||||
|
- "{{ user_user.home }}"
|
||||||
|
#ignore_errors: true
|
||||||
|
when: user_root.home != "" and user_user.home != ""
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | env-shared | Install | .vimrc
|
||||||
|
copy:
|
||||||
|
src: "{{ shared_rc_install_dir }}/vimrc.vim"
|
||||||
|
dest: "{{ item }}/.vimrc"
|
||||||
|
owner: root
|
||||||
|
group: "{{ root_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- "{{ user_root.home }}"
|
||||||
|
- "{{ user_user.home }}"
|
||||||
|
#ignore_errors: true
|
||||||
|
when: user_root.home != "" and user_user.home != ""
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | env-shared | Permissions
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- .rc_shared
|
||||||
|
- .vimrc
|
||||||
|
#ignore_errors: true
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: General | Scripts | Install | Copy Files
|
- name: General | Scripts | Install | Copy Files
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: 'scripts/'
|
src: 'scripts/'
|
||||||
dest: "{{ global_bin }}/"
|
dest: "{{ global_bin }}/"
|
||||||
owner: root
|
owner: root
|
||||||
@@ -16,10 +16,12 @@
|
|||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: General | Scripts | Install | Remove Old Scripts
|
- name: General | Scripts | Install | Remove Old Scripts
|
||||||
shell: |
|
ansible.builtin.shell: |
|
||||||
if [[ -e {{ global_bin }}/{{ item }} ]]; then
|
if [[ -e {{ global_bin }}/{{ item }} ]]; then
|
||||||
rm -v {{ global_bin }}/{{ item }}
|
rm -v {{ global_bin }}/{{ item }}
|
||||||
fi
|
fi
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
loop:
|
loop:
|
||||||
- compress-video.sh
|
- compress-video.sh
|
||||||
- compress-images.sh
|
- compress-images.sh
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Create file to easily push git changes and call SCM.
|
# Create file to easily push git changes and call SCM.
|
||||||
|
|
||||||
- name: General | Scripts | Root | scm.sh
|
- name: General | Scripts | Root | scm.sh
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ user_root.home }}/bin/scm.sh"
|
path: "{{ user_root.home }}/bin/scm.sh"
|
||||||
block: |
|
block: |
|
||||||
# 20210211 - Make life easier!
|
# 20210211 - Make life easier!
|
||||||
@@ -11,16 +11,11 @@
|
|||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
|
||||||
- name: General | Scripts | Root | scm.sh Permissions
|
|
||||||
file:
|
|
||||||
path: "{{ user_root.home }}/bin/scm.sh"
|
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
|
|
||||||
- name: General | Scripts | Root | scm-dev.sh
|
- name: General | Scripts | Root | scm-dev.sh
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ user_root.home }}/bin/scm-dev.sh"
|
path: "{{ user_root.home }}/bin/scm-dev.sh"
|
||||||
block: |
|
block: |
|
||||||
# 20210713 - Make life easier for development!
|
# 20210713 - Make life easier for development!
|
||||||
@@ -41,9 +36,5 @@
|
|||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
|
||||||
- name: General | Scripts | Root | scm-dev.sh Permissions
|
|
||||||
file:
|
|
||||||
path: "{{ user_root.home }}/bin/scm-dev.sh"
|
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# Create file to easily push git changes and call SCM.
|
# Create file to easily push git changes and call SCM.
|
||||||
|
|
||||||
- name: General | Scripts | User | scm.sh
|
- name: General | Scripts | User | scm.sh
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ user_user.home }}/bin/scm.sh"
|
path: "{{ user_user.home }}/bin/scm.sh"
|
||||||
block: |
|
block: |
|
||||||
# 20210211 - Make life easier!
|
# 20210211 - Make life easier!
|
||||||
@@ -11,16 +11,16 @@
|
|||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
|
||||||
- name: General | Scripts | User | scm.sh Permissions
|
- name: General | Scripts | User | scm.sh Permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ user_user.home }}/bin/scm.sh"
|
path: "{{ user_user.home }}/bin/scm.sh"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
|
|
||||||
- name: General | Scripts | User | scm-dev.sh
|
- name: General | Scripts | User | scm-dev.sh
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ user_user.home }}/bin/scm-dev.sh"
|
path: "{{ user_user.home }}/bin/scm-dev.sh"
|
||||||
block: |
|
block: |
|
||||||
# 20210713 - Make life easier for development!
|
# 20210713 - Make life easier for development!
|
||||||
@@ -41,9 +41,9 @@
|
|||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
|
||||||
- name: General | Scripts | User | scm-dev.sh Permissions
|
- name: General | Scripts | User | scm-dev.sh Permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ user_user.home }}/bin/scm-dev.sh"
|
path: "{{ user_user.home }}/bin/scm-dev.sh"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
# 20260716 - Hyperling
|
||||||
|
# Ensure the correct International AltGr keyboard setting is always chosen.
|
||||||
|
|
||||||
|
- name: General | Settings | Keyboard | Default Config
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: "/etc/default/keyboard"
|
||||||
|
regexp: '{{ item.key }}'
|
||||||
|
line: '{{ item.value }}'
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
loop:
|
||||||
|
#- { "key": '^[\#]?XKBMODEL', "value": 'XKBMODEL="pc105"'}
|
||||||
|
- { "key": '^[\#]?XKBLAYOUT', "value": 'XKBLAYOUT="us"'}
|
||||||
|
- { "key": '^[\#]?XKBVARIANT', "value": 'XKBVARIANT="altgr-intl"'}
|
||||||
@@ -4,51 +4,42 @@
|
|||||||
## Cron ##
|
## Cron ##
|
||||||
|
|
||||||
- name: General | Software | Services | CROND | Enable
|
- name: General | Software | Services | CROND | Enable
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: "{{ crond }}"
|
name: "{{ crond }}"
|
||||||
pattern: "{{ crond_pattern }}"
|
pattern: "{{ crond_pattern }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: true
|
||||||
when: ansible_virtualization_type != 'docker'
|
when: ansible_virtualization_type != 'docker'
|
||||||
|
and ansible_service_mgr != "runit"
|
||||||
register: cron_status
|
register: cron_status
|
||||||
until: cron_status.state == "started"
|
until: cron_status.state == "started"
|
||||||
retries: 3
|
retries: 3
|
||||||
delay: 3
|
delay: 3
|
||||||
|
|
||||||
|
- name: General | Software | Services | CROND | Enable (runit)
|
||||||
## CUPS ##
|
ansible.builtin.service:
|
||||||
|
name: "{{ crond }}"
|
||||||
- name: General | Software | Services | CUPS | Disable
|
state: started
|
||||||
service:
|
enabled: true
|
||||||
name: "{{ cups }}"
|
when: ansible_virtualization_type != 'docker'
|
||||||
pattern: "{{ cups_pattern }}"
|
and ansible_service_mgr == "runit"
|
||||||
state: stopped
|
ignore_errors: true # Service module seems experimental for this init system.
|
||||||
enabled: no
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: General | Software | Services | CUPS-Browse | Disable
|
|
||||||
service:
|
|
||||||
name: "{{ cups_browse }}"
|
|
||||||
pattern: "{{ cups_browse_pattern }}"
|
|
||||||
state: stopped
|
|
||||||
enabled: no
|
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
|
|
||||||
## SSHD ##
|
## SSHD ##
|
||||||
|
|
||||||
- name: General | Software | Services | SSHD | Configure
|
- name: General | Software | Services | SSHD | Configure
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ sshd_config }}"
|
path: "{{ sshd_config }}"
|
||||||
regexp: '{{ item.key }}'
|
regexp: '{{ item.key }}'
|
||||||
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
loop:
|
loop:
|
||||||
- { "key": '^[\#]?AllowUsers', "value": 'AllowUsers {{ user }}'}
|
- { "key": '^[\#]?AllowUsers', "value": 'AllowUsers {{ user }}'}
|
||||||
- { "key": '^[\#]?PermitRootLogin', "value": 'PermitRootLogin no'}
|
- { "key": '^[\#]?PermitRootLogin', "value": 'PermitRootLogin no'}
|
||||||
- { "key": '^[\#]?AllowTcpForwarding', "value": 'AllowTcpForwarding no'}
|
- { "key": '^[\#]?AllowTcpForwarding', "value": 'AllowTcpForwarding yes'}
|
||||||
- { "key": '^[\#]?ClientAliveInterval', "value": 'ClientAliveInterval 60'}
|
- { "key": '^[\#]?ClientAliveInterval', "value": 'ClientAliveInterval 60'}
|
||||||
- { "key": '^[\#]?ClientAliveCountMax', "value": 'ClientAliveCountMax 2'}
|
- { "key": '^[\#]?ClientAliveCountMax', "value": 'ClientAliveCountMax 2'}
|
||||||
- { "key": '^[\#]?Compression', "value": 'Compression no'}
|
- { "key": '^[\#]?Compression', "value": 'Compression no'}
|
||||||
@@ -60,15 +51,17 @@
|
|||||||
- { "key": '^[\#]?X11Forwarding', "value": 'X11Forwarding no'}
|
- { "key": '^[\#]?X11Forwarding', "value": 'X11Forwarding no'}
|
||||||
- { "key": '^[\#]?AllowAgentForwarding', "value": 'AllowAgentForwarding no'}
|
- { "key": '^[\#]?AllowAgentForwarding', "value": 'AllowAgentForwarding no'}
|
||||||
- { "key": '^[\#]?PermitEmptyPasswords', "value": 'PermitEmptyPasswords no'}
|
- { "key": '^[\#]?PermitEmptyPasswords', "value": 'PermitEmptyPasswords no'}
|
||||||
|
- { "key": '^[\#]?GatewayPorts', "value": 'GatewayPorts yes'}
|
||||||
|
|
||||||
- name: General | Software | Services | SSHD | Configure (PVE)
|
- name: General | Software | Services | SSHD | Configure (PVE)
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ sshd_config }}"
|
path: "{{ sshd_config }}"
|
||||||
regexp: '{{ item.key }}'
|
regexp: '{{ item.key }}'
|
||||||
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0644"
|
||||||
loop:
|
loop:
|
||||||
- { "key": '^[\#]?AllowUsers', "value": 'AllowUsers root {{ user }}'}
|
- { "key": '^[\#]?AllowUsers', "value": 'AllowUsers root {{ user }}'}
|
||||||
- { "key": '^[\#]?PermitRootLogin', "value": 'PermitRootLogin yes'}
|
- { "key": '^[\#]?PermitRootLogin', "value": 'PermitRootLogin yes'}
|
||||||
@@ -76,46 +69,48 @@
|
|||||||
when: "'pve' in ansible_kernel"
|
when: "'pve' in ansible_kernel"
|
||||||
|
|
||||||
- name: General | Software | Services | SSHD | Enable
|
- name: General | Software | Services | SSHD | Enable
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: "{{ sshd }}"
|
name: "{{ sshd }}"
|
||||||
pattern: "{{ sshd_pattern }}"
|
pattern: "{{ sshd_pattern }}"
|
||||||
state: reloaded
|
state: reloaded
|
||||||
enabled: yes
|
enabled: true
|
||||||
when: ansible_virtualization_type != 'docker'
|
when: ansible_virtualization_type != 'docker'
|
||||||
|
and ansible_service_mgr != "runit"
|
||||||
register: sshd_status
|
register: sshd_status
|
||||||
until: sshd_status.state == "started"
|
until: sshd_status.state == "started"
|
||||||
retries: 3
|
retries: 3
|
||||||
delay: 3
|
delay: 3
|
||||||
|
|
||||||
|
|
||||||
## JournalCTL ##
|
## JournalCTL ##
|
||||||
|
|
||||||
- name: General | Software | Services | JournalCTL | Reduce Log Size
|
- name: General | Software | Services | JournalCTL | Reduce Log Size
|
||||||
shell: journalctl --vacuum-size=100M
|
ansible.builtin.shell: journalctl --vacuum-size=100M
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
ignore_errors: yes
|
and ansible_service_mgr == "systemd"
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
## Bluetooth ##
|
## Bluetooth ##
|
||||||
# Do people seriously depend on Bluetooth? Plug your devices in, silly!
|
# Do people seriously depend on Bluetooth? Plug your devices in, silly!
|
||||||
|
# Hehe, I use it now for a few rare things so disabling this for now.
|
||||||
|
|
||||||
- name: General | Software | Services | Bluetooth | Disable
|
#- name: General | Software | Services | Bluetooth | Disable
|
||||||
service:
|
# ansible.builtin.service:
|
||||||
name: "{{ bluetooth }}"
|
# name: "{{ bluetooth }}"
|
||||||
pattern: "{{ bluetooth_pattern }}"
|
# pattern: "{{ bluetooth_pattern }}"
|
||||||
state: stopped
|
# state: stopped
|
||||||
enabled: no
|
# enabled: false
|
||||||
ignore_errors: yes
|
# ignore_errors: true
|
||||||
|
|
||||||
## NTP ##
|
## NTP ##
|
||||||
|
|
||||||
- name: General | Software | Services | NTP | Enable
|
- name: General | Software | Services | NTP | Enable
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: "{{ ntp_server }}"
|
name: "{{ ntp_server }}"
|
||||||
pattern: "{{ ntp_server }}"
|
pattern: "{{ ntp_server }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: true
|
||||||
when: ansible_virtualization_type != 'docker'
|
when: ansible_virtualization_type != 'docker'
|
||||||
|
and ansible_service_mgr != "runit"
|
||||||
register: ntp_status
|
register: ntp_status
|
||||||
until: ntp_status.state == "started"
|
until: ntp_status.state == "started"
|
||||||
retries: 3
|
retries: 3
|
||||||
@@ -127,3 +122,30 @@
|
|||||||
# Add a field to general.yml config file which gets applied via timedatectl and /etc/localtime.
|
# Add a field to general.yml config file which gets applied via timedatectl and /etc/localtime.
|
||||||
# Example of what to do to file:
|
# Example of what to do to file:
|
||||||
# /etc/localtime -> ../usr/share/zoneinfo/America/Phoenix
|
# /etc/localtime -> ../usr/share/zoneinfo/America/Phoenix
|
||||||
|
|
||||||
|
## Disable ##
|
||||||
|
|
||||||
|
- name: General | Software | Services | Disable
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
pattern: "{{ item.pattern }}"
|
||||||
|
state: stopped
|
||||||
|
enabled: false
|
||||||
|
ignore_errors: true
|
||||||
|
loop:
|
||||||
|
- {name: "{{ cups }}" , pattern: "{{ cups_pattern }}"}
|
||||||
|
- {name: "{{ cups_browse }}", pattern: "{{ cups_browse_pattern }}"}
|
||||||
|
when: ansible_service_mgr != "runit"
|
||||||
|
|
||||||
|
- name: General | Software | Services | Disable (runit)
|
||||||
|
ansible.builtin.shell: |
|
||||||
|
if [[ -e {{ runit_service_dir }}/{{ item.name }} ]]; then
|
||||||
|
rm -v {{ runit_service_dir }}/{{ item.name }}
|
||||||
|
fi
|
||||||
|
ignore_errors: true
|
||||||
|
loop:
|
||||||
|
- {name: "{{ cups }}" }
|
||||||
|
- {name: "{{ cups_pattern }}" }
|
||||||
|
- {name: "{{ cups_browse }}" }
|
||||||
|
- {name: "{{ cups_browse_pattern }}"}
|
||||||
|
when: ansible_service_mgr == "runit"
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
block:
|
block:
|
||||||
|
|
||||||
- name: General | Software | Swap | Check For Swapfile
|
- name: General | Software | Swap | Check For Swapfile
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ swap_file }}"
|
path: "{{ swap_file }}"
|
||||||
get_attributes: false
|
get_attributes: false
|
||||||
get_checksum: false
|
get_checksum: false
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
block:
|
block:
|
||||||
|
|
||||||
- name: General | Software | Swap | Create Swapfile
|
- name: General | Software | Swap | Create Swapfile
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- dd if=/dev/zero of={{ swap_file }} bs={{ swap_block }}
|
- dd if=/dev/zero of={{ swap_file }} bs={{ swap_block }}
|
||||||
count={{ swap_count }} status=progress
|
count={{ swap_count }} status=progress
|
||||||
@@ -31,12 +31,12 @@
|
|||||||
|
|
||||||
# NixOS's swap setup is handled in nixos.yml when ansible.nix is created.
|
# NixOS's swap setup is handled in nixos.yml when ansible.nix is created.
|
||||||
- name: General | Software | Swap | Add to FSTAB
|
- name: General | Software | Swap | Add to FSTAB
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/fstab
|
path: /etc/fstab
|
||||||
regexp: '^[\#]?{{ swap_file }}'
|
regexp: '^[\#]?{{ swap_file }}'
|
||||||
line: '{{ swap_file }} none swap sw 0 0'
|
line: '{{ swap_file }} none swap sw 0 0'
|
||||||
state: present
|
state: present
|
||||||
backup: yes
|
backup: true
|
||||||
when: ansible_distribution != "NixOS"
|
when: ansible_distribution != "NixOS"
|
||||||
|
|
||||||
# Only run through this file if the ini has been changed from false.
|
# Only run through this file if the ini has been changed from false.
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
---
|
||||||
|
# 2026-10-17 Hyperling
|
||||||
|
# Allow pushing a local port to a remote server automagically in a runit script.
|
||||||
|
|
||||||
|
# ssh -N -p SSH_PORT -R REMOTE_PORT:localhost:LOCAL_PORT USER@REMOTE_HOST -v
|
||||||
|
|
||||||
|
- name: General | Tunnel | Provisioned Variables
|
||||||
|
ansible.builtin.debug:
|
||||||
|
var: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- tunnel_local_port
|
||||||
|
- tunnel_remote_host
|
||||||
|
- tunnel_remote_port
|
||||||
|
- tunnel_ssh_port
|
||||||
|
|
||||||
|
- name: General | Tunnel | Block
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: General | Tunnel | Facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
tunnel_service_name: tunnel
|
||||||
|
|
||||||
|
- name: General | Tunnel | mkdir | /etc/sv
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /etc/sv/{{ tunnel_service_name }}/log
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: General | Tunnel | mkdir | /var/log
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /var/log/{{ tunnel_service_name }}
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: General | Tunnel | Script | Run
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/sv/{{ tunnel_service_name }}/run
|
||||||
|
content: |
|
||||||
|
#!/bin/sh -e
|
||||||
|
exec 2>&1
|
||||||
|
exec chpst -u {{ user }} ssh -v -N \
|
||||||
|
-R {{ tunnel_remote_port }}:localhost:{{ tunnel_local_port }} \
|
||||||
|
-p {{ tunnel_ssh_port }} {{ tunnel_remote_host }}
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: General | Tunnel | Script | Finish
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/sv/{{ tunnel_service_name }}/finish
|
||||||
|
content: |
|
||||||
|
{{ runit_finish_sleep }}
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: General | Tunnel | Script | Log
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/sv/{{ tunnel_service_name }}/log/run
|
||||||
|
content: |
|
||||||
|
#!/bin/sh -e
|
||||||
|
exec svlogd -tt /var/log/{{ tunnel_service_name }}
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: General | Tunnel | Script | Log Config
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /var/log/{{ tunnel_service_name }}/config
|
||||||
|
content: |
|
||||||
|
{{ runit_log_config_10mb }}
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
when: tunnel_remote_host != "false"
|
||||||
|
|
||||||
|
- name: General | Tunnel | Service | Enable
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: "{{ tunnel_service_name }}"
|
||||||
|
state: "{{ 'started' if tunnel_remote_host else 'stopped' }}"
|
||||||
|
enabled: "{{ true if tunnel_remote_host else false }}"
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
# 20260731 - Hyperling
|
||||||
|
# Install the AUR on pacman-related distros.
|
||||||
|
|
||||||
|
- name: General | Software | AUR | Facts 01
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
aur_user: aurbuilder
|
||||||
|
aur_build_dir: "{{ global_src }}"
|
||||||
|
aur_helper: yay
|
||||||
|
aur_helper_url: https://aur.archlinux.org/yay-bin.git
|
||||||
|
|
||||||
|
- name: General | Software | AUR | Facts 02
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
aur_helper_dir: "{{ aur_build_dir }}/{{ aur_helper }}"
|
||||||
|
aur_sudoers: "/etc/sudoers.d/sudoers_{{ aur_user }}"
|
||||||
|
|
||||||
|
- name: General | Software | AUR | User
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ aur_user }}"
|
||||||
|
groups: wheel
|
||||||
|
create_home: true
|
||||||
|
|
||||||
|
- name: General | Software | AUR | Sudoers
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: "{{ aur_sudoers }}"
|
||||||
|
line: "{{ aur_user }} ALL=(ALL) NOPASSWD: /usr/bin/pacman"
|
||||||
|
create: true
|
||||||
|
mode: '0440'
|
||||||
|
validate: 'visudo -cf %s'
|
||||||
|
|
||||||
|
- name: General | Software | AUR | Check
|
||||||
|
command: "which {{ aur_helper }}"
|
||||||
|
register: yay_check
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
|
- name: General | Software | AUR | Install
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: General | Software | AUR | Install | Clone Repo
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: "{{ aur_helper_url }}"
|
||||||
|
dest: "{{ aur_helper_dir }}"
|
||||||
|
|
||||||
|
- name: General | Software | AUR | Install | Change Permissions
|
||||||
|
ansible.builtin.shell: "chown -Rc {{ aur_user }}:wheel {{ aur_helper_dir }}"
|
||||||
|
|
||||||
|
- name: General | Software | AUR | Install | Build & Integrate
|
||||||
|
ansible.builtin.shell: "cd {{ aur_helper_dir }} && makepkg -si --noconfirm"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ aur_user }}"
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
|
when: yay_check.rc != 0
|
||||||
@@ -2,26 +2,52 @@
|
|||||||
# Install Metasploit Framework
|
# Install Metasploit Framework
|
||||||
|
|
||||||
- name: General | Software | Metasploit | Facts
|
- name: General | Software | Metasploit | Facts
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
metasploit_installer: msfinstall
|
metasploit_installer: msfinstall
|
||||||
when: ansible_system in ("Linux", "Darwin")
|
when: ansible_system in ("Linux", "Darwin")
|
||||||
|
and pentesting
|
||||||
|
|
||||||
|
- name: General | Software | Metasploit | Check Install Status
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: /usr/bin/msfconsole
|
||||||
|
register: metasploit_status
|
||||||
|
|
||||||
- name: General | Software | Metasploit | Refresh Apt Files
|
- name: General | Software | Metasploit | Refresh Apt Files
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "mkdir -p /tmp/apt/"
|
- "mkdir -p /tmp/apt/"
|
||||||
- "mv -fv /usr/share/keyrings/metasploit-framework.gpg /tmp/apt/metasploit-framework.gpg.old"
|
- "mv -fv /usr/share/keyrings/metasploit-framework.gpg /tmp/apt/metasploit-framework.gpg.old"
|
||||||
- "mv -fv /etc/apt/sources.list.d/metasploit-framework.list /tmp/apt/metasploit-framework.list.old"
|
- "mv -fv /etc/apt/sources.list.d/metasploit-framework.list /tmp/apt/metasploit-framework.list.old"
|
||||||
- "mv -fv /etc/apt/preferences.d/pin-metasploit.pref /tmp/apt/pin-metasploit.pref.old"
|
- "mv -fv /etc/apt/preferences.d/pin-metasploit.pref /tmp/apt/pin-metasploit.pref.old"
|
||||||
when: ansible_system in ("Linux")
|
when: ansible_system in ("Linux") and ansible_pkg_mgr == "apt"
|
||||||
|
and not metasploit_status.stat.exists
|
||||||
|
and pentesting
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Software | Metasploit | Install
|
- name: General | Software | Metasploit | Install
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > {{ metasploit_installer }}"
|
- "curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb > {{ metasploit_installer }}"
|
||||||
- "chmod 755 {{ metasploit_installer }}"
|
- "chmod 755 {{ metasploit_installer }}"
|
||||||
- "mkdir -p {{ global_bin }}"
|
- "mkdir -p {{ global_bin }}"
|
||||||
- "mv -fv ./msfinstall {{ global_bin }}/{{ metasploit_installer }}"
|
- "mv -fv ./{{ metasploit_installer }} {{ global_bin }}/{{ metasploit_installer }}"
|
||||||
- yes y | "{{ global_bin }}/{{ metasploit_installer }}"
|
- yes y | "{{ global_bin }}/{{ metasploit_installer }}"
|
||||||
when: ansible_system in ("Linux", "Darwin")
|
when: ansible_system in ("Linux", "Darwin")
|
||||||
|
and not metasploit_status.stat.exists
|
||||||
|
and pentesting
|
||||||
|
|
||||||
|
- name: General | Software | Metasploit | Remove (Darwin)
|
||||||
|
ansible.builtin.shell: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- "/opt/metasploit-framework/bin/msfremove"
|
||||||
|
when: ansible_system in ("Darwin")
|
||||||
|
and not metasploit_status.stat.exists
|
||||||
|
and pentesting == false
|
||||||
|
|
||||||
|
- name: General | Software | Metasploit | Remove
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: "metasploit-framework"
|
||||||
|
state: absent
|
||||||
|
when: ansible_system in ("Linux")
|
||||||
|
and metasploit_status.stat.exists
|
||||||
|
and pentesting == false
|
||||||
@@ -13,20 +13,21 @@
|
|||||||
###
|
###
|
||||||
|
|
||||||
- name: Nix Variables
|
- name: Nix Variables
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nix_exe: ~/.deleteme.nix.sh
|
nix_exe: ~/.deleteme.nix.sh
|
||||||
|
|
||||||
- name: Install Nix
|
- name: Install Nix
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "curl -L https://nixos.org/nix/install > {{ nix_exe }}"
|
- "curl -L https://nixos.org/nix/install > {{ nix_exe }}"
|
||||||
- "chmod 755 {{ nix_exe }}"
|
- "chmod 755 {{ nix_exe }}"
|
||||||
- "{{ nix_exe }} --daemon --yes"
|
- "{{ nix_exe }} --daemon --yes"
|
||||||
- "rm -v {{ nix_exe }}"
|
- "rm -v {{ nix_exe }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
|
|
||||||
- name: Install Nix Software
|
- name: Install Nix Software
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "nix-env -iA nixpkgs.lbry" # Installs, but doesnt launch?
|
- "nix-env -iA nixpkgs.lbry" # Installs, but doesnt launch?
|
||||||
#$ lbry
|
#$ lbry
|
||||||
|
|||||||
@@ -3,20 +3,20 @@
|
|||||||
# This is also done in setup.sh if ansible is not found.
|
# This is also done in setup.sh if ansible is not found.
|
||||||
|
|
||||||
- name: General | Software | NixOS | Facts
|
- name: General | Software | NixOS | Facts
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nixos_working_dir: ~/nixos-config-deleteme
|
nixos_working_dir: ~/nixos-config-deleteme
|
||||||
nixos_working_exe: activate.sh
|
nixos_working_exe: activate.sh
|
||||||
|
|
||||||
- name: General | Software | NixOS | Facts [Swap]
|
- name: General | Software | NixOS | Facts [Swap]
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nixos_swap: "swapDevices = [ { device = \"{{ swap_file }}\";} ];"
|
nixos_swap: "swapDevices = [ { device = \"{{ swap_file }}\";} ];"
|
||||||
when: swap_block != false
|
when: swap_block != false
|
||||||
|
|
||||||
- name: General | Software | NixOS | Update Config Project
|
- name: General | Software | NixOS | Update Config Project
|
||||||
shell: "files/scripts/nixos.sh -b {{ branch }}"
|
ansible.builtin.shell: "files/scripts/nixos.sh -b {{ branch }}"
|
||||||
|
|
||||||
- name: General | Software | NixOS | Create Ansible Nix Config
|
- name: General | Software | NixOS | Create Ansible Nix Config
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/nixos/ansible.nix
|
path: /etc/nixos/ansible.nix
|
||||||
block: |
|
block: |
|
||||||
# This file was created by https://git.hyperling.com/me/env-ansible
|
# This file was created by https://git.hyperling.com/me/env-ansible
|
||||||
@@ -29,14 +29,14 @@
|
|||||||
{{ nixos_swap }}
|
{{ nixos_swap }}
|
||||||
}
|
}
|
||||||
state: present
|
state: present
|
||||||
backup: yes
|
backup: true
|
||||||
create: yes
|
create: true
|
||||||
|
|
||||||
|
|
||||||
# Maybe do home manager here? Or should it be under Workstation? Or maybe
|
# Maybe do home manager here? Or should it be under Workstation? Or maybe
|
||||||
# this is the spot where I start creating workstation.nix, server.nix, etc.
|
# this is the spot where I start creating workstation.nix, server.nix, etc.
|
||||||
#- name: General | Software | NixOS | Home Manager? *.nix file management?
|
#- name: General | Software | NixOS | Home Manager? *.nix file management?
|
||||||
# shell:
|
# ansible.builtin.shell:
|
||||||
# loop:
|
# loop:
|
||||||
# - ???
|
# - ???
|
||||||
# - ???
|
# - ???
|
||||||
@@ -5,108 +5,117 @@
|
|||||||
# They have zypper higher in the path, but it's really apt renamed.
|
# They have zypper higher in the path, but it's really apt renamed.
|
||||||
# Probably for "security", but package module does not use the ansible_pkg_mgr variable
|
# Probably for "security", but package module does not use the ansible_pkg_mgr variable
|
||||||
# so resetting the value to apt doesn't work. Just going to move it.
|
# so resetting the value to apt doesn't work. Just going to move it.
|
||||||
shell: "mv `which zypper` `which zypper`.zz.`date +%Y%m%d`"
|
ansible.builtin.shell: "mv `which zypper` `which zypper`.zz.`date +%Y%m%d`"
|
||||||
register: parrotos_zypper_removed
|
register: parrotos_zypper_removed
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
when: ansible_distribution == "Parrot OS"
|
when: ansible_distribution == "Parrot OS"
|
||||||
|
|
||||||
- name: General | Software | Packages | Fix Parrot OS (zypper), Exit Incoming
|
- name: General | Software | Packages | Fix Parrot OS (zypper), Exit Incoming
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "A silly zypper file was renamed successfully. Please try running Ansible again."
|
msg: "A silly zypper file was renamed successfully. Please try running Ansible again."
|
||||||
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
||||||
|
|
||||||
- name: General | Software | Packages | Fix Parrot OS (zypper), Exiting
|
- name: General | Software | Packages | Fix Parrot OS (zypper), Exiting
|
||||||
shell: exit 1
|
ansible.builtin.shell: exit 1
|
||||||
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
when: ansible_distribution == "Parrot OS" and parrotos_zypper_removed is defined and not parrotos_zypper_removed.failed
|
||||||
|
|
||||||
# More Parrot OS junk. They have a command called update in /usr/bin. Doesn't
|
# More Parrot OS junk. They have a command called update in /usr/bin. Doesn't
|
||||||
# have sudo or anything in it. Hide it in preference for .bashrc update function.
|
# have sudo or anything in it. Hide it in preference for .bashrc update function.
|
||||||
- name: General | Software | Packages | Fix Parrot OS 2 (update)
|
- name: General | Software | Packages | Fix Parrot OS 2 (update)
|
||||||
shell: "mv `which update` `which update`.zz.`date +%Y%m%d`"
|
ansible.builtin.shell: "mv `which update` `which update`.zz.`date +%Y%m%d`"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
when: ansible_distribution == "Parrot OS"
|
when: ansible_distribution == "Parrot OS"
|
||||||
|
|
||||||
|
|
||||||
- name: General | Software | Packages | Cache Refresh (Apt and Pacman)
|
- name: General | Software | Packages | Cache Refresh (Apt and Pacman)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
name: htop
|
name: htop
|
||||||
when: ansible_pkg_mgr in ["apt", "pacman"]
|
when: ansible_pkg_mgr in ["apt", "pacman"]
|
||||||
|
|
||||||
- name: General | Software | Packages | Cache Refresh (FreeBSD)
|
- name: General | Software | Packages | Cache Refresh (FreeBSD)
|
||||||
shell: pkg update
|
ansible.builtin.shell: pkg update
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- name: General | Software | Packages | Install Software
|
- name: General | Software | Packages | Install Software
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- bash
|
- bash
|
||||||
- sudo
|
- sudo
|
||||||
- nmap
|
- nmap
|
||||||
- "{{ neofetch }}"
|
- "{{ neofetch }}"
|
||||||
- "{{ sshfs }}"
|
- "{{ sshfs }}"
|
||||||
- "{{ locate }}"
|
- "{{ locate }}"
|
||||||
- zsh
|
- zsh
|
||||||
- "{{ opensshd }}"
|
- "{{ opensshd }}"
|
||||||
- "{{ tar }}"
|
- "{{ tar }}"
|
||||||
- curl
|
- curl
|
||||||
- at
|
- at
|
||||||
- gcc
|
- gcc
|
||||||
- vim
|
- vim
|
||||||
- "{{ cron }}"
|
- "{{ cron }}"
|
||||||
- "{{ encfs }}"
|
- "{{ encfs }}"
|
||||||
- rsync
|
- rsync
|
||||||
- "{{ iftop }}"
|
- "{{ iftop }}"
|
||||||
- "{{ nethogs }}"
|
- "{{ nethogs }}"
|
||||||
- "{{ ntp_server }}"
|
- "{{ ntp_server }}"
|
||||||
- "{{ dig }}"
|
- "{{ dig }}"
|
||||||
|
- "{{ tmux }}"
|
||||||
|
- "{{ base_devel }}"
|
||||||
|
- "{{ sendmail }}"
|
||||||
|
- "{{ sendmail_mta }}"
|
||||||
|
- "{{ ca_certificates }}"
|
||||||
|
- "{{ alsa }}"
|
||||||
|
- "{{ stress }}"
|
||||||
|
- "{{ jq }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: General | Software | Packages | Install Software (DEV)
|
- name: General | Software | Packages | Install Software (DEV)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- "{{ microcode_amd }}"
|
- "{{ microcode_amd }}"
|
||||||
- "{{ microcode_intel }}"
|
- "{{ microcode_intel }}"
|
||||||
state: present
|
state: present
|
||||||
when: branch == "dev"
|
when: branch == "dev"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Software | Packages | Add Generic Kernel + Tools (Ubuntu)
|
- name: General | Software | Packages | Add Generic Kernel + Tools (Ubuntu)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- linux-image-generic
|
- linux-image-generic
|
||||||
- linux-headers-generic
|
- linux-headers-generic
|
||||||
- linux-tools-generic
|
- linux-tools-generic
|
||||||
- linux-tools-common
|
- linux-tools-common
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_distribution == "Ubuntu"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Software | Packages | Add Generic Kernel + Headers (Debian)
|
- name: General | Software | Packages | Add Generic Kernel + Headers (Debian)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- linux-image-amd64
|
- linux-image-amd64
|
||||||
- linux-headers-amd64
|
- linux-headers-amd64
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == "Debian"
|
when: ansible_distribution == "Debian"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Software | Services | Install killall (Looking at you, Debian)
|
- name: General | Software | Packages | Install killall (Looking at you, Debian)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: psmisc
|
name: psmisc
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == "Debian"
|
when: ansible_distribution == "Debian"
|
||||||
|
|
||||||
- name: General | Software | Services | Install "Bloat" (Looking at you, Arch Base)
|
- name: General | Software | Packages | Install "Bloat" (Looking at you, Arch Base)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- which
|
- which
|
||||||
- "{{ cron }}"
|
- "{{ cron }}"
|
||||||
|
- pacman-contrib
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == "Archlinux"
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
- name: General | Software | Services | Install Fix (Looking at you, openSUSE)
|
- name: General | Software | Packages | Install Fix (Looking at you, openSUSE)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
# openSUSE Tumbleweed comes without gnome-control-center being able to open
|
# openSUSE Tumbleweed comes without gnome-control-center being able to open
|
||||||
# properly. Hopefully just a one-time accident but I wanted bleeding edge so I
|
# properly. Hopefully just a one-time accident but I wanted bleeding edge so I
|
||||||
@@ -118,43 +127,43 @@
|
|||||||
when: ansible_pkg_mgr in ("zypper")
|
when: ansible_pkg_mgr in ("zypper")
|
||||||
|
|
||||||
- name: General | Software | Packages | Update Software (Disabled)
|
- name: General | Software | Packages | Update Software (Disabled)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- ansible
|
- ansible
|
||||||
- git
|
- git
|
||||||
state: latest
|
state: latest
|
||||||
when: 1 == 0
|
when: 1 == 0
|
||||||
|
|
||||||
- name: General | Software | Packages | Remove Software
|
- name: General | Software | Packages | Remove Software
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- cowsay # Sorry ;)
|
- cowsay # Sorry ;)
|
||||||
- chromium
|
- chromium
|
||||||
- chromium-browser
|
- chromium-browser
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Ubuntu still uses snap for critical components like GNOME, must keep.
|
# Ubuntu still uses snap for critical components like GNOME, must keep.
|
||||||
- name: General | Software | Services | Disable Snap Daemon
|
- name: General | Software | Packages | Disable Snap Daemon
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: snapd
|
name: snapd
|
||||||
pattern: snapd
|
pattern: snapd
|
||||||
state: stopped
|
state: stopped
|
||||||
enabled: no
|
enabled: false
|
||||||
when: ansible_distribution != "Ubuntu"
|
when: ansible_distribution != "Ubuntu"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Software | Packages | Remove Snap (Besides Ubuntu)
|
- name: General | Software | Packages | Remove Snap (Besides Ubuntu)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- snapd
|
- snapd
|
||||||
state: absent
|
state: absent
|
||||||
when: ansible_distribution != "Ubuntu"
|
when: ansible_distribution != "Ubuntu"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Software | Packages | Other Debian Packages
|
- name: General | Software | Packages | Other Debian Packages
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- usbutils
|
- usbutils
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution in ("Debian")
|
when: ansible_distribution in ("Debian")
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
# 20261006 Hyperling
|
||||||
|
|
||||||
|
# Allow ansible.builtin.service to be used on Artix similar to Devuan.
|
||||||
|
- name: General | Software | runit | Fix Artix
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: General | Software | runit | Fix Artix | Script Dir
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: /etc/runit/sv
|
||||||
|
dest: /etc/sv
|
||||||
|
state: link
|
||||||
|
force: true
|
||||||
|
|
||||||
|
- name: General | Software | runit | Fix Artix | Service Dir
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: /etc/runit/runsvdir/default
|
||||||
|
dest: /var/service
|
||||||
|
state: link
|
||||||
|
force: true
|
||||||
|
|
||||||
|
when: ansible_service_mgr == "runit"
|
||||||
|
and ansible_pkg_mgr == "pacman"
|
||||||
@@ -3,46 +3,46 @@
|
|||||||
# Preferably only on servers that don't already have postfix?
|
# Preferably only on servers that don't already have postfix?
|
||||||
|
|
||||||
- name: Server | Sendmail | Variables
|
- name: Server | Sendmail | Variables
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
sendmail: sendmail
|
sendmail: sendmail
|
||||||
sendmail_queue: sendmail_msp_queue
|
sendmail_queue: sendmail_msp_queue
|
||||||
|
|
||||||
- name: Server | Sendmail | Check
|
- name: Server | Sendmail | Check
|
||||||
shell: which postfix
|
ansible.builtin.shell: which postfix
|
||||||
register: postfix
|
register: postfix
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Server | Sendmail | Install
|
- name: Server | Sendmail | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- "{{ sendmail }}"
|
- "{{ sendmail }}"
|
||||||
state: present
|
state: present
|
||||||
when: postfix.failed
|
when: postfix.failed
|
||||||
|
|
||||||
- name: Server | Sendmail | Configure
|
- name: Server | Sendmail | Configure
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/rc.conf
|
path: /etc/rc.conf
|
||||||
block: |
|
block: |
|
||||||
sendmail_enable="YES"
|
sendmail_enable="YES"
|
||||||
sendmail_msp_queue_enable="YES"
|
sendmail_msp_queue_enable="YES"
|
||||||
marker: "# {mark} MANAGED BY ANSIBLE - sendmail"
|
marker: "# {mark} MANAGED BY ANSIBLE - sendmail"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
when: postfix.failed and ansible_system == "FreeBSD"
|
when: postfix.failed and ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- name: Server | Sendmail | Enable + Start | Main
|
- name: Server | Sendmail | Enable + Start | Main
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: "{{ sendmail }}"
|
name: "{{ sendmail }}"
|
||||||
pattern: "{{ sendmail }}"
|
pattern: "{{ sendmail }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: true
|
||||||
when: postfix.failed
|
when: postfix.failed
|
||||||
|
|
||||||
- name: Server | Sendmail | Enable + Start | Queue
|
- name: Server | Sendmail | Enable + Start | Queue
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: "{{ sendmail_queue }}"
|
name: "{{ sendmail_queue }}"
|
||||||
pattern: "{{ sendmail_queue }}"
|
pattern: "{{ sendmail_queue }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: true
|
||||||
when: postfix.failed and ansible_system == "FreeBSD"
|
when: postfix.failed and ansible_system == "FreeBSD"
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
# Variables #
|
# Variables #
|
||||||
|
|
||||||
- name: General | Telegraf | Variables 1/4
|
- name: General | Telegraf | Variables 1/4
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
telegraf_tar: telegraf-1.20.3_linux_amd64.tar.gz
|
telegraf_tar: telegraf-1.20.3_linux_amd64.tar.gz
|
||||||
telegraf_path: /usr/local/bin
|
telegraf_path: /usr/local/bin
|
||||||
telegraf_config_path: /usr/local/etc
|
telegraf_config_path: /usr/local/etc
|
||||||
@@ -13,25 +13,25 @@
|
|||||||
telegraf_log: "{{ user_ansible.home }}/telegraf.log"
|
telegraf_log: "{{ user_ansible.home }}/telegraf.log"
|
||||||
|
|
||||||
- name: General | Telegraf | Variables 2/4
|
- name: General | Telegraf | Variables 2/4
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
telegraf_exec: "{{ telegraf_path }}/telegraf"
|
telegraf_exec: "{{ telegraf_path }}/telegraf"
|
||||||
telegraf_config: "{{ telegraf_config_path }}/telegraf.conf"
|
telegraf_config: "{{ telegraf_config_path }}/telegraf.conf"
|
||||||
|
|
||||||
- name: General | Telegraf | Variables 3/4
|
- name: General | Telegraf | Variables 3/4
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
telegraf_cmd: "{{ telegraf_exec }} --config {{ telegraf_config }} >> {{ telegraf_log }} 2>&1"
|
telegraf_cmd: "{{ telegraf_exec }} --config {{ telegraf_config }} >> {{ telegraf_log }} 2>&1"
|
||||||
|
|
||||||
- name: General | Telegraf | Variables 4/4
|
- name: General | Telegraf | Variables 4/4
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
telegraf_watcher: "killall telegraf; {{ telegraf_cmd }}"
|
telegraf_watcher: "killall telegraf; {{ telegraf_cmd }}"
|
||||||
|
|
||||||
- name: General | Telegraf | Variables | Linux
|
- name: General | Telegraf | Variables | Linux
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
telegraf_input_temp: "[[inputs.temp]]"
|
telegraf_input_temp: "[[inputs.temp]]"
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
|
|
||||||
- name: General | Telegraf | Variables | FreeBSD
|
- name: General | Telegraf | Variables | FreeBSD
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
telegraf_input_temp: ""
|
telegraf_input_temp: ""
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
@@ -40,14 +40,14 @@
|
|||||||
#### Dependencies #
|
#### Dependencies #
|
||||||
###
|
###
|
||||||
###- name: General | Telegraf | Pre-Reqs
|
###- name: General | Telegraf | Pre-Reqs
|
||||||
### package:
|
### ansible.builtin.package:
|
||||||
### name: wget
|
### name: wget
|
||||||
### when: ansible_system == "Linux"
|
### when: ansible_system == "Linux"
|
||||||
###
|
###
|
||||||
#### Install #
|
#### Install #
|
||||||
###
|
###
|
||||||
###- name: General | Telegraf | Linux | Install
|
###- name: General | Telegraf | Linux | Install
|
||||||
### shell: "{{ item }}"
|
### ansible.builtin.shell: "{{ item }}"
|
||||||
### args:
|
### args:
|
||||||
### chdir: "{{ ansible_env.HOME }}/Downloads/"
|
### chdir: "{{ ansible_env.HOME }}/Downloads/"
|
||||||
### loop:
|
### loop:
|
||||||
@@ -61,22 +61,22 @@
|
|||||||
### when: ansible_system == "Linux"
|
### when: ansible_system == "Linux"
|
||||||
###
|
###
|
||||||
###- name: General | Telegraf | FreeBSD | Install 1/2
|
###- name: General | Telegraf | FreeBSD | Install 1/2
|
||||||
### shell: /usr/sbin/pwd_mkdb -p /etc/master.passwd
|
### ansible.builtin.shell: /usr/sbin/pwd_mkdb -p /etc/master.passwd
|
||||||
### when: ansible_system == "FreeBSD"
|
### when: ansible_system == "FreeBSD"
|
||||||
###
|
###
|
||||||
###- name: General | Telegraf | FreeBSD | Install 2/2
|
###- name: General | Telegraf | FreeBSD | Install 2/2
|
||||||
### package:
|
### ansible.builtin.package:
|
||||||
### name: telegraf
|
### name: telegraf
|
||||||
### when: ansible_system == "FreeBSD"
|
### when: ansible_system == "FreeBSD"
|
||||||
###
|
###
|
||||||
#### Configuration #
|
#### Configuration #
|
||||||
###
|
###
|
||||||
###- name: General | Telegraf | Config 1/2
|
###- name: General | Telegraf | Config 1/2
|
||||||
### shell: mv {{ telegraf_config }} ~/TRASH/
|
### ansible.builtin.shell: mv {{ telegraf_config }} ~/TRASH/
|
||||||
### ignore_errors: yes
|
### ignore_errors: true
|
||||||
###
|
###
|
||||||
###- name: General | Telegraf | Config 2/2
|
###- name: General | Telegraf | Config 2/2
|
||||||
### blockinfile:
|
### ansible.builtin.blockinfile:
|
||||||
### path: "{{ telegraf_config }}"
|
### path: "{{ telegraf_config }}"
|
||||||
### block: |
|
### block: |
|
||||||
### [global_tags]
|
### [global_tags]
|
||||||
@@ -158,19 +158,19 @@
|
|||||||
###
|
###
|
||||||
### marker: '# {mark} MANAGED BY ANSIBLE - telegraf.yml'
|
### marker: '# {mark} MANAGED BY ANSIBLE - telegraf.yml'
|
||||||
### state: present
|
### state: present
|
||||||
### create: yes
|
### create: true
|
||||||
|
|
||||||
# Run #
|
# Run #
|
||||||
|
|
||||||
- name: General | Telegraf | Schedule
|
- name: General | Telegraf | Schedule
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: "{{ telegraf_user }}"
|
user: "{{ telegraf_user }}"
|
||||||
name: "{{ item.name }}"
|
name: "{{ item.name }}"
|
||||||
job: "{{ item.command }}"
|
job: "{{ item.command }}"
|
||||||
special_time: "{{ item.freq }}"
|
special_time: "{{ item.freq }}"
|
||||||
state: present
|
state: present
|
||||||
#disabled: "{{ 'yes' if no_telem else 'no' }}"
|
#disabled: "{{ 'yes' if no_telem else 'no' }}"
|
||||||
disabled: yes # 2024-01-25, Downsizing again and will not have Graphana.
|
disabled: true # 2024-01-25, Downsizing again and will not have Graphana.
|
||||||
loop:
|
loop:
|
||||||
- { "name": "Telegraf Reboot Job" , "freq": "reboot", "command": "{{ telegraf_cmd }}"}
|
- { "name": "Telegraf Reboot Job" , "freq": "reboot", "command": "{{ telegraf_cmd }}"}
|
||||||
- { "name": "Telegraf Keep-Alive Job", "freq": "hourly", "command": "{{ telegraf_watcher }}"}
|
- { "name": "Telegraf Keep-Alive Job", "freq": "hourly", "command": "{{ telegraf_watcher }}"}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
# 20261002 - Hyperling
|
||||||
|
# Check whether we're connected to the internet and skip certain playbooks if not.
|
||||||
|
|
||||||
|
- name: General | Tests | Internet | Facts 01
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
internet: true
|
||||||
|
internet_time: 10
|
||||||
|
|
||||||
|
- name: General | Tests | Internet | Check
|
||||||
|
ansible.builtin.wait_for:
|
||||||
|
host: archlinux.org
|
||||||
|
port: 443
|
||||||
|
state: started
|
||||||
|
timeout: "{{ internet_time }}"
|
||||||
|
register: internet_check
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: General | Tests | Internet | Facts 02
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
internet: "{{ internet_check is success }}"
|
||||||
|
|
||||||
|
- name: General | Tests | Internet | Message
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "WARNING: Not connected to the Internet, only running for offline playbooks."
|
||||||
|
when: not internet
|
||||||
|
|
||||||
|
- name: General | Tests | Internet | Sleep
|
||||||
|
ansible.builtin.command: "sleep {{ internet_time }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: not internet
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
# 20260929 - Hyperling
|
||||||
|
# Ensure an existing run is not active, otherwise bail.
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
lock_file: "/tmp/ansible-playbook.lock"
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Check
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ lock_file }}"
|
||||||
|
register: lock_exists
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Exit
|
||||||
|
ansible.builtin.meta: end_play
|
||||||
|
when: lock_exists.stat.exists
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
# 20260929 - Hyperling
|
||||||
|
# Ensure an existing run is not active, otherwise bail.
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Lock | Create
|
||||||
|
ansible.builtin.shell: "date +'%Y-%m-%d %H:%M:%S' >> {{lock_file }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Lock | Create
|
||||||
|
ansible.builtin.file:
|
||||||
|
name: "{{ lock_file }}"
|
||||||
|
mode: '0777'
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Lock | Create | Check
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ lock_file }}"
|
||||||
|
register: lock_exists
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Lock | Create | Fail
|
||||||
|
fail:
|
||||||
|
msg: "ERROR: Lock file does not exist."
|
||||||
|
when: not lock_exists.stat.exists
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
# 20260929 - Hyperling
|
||||||
|
# Ensure an existing run is not active, otherwise bail.
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Lock | Remove
|
||||||
|
ansible.builtin.file:
|
||||||
|
name: "{{ lock_file }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Lock | Remove | Check
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ lock_file }}"
|
||||||
|
register: lock_exists
|
||||||
|
|
||||||
|
- name: General | Tests | Existing Run | Lock | Remove | Fail
|
||||||
|
fail:
|
||||||
|
msg: "ERROR: Lock file still exists!"
|
||||||
|
when: lock_exists.stat.exists
|
||||||
@@ -2,45 +2,45 @@
|
|||||||
# Lynis hardness check.
|
# Lynis hardness check.
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Set Facts
|
- name: General | Tests | Lynis | Set Facts
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
lynis_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.{{ lynis_report }}"
|
lynis_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.{{ lynis_report }}"
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Set Facts 2
|
- name: General | Tests | Lynis | Set Facts 2
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
lynis_temp_file: "{{ lynis_file }}.tmp"
|
lynis_temp_file: "{{ lynis_file }}.tmp"
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Install
|
- name: General | Tests | Lynis | Install
|
||||||
git:
|
ansible.builtin.git:
|
||||||
repo: https://github.com/CISOfy/lynis
|
repo: https://github.com/CISOfy/lynis
|
||||||
dest: "{{ lynis_install_dir }}"
|
dest: "{{ lynis_install_dir }}"
|
||||||
clone: true
|
clone: true
|
||||||
force: true
|
force: true
|
||||||
update: true
|
update: true
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Ensure Permissions (Looking at you Parrot OS!)
|
- name: General | Tests | Lynis | Ensure Permissions (Looking at you Parrot OS!)
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ lynis_install_dir }}"
|
path: "{{ lynis_install_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ root_group }}"
|
group: "{{ root_group }}"
|
||||||
recurse: yes
|
recurse: true
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Ensure Permissions 2
|
- name: General | Tests | Lynis | Ensure Permissions 2
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ lynis_install_dir }}/lynis"
|
path: "{{ lynis_install_dir }}/lynis"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Ensure Folder Permissions
|
- name: General | Tests | Lynis | Ensure Folder Permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ lynis_install_dir }}"
|
path: "{{ lynis_install_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
recurse: no
|
recurse: false
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Run System Audit
|
- name: General | Tests | Lynis | Run System Audit
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "./lynis audit system --no-colors > {{ lynis_temp_file }} 2>&1"
|
- "./lynis audit system --no-colors > {{ lynis_temp_file }} 2>&1"
|
||||||
- "mv {{ lynis_temp_file }} {{ lynis_file }}"
|
- "mv {{ lynis_temp_file }} {{ lynis_file }}"
|
||||||
@@ -49,6 +49,6 @@
|
|||||||
chdir: "{{ lynis_install_dir }}"
|
chdir: "{{ lynis_install_dir }}"
|
||||||
|
|
||||||
- name: General | Tests | Lynis | Make Report Readable
|
- name: General | Tests | Lynis | Make Report Readable
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ lynis_file }}"
|
path: "{{ lynis_file }}"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
@@ -2,16 +2,16 @@
|
|||||||
# Nmap port test
|
# Nmap port test
|
||||||
|
|
||||||
- name: General | Tests | nmap | Set Facts
|
- name: General | Tests | nmap | Set Facts
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nmap_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.{{ nmap_report }}"
|
nmap_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.{{ nmap_report }}"
|
||||||
nmap_separator: "\n*******************************\n"
|
nmap_separator: "\n*******************************\n"
|
||||||
|
|
||||||
- name: General | Tests | nmap | Set Facts 2
|
- name: General | Tests | nmap | Set Facts 2
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
nmap_temp_file: "{{ nmap_file }}.tmp"
|
nmap_temp_file: "{{ nmap_file }}.tmp"
|
||||||
|
|
||||||
- name: General | Tests | nmap | Create Report
|
- name: General | Tests | nmap | Create Report
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "date > {{ nmap_temp_file }}"
|
- "date > {{ nmap_temp_file }}"
|
||||||
- "printf '{{ nmap_separator }}' >> {{ nmap_temp_file }}"
|
- "printf '{{ nmap_separator }}' >> {{ nmap_temp_file }}"
|
||||||
@@ -25,6 +25,6 @@
|
|||||||
- "mv {{ nmap_temp_file }} {{ nmap_file }}"
|
- "mv {{ nmap_temp_file }} {{ nmap_file }}"
|
||||||
|
|
||||||
- name: General | Tests | nmap | Make Viewable
|
- name: General | Tests | nmap | Make Viewable
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ nmap_file }}"
|
path: "{{ nmap_file }}"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
@@ -2,26 +2,37 @@
|
|||||||
# List all the services under the Reports folder.
|
# List all the services under the Reports folder.
|
||||||
|
|
||||||
- name: General | Tests | Services | Set Facts
|
- name: General | Tests | Services | Set Facts
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
services_report_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.services.txt"
|
services_report_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.services.txt"
|
||||||
services_enabled_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.services-enabled.txt"
|
services_enabled_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.services-enabled.txt"
|
||||||
|
services_command: "echo 'Service Manager {{ ansible_service_mgr }} Not Recognized'"
|
||||||
|
|
||||||
|
- name: General | Tests | Services | Set Facts | SystemD
|
||||||
|
ansible.builtin.set_fact:
|
||||||
services_command: "systemctl list-unit-files"
|
services_command: "systemctl list-unit-files"
|
||||||
|
when: ansible_service_mgr == "systemd"
|
||||||
|
|
||||||
|
- name: General | Tests | Services | Set Facts | runit
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
services_command: 'for s in {{ runit_service_dir }}/*; do sv status "$s"; done'
|
||||||
|
when: ansible_service_mgr == "runit"
|
||||||
|
|
||||||
- name: General | Tests | Services | Create Main Report
|
- name: General | Tests | Services | Create Main Report
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "date > {{ services_report_file }}"
|
- "date > {{ services_report_file }}"
|
||||||
- "echo '\n-= {{ services_command }} =-\n' >> {{ services_report_file }}"
|
- "echo '\n-= {{ services_command }} =-\n' >> {{ services_report_file }}"
|
||||||
- "{{ services_command }} >> {{ services_report_file }}"
|
- "{{ services_command }} >> {{ services_report_file }}"
|
||||||
|
|
||||||
- name: General | Tests | Services | Create Enabled Report
|
- name: General | Tests | Services | Create Enabled Report
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "date > {{ services_enabled_file }}"
|
- "date > {{ services_enabled_file }}"
|
||||||
- "echo '\n-= Enabled + Sorted =-\n' >> {{ services_enabled_file }}"
|
- "echo '\n-= Enabled + Sorted =-\n' >> {{ services_enabled_file }}"
|
||||||
- "grep 'enabled' {{ services_report_file }} | sort >> {{ services_enabled_file }}"
|
- "grep 'enabled' {{ services_report_file }} | sort >> {{ services_enabled_file }}"
|
||||||
|
when: ansible_service_mgr == "systemd"
|
||||||
|
|
||||||
- name: General | Tests | Services | Make Viewable
|
- name: General | Tests | Services | Make Viewable
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ services_report_file }}"
|
path: "{{ services_report_file }}"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
@@ -0,0 +1,179 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
####### Lock #######
|
||||||
|
|
||||||
|
# Ensure a process is not already running.
|
||||||
|
- name: Main | Lock
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Main | Lock | Check
|
||||||
|
ansible.builtin.include_tasks: tasks/general/tests/lock_check.yml
|
||||||
|
|
||||||
|
- name: Main | Lock | Create
|
||||||
|
ansible.builtin.include_tasks: tasks/general/tests/lock_create.yml
|
||||||
|
|
||||||
|
####### Gather #######
|
||||||
|
|
||||||
|
# Load facts for all systems.
|
||||||
|
- name: Main | Gather
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Main | Gather | Facts
|
||||||
|
ansible.builtin.include_tasks: facts/general/gather.yml
|
||||||
|
|
||||||
|
- name: Main | Gather | Account Management
|
||||||
|
ansible.builtin.include_tasks: tasks/general/acct_mgmt/provision_config.yml
|
||||||
|
|
||||||
|
- name: Main | Gather | System
|
||||||
|
ansible.builtin.include_tasks: facts/general/system.yml
|
||||||
|
|
||||||
|
- name: Main | Gather | Package
|
||||||
|
ansible.builtin.include_tasks: facts/general/package.yml
|
||||||
|
|
||||||
|
- name: Main | Gather | Service
|
||||||
|
ansible.builtin.include_tasks: facts/general/service.yml
|
||||||
|
|
||||||
|
- name: Main | Gather | User
|
||||||
|
ansible.builtin.include_tasks: facts/general/user.yml
|
||||||
|
|
||||||
|
- name: Main | Gather | Internet Check
|
||||||
|
ansible.builtin.include_tasks: tasks/general/tests/internet_check.yml
|
||||||
|
|
||||||
|
####### Start #######
|
||||||
|
|
||||||
|
- name: Main | Start
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Main | Start | Notify
|
||||||
|
ansible.builtin.include_tasks: tasks/general/acct_mgmt/notify.yml
|
||||||
|
vars:
|
||||||
|
notify_message: "Provisioning Started"
|
||||||
|
|
||||||
|
when: workstation
|
||||||
|
|
||||||
|
####### NixOS #######
|
||||||
|
|
||||||
|
# Install the .nix files and do a little data setup.
|
||||||
|
- name: Main | NixOS
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Main | NixOS | Config
|
||||||
|
ansible.builtin.include_tasks: tasks/general/software/nixos.yml
|
||||||
|
|
||||||
|
# TBD if we are going to use this many, then just have IF statements
|
||||||
|
# and use blocks within the General area for NixOS vs not-NixOS.
|
||||||
|
- name: Main | NixOS | Swap
|
||||||
|
ansible.builtin.include_tasks: tasks/general/software/swap.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/groups.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/users.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/sudo.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/acct_mgmt/doas.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/scripts/root.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/scripts/user.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/scripts/install.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/cron/ansible.yml
|
||||||
|
|
||||||
|
# psutil does not work in NixOS. Cannot figure out how to fix it. Maybe
|
||||||
|
# time to start looking into home-manager but still not wanting to
|
||||||
|
# maintain two different GNOME setups. HMMMM!
|
||||||
|
- ansible.builtin.include_tasks: tasks/workstation/shared/settings/gnome.yml
|
||||||
|
when: workstation
|
||||||
|
|
||||||
|
# Try including these. Really need to get NixOS working with the rest!
|
||||||
|
#- ansible.builtin.include_tasks: tasks/general/software/telegraf.yml # "Could not find a module for unknown.""
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/tests/services.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/tests/lynis.yml
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: tasks/general/tests/nmap.yml
|
||||||
|
|
||||||
|
- name: Main | NixOS | Complete
|
||||||
|
ansible.builtin.meta: end_play
|
||||||
|
|
||||||
|
when: ansible_distribution == "NixOS"
|
||||||
|
|
||||||
|
####### General #######
|
||||||
|
|
||||||
|
# Basic setup for all enabled systems.
|
||||||
|
- name: Main | General
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Main | General | Software | runit
|
||||||
|
ansible.builtin.include_tasks: tasks/general/software/runit.yml
|
||||||
|
|
||||||
|
- name: Main | General | Software | Packages
|
||||||
|
ansible.builtin.include_tasks: tasks/general/software/packages.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
|
- name: Main | General | Software | AUR
|
||||||
|
ansible.builtin.include_tasks: tasks/general/software/aur.yml
|
||||||
|
when: internet and ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
|
- name: Main | General | Software | Sendmail
|
||||||
|
ansible.builtin.include_tasks: tasks/general/software/sendmail.yml
|
||||||
|
when: ansible_system == "FreeBSD"
|
||||||
|
and internet
|
||||||
|
|
||||||
|
- name: Main | General | Software | Metasploit
|
||||||
|
ansible.builtin.include_tasks: tasks/general/software/metasploit.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
|
# Gather again in case missing programs have now been installed.
|
||||||
|
- name: Main | General | Facts [Again]
|
||||||
|
ansible.builtin.include_tasks: facts/general/gather.yml
|
||||||
|
|
||||||
|
- name: Main | General | Settings | Swap
|
||||||
|
ansible.builtin.include_tasks: tasks/general/settings/swap.yml
|
||||||
|
|
||||||
|
- name: Main | General | Settings | Services
|
||||||
|
ansible.builtin.include_tasks: tasks/general/settings/services.yml
|
||||||
|
|
||||||
|
- name: Main | General | Settings | Tunnel
|
||||||
|
ansible.builtin.include_tasks: tasks/general/settings/tunnel.yml
|
||||||
|
|
||||||
|
- name: Main | General | Settings | Keyboard
|
||||||
|
ansible.builtin.include_tasks: tasks/general/settings/keyboard.yml
|
||||||
|
|
||||||
|
- name: Main | General | Accounts | Groups
|
||||||
|
ansible.builtin.include_tasks: tasks/general/acct_mgmt/groups.yml
|
||||||
|
|
||||||
|
- name: Main | General | Accounts | Users
|
||||||
|
ansible.builtin.include_tasks: tasks/general/acct_mgmt/users.yml
|
||||||
|
|
||||||
|
- name: Main | General | Accounts | sudo
|
||||||
|
ansible.builtin.include_tasks: tasks/general/acct_mgmt/sudo.yml
|
||||||
|
|
||||||
|
- name: Main | General | Accounts | doas
|
||||||
|
ansible.builtin.include_tasks: tasks/general/acct_mgmt/doas.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
|
- name: Main | General | Scripts | Root
|
||||||
|
ansible.builtin.include_tasks: tasks/general/scripts/root.yml
|
||||||
|
|
||||||
|
- name: Main | General | Scripts | User
|
||||||
|
ansible.builtin.include_tasks: tasks/general/scripts/user.yml
|
||||||
|
|
||||||
|
- name: Main | General | Scripts | Local
|
||||||
|
ansible.builtin.include_tasks: tasks/general/scripts/install.yml
|
||||||
|
|
||||||
|
- name: Main | General | Scripts | env-shared
|
||||||
|
ansible.builtin.include_tasks: tasks/general/scripts/env-shared.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
|
- name: Main | General | Cron | Ansible
|
||||||
|
ansible.builtin.include_tasks: tasks/general/cron/ansible.yml
|
||||||
|
|
||||||
|
# TODO Need to refactor. Maybe tasks/general/cron/freebsd.yml
|
||||||
|
- name: Main | General | Cron | Ansible [FreeBSD]
|
||||||
|
ansible.builtin.include_tasks: tasks/workstation/freebsd/cron/ansible.yml
|
||||||
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
|
when: provision
|
||||||
@@ -4,20 +4,20 @@
|
|||||||
## Gather ##
|
## Gather ##
|
||||||
|
|
||||||
- name: Miner | Account Management | Gather | Find Root Directory
|
- name: Miner | Account Management | Gather | Find Root Directory
|
||||||
shell: cd ~; pwd
|
ansible.builtin.shell: cd ~; pwd
|
||||||
register: root_home
|
register: root_home
|
||||||
|
|
||||||
|
|
||||||
## Runner ##
|
## Runner ##
|
||||||
|
|
||||||
- name: Miner | Account Management | Users | MFN
|
- name: Miner | Account Management | Users | MFN
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: mfn
|
name: mfn
|
||||||
comment: Miner Forty Niner
|
comment: Miner Forty Niner
|
||||||
system: yes
|
system: true
|
||||||
groups:
|
groups:
|
||||||
- video
|
- video
|
||||||
- render
|
- render
|
||||||
append: yes
|
append: true
|
||||||
shell: "{{ bash_exec.stdout }}"
|
shell: "{{ bash_exec.stdout }}"
|
||||||
register: user_mfn
|
register: user_mfn
|
||||||
@@ -4,23 +4,23 @@
|
|||||||
## Performance ##
|
## Performance ##
|
||||||
|
|
||||||
- name: Miner | Account Management | Cron | Ansible | Daily Performance Reboot
|
- name: Miner | Account Management | Cron | Ansible | Daily Performance Reboot
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: Daily Performance Reboot
|
name: Daily Performance Reboot
|
||||||
job: sudo reboot
|
job: sudo reboot
|
||||||
special_time: daily
|
special_time: daily
|
||||||
state: present
|
state: present
|
||||||
disabled: no
|
disabled: false
|
||||||
|
|
||||||
|
|
||||||
## Security ##
|
## Security ##
|
||||||
|
|
||||||
- name: Miner | Account Management | Cron | Ansible | Daily Security Update [apt]
|
- name: Miner | Account Management | Cron | Ansible | Daily Security Update [apt]
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: Daily Security Update
|
name: Daily Security Update
|
||||||
job: sudo apt update && sudo apt dist-upgrade -y
|
job: sudo apt update && sudo apt dist-upgrade -y
|
||||||
special_time: reboot
|
special_time: reboot
|
||||||
state: present
|
state: present
|
||||||
disabled: yes
|
disabled: true
|
||||||
when: ansible_pkg_mgr == "apt"
|
when: ansible_pkg_mgr == "apt"
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
## Mining ##
|
## Mining ##
|
||||||
|
|
||||||
- name: Miner | Account Management | Cron | MFN | Stop Jobs
|
- name: Miner | Account Management | Cron | MFN | Stop Jobs
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: mfn
|
user: mfn
|
||||||
name: "Stop {{ item.name }}"
|
name: "Stop {{ item.name }}"
|
||||||
minute: "*/5"
|
minute: "*/5"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
loop: "{{ miners }}"
|
loop: "{{ miners }}"
|
||||||
|
|
||||||
- name: Miner | Account Management | Cron | MFN | Start Jobs
|
- name: Miner | Account Management | Cron | MFN | Start Jobs
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: mfn
|
user: mfn
|
||||||
name: "Start {{ item.name }}"
|
name: "Start {{ item.name }}"
|
||||||
job: "{{ item.command }}"
|
job: "{{ item.command }}"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Print out all inventory flags associated to mining.
|
# Print out all inventory flags associated to mining.
|
||||||
|
|
||||||
- name: Miner | DEBUG | Inventory Variables
|
- name: Miner | DEBUG | Inventory Variables
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: "{{ item }}"
|
var: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- amdgpu
|
- amdgpu
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
## Step 0/3: Dependencies ##
|
## Step 0/3: Dependencies ##
|
||||||
- name: Miner | Driver | AMDGPU | Variables
|
- name: Miner | Driver | AMDGPU | Variables
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
amdgpu_cron_job: AMDGPU - Need To Finish Installation
|
amdgpu_cron_job: AMDGPU - Need To Finish Installation
|
||||||
amdgpu_cron_cmd: "{{ root_home.stdout }}/scm.sh"
|
amdgpu_cron_cmd: "{{ root_home.stdout }}/scm.sh"
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Install Dependencies
|
- name: Miner | Driver | AMDGPU | Install Dependencies
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- dkms
|
- dkms
|
||||||
- mesa-common-dev
|
- mesa-common-dev
|
||||||
@@ -16,42 +16,42 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Set GRUB Timer
|
- name: Miner | Driver | AMDGPU | Set GRUB Timer
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/default/grub
|
path: /etc/default/grub
|
||||||
regexp: '^GRUB_TIMEOUT='
|
regexp: '^GRUB_TIMEOUT='
|
||||||
line: 'GRUB_TIMEOUT=3'
|
line: 'GRUB_TIMEOUT=3'
|
||||||
state: present
|
state: present
|
||||||
backup: yes
|
backup: true
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Remove Previous Run's Cron Job
|
- name: Miner | Driver | AMDGPU | Remove Previous Run's Cron Job
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: root
|
user: root
|
||||||
name: "{{ amdgpu_cron_job }}"
|
name: "{{ amdgpu_cron_job }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
- name: Miner | Driver | AMDGPU | Check If GA Kernel Installed
|
- name: Miner | Driver | AMDGPU | Check If GA Kernel Installed
|
||||||
shell: 'uname --kernel-release | grep 5.4.0-65-generic'
|
ansible.builtin.shell: 'uname --kernel-release | grep 5.4.0-65-generic'
|
||||||
register: ga_kernel
|
register: ga_kernel
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Check If HWE Kernel Installed
|
- name: Miner | Driver | AMDGPU | Check If HWE Kernel Installed
|
||||||
shell: 'apt search linux-image-5.8.0-* | grep -c installed'
|
ansible.builtin.shell: 'apt search linux-image-5.8.0-* | grep -c installed'
|
||||||
register: hwe_kernel
|
register: hwe_kernel
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
#- name: Miner | Driver | AMDGPU | Check If All Driver Installed
|
#- name: Miner | Driver | AMDGPU | Check If All Driver Installed
|
||||||
# shell: 'which amdgpu-uninstall'
|
# ansible.builtin.shell: 'which amdgpu-uninstall'
|
||||||
# register: amdgpu_install
|
# register: amdgpu_install
|
||||||
# ignore_errors: yes
|
# ignore_errors: true
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Check If Pro Driver Installed
|
- name: Miner | Driver | AMDGPU | Check If Pro Driver Installed
|
||||||
shell: 'amdgpu-pro-uninstall -y'
|
ansible.builtin.shell: 'amdgpu-pro-uninstall -y'
|
||||||
register: amdgpu_install
|
register: amdgpu_install
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | DEBUG
|
- name: Miner | Driver | AMDGPU | DEBUG
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: "{{ item }}"
|
var: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- ga_kernel
|
- ga_kernel
|
||||||
@@ -62,11 +62,11 @@
|
|||||||
|
|
||||||
## Step 1/3: Get Correct Kernel ##
|
## Step 1/3: Get Correct Kernel ##
|
||||||
- name: Miner | Driver | AMDGPU | Install Recommended GA Kernel
|
- name: Miner | Driver | AMDGPU | Install Recommended GA Kernel
|
||||||
shell: apt install --install-recommends linux-generic
|
ansible.builtin.shell: apt install --install-recommends linux-generic
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Install Specific GA Kernel For Booting
|
- name: Miner | Driver | AMDGPU | Install Specific GA Kernel For Booting
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- linux-headers-5.4.0-65
|
- linux-headers-5.4.0-65
|
||||||
- linux-headers-5.4.0-65-generic
|
- linux-headers-5.4.0-65-generic
|
||||||
@@ -77,30 +77,30 @@
|
|||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Prepare GRUB To Boot GA Kernel
|
- name: Miner | Driver | AMDGPU | Prepare GRUB To Boot GA Kernel
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/default/grub
|
path: /etc/default/grub
|
||||||
regexp: '^GRUB_DEFAULT='
|
regexp: '^GRUB_DEFAULT='
|
||||||
line: 'GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-65-generic"'
|
line: 'GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-65-generic"'
|
||||||
state: present
|
state: present
|
||||||
backup: yes
|
backup: true
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Update GRUB
|
- name: Miner | Driver | AMDGPU | Update GRUB
|
||||||
shell: update-grub
|
ansible.builtin.shell: update-grub
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
|
- name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: root
|
user: root
|
||||||
name: "{{ amdgpu_cron_job }}"
|
name: "{{ amdgpu_cron_job }}"
|
||||||
special_time: reboot
|
special_time: reboot
|
||||||
job: "{{ amdgpu_cron_cmd }}"
|
job: "{{ amdgpu_cron_cmd }}"
|
||||||
state: present
|
state: present
|
||||||
disabled: no
|
disabled: false
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Reboot To GA Kernel
|
- name: Miner | Driver | AMDGPU | Reboot To GA Kernel
|
||||||
shell: reboot
|
ansible.builtin.shell: reboot
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0" and ga_kernel.failed
|
||||||
|
|
||||||
- pause:
|
- pause:
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
|
|
||||||
## Step 2/3: Remove Incorrect Kernels ##
|
## Step 2/3: Remove Incorrect Kernels ##
|
||||||
- name: Miner | Driver | AMDGPU | Remove Bad Kernels
|
- name: Miner | Driver | AMDGPU | Remove Bad Kernels
|
||||||
shell: "apt remove --purge linux-generic-hwe-20.04 \
|
ansible.builtin.shell: "apt remove --purge linux-generic-hwe-20.04 \
|
||||||
linux-oem-20.04 \
|
linux-oem-20.04 \
|
||||||
linux-hwe-* \
|
linux-hwe-* \
|
||||||
linux-oem-* \
|
linux-oem-* \
|
||||||
@@ -121,36 +121,36 @@
|
|||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Update + Clean System
|
- name: Miner | Driver | AMDGPU | Update + Clean System
|
||||||
shell: "apt update; apt dist-upgrade -y; apt autoremove --purge -y"
|
ansible.builtin.shell: "apt update; apt dist-upgrade -y; apt autoremove --purge -y"
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
||||||
|
|
||||||
# This is to ensure we can test adding `apt install --install-recommends linux-generic` later
|
# This is to ensure we can test adding `apt install --install-recommends linux-generic` later
|
||||||
- name: Miner | Driver | AMDGPU | Boot Default Kernel
|
- name: Miner | Driver | AMDGPU | Boot Default Kernel
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/default/grub
|
path: /etc/default/grub
|
||||||
regexp: '^GRUB_DEFAULT='
|
regexp: '^GRUB_DEFAULT='
|
||||||
line: 'GRUB_DEFAULT=0'
|
line: 'GRUB_DEFAULT=0'
|
||||||
state: present
|
state: present
|
||||||
backup: yes
|
backup: true
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Update GRUB
|
- name: Miner | Driver | AMDGPU | Update GRUB
|
||||||
shell: update-grub
|
ansible.builtin.shell: update-grub
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
|
- name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: root
|
user: root
|
||||||
name: "{{ amdgpu_cron_job }}"
|
name: "{{ amdgpu_cron_job }}"
|
||||||
special_time: reboot
|
special_time: reboot
|
||||||
job: "{{ amdgpu_cron_cmd }}"
|
job: "{{ amdgpu_cron_cmd }}"
|
||||||
state: present
|
state: present
|
||||||
disabled: no
|
disabled: false
|
||||||
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
||||||
|
|
||||||
# This reboot may not be necessary.
|
# This reboot may not be necessary.
|
||||||
#- name: Miner | Driver | AMDGPU | Reboot To Ensure GA Is 0
|
#- name: Miner | Driver | AMDGPU | Reboot To Ensure GA Is 0
|
||||||
# shell: reboot
|
# ansible.builtin.shell: reboot
|
||||||
# when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
# when: amdgpu_install.failed and hwe_kernel.stdout != "0"
|
||||||
#
|
#
|
||||||
#- pause:
|
#- pause:
|
||||||
@@ -161,34 +161,34 @@
|
|||||||
|
|
||||||
## Step 3/3: Install AMD PRO Driver ##
|
## Step 3/3: Install AMD PRO Driver ##
|
||||||
- name: Miner | Driver | AMDGPU | Download Driver
|
- name: Miner | Driver | AMDGPU | Download Driver
|
||||||
shell: 'scp {{ user }}@leet:InstallFiles/Drivers/amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz {{ root_home.stdout }}/Downloads/'
|
ansible.builtin.shell: 'scp {{ user }}@leet:InstallFiles/Drivers/amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz {{ root_home.stdout }}/Downloads/'
|
||||||
when: amdgpu_install.failed or "1" == "1"
|
when: amdgpu_install.failed or "1" == "1"
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Extract Tarball
|
- name: Miner | Driver | AMDGPU | Extract Tarball
|
||||||
shell: 'cd {{ root_home.stdout }}/Downloads; tar -xvf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz'
|
ansible.builtin.shell: 'cd {{ root_home.stdout }}/Downloads; tar -xvf amdgpu-pro-20.45-1188099-ubuntu-20.04.tar.xz'
|
||||||
when: amdgpu_install.failed or "1" == "1"
|
when: amdgpu_install.failed or "1" == "1"
|
||||||
|
|
||||||
## Only one driver set can exist at a time! ##
|
## Only one driver set can exist at a time! ##
|
||||||
#- name: Miner | Driver | AMDGPU | Install AMDGPU All Driver
|
#- name: Miner | Driver | AMDGPU | Install AMDGPU All Driver
|
||||||
# shell: 'cd {{ root_home.stdout }}/Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; ./amdgpu-install -y'
|
# ansible.builtin.shell: 'cd {{ root_home.stdout }}/Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; ./amdgpu-install -y'
|
||||||
# when: amdgpu_install.failed
|
# when: amdgpu_install.failed
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Install AMDGPU-Pro Driver
|
- name: Miner | Driver | AMDGPU | Install AMDGPU-Pro Driver
|
||||||
shell: 'cd {{ root_home.stdout }}/Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; ./amdgpu-pro-install -y --opencl=pal,legacy'
|
ansible.builtin.shell: 'cd {{ root_home.stdout }}/Downloads/amdgpu-pro-20.45-1188099-ubuntu-20.04; ./amdgpu-pro-install -y --opencl=pal,legacy'
|
||||||
when: amdgpu_install.failed or "1" == "1"
|
when: amdgpu_install.failed or "1" == "1"
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
|
- name: Miner | Driver | AMDGPU | Prepare Cron Job To SCM
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: root
|
user: root
|
||||||
name: "{{ amdgpu_cron_job }}"
|
name: "{{ amdgpu_cron_job }}"
|
||||||
special_time: reboot
|
special_time: reboot
|
||||||
job: "{{ amdgpu_cron_cmd }}"
|
job: "{{ amdgpu_cron_cmd }}"
|
||||||
state: present
|
state: present
|
||||||
disabled: no
|
disabled: false
|
||||||
when: amdgpu_install.failed
|
when: amdgpu_install.failed
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Reboot To GA Kernel
|
- name: Miner | Driver | AMDGPU | Reboot To GA Kernel
|
||||||
shell: reboot
|
ansible.builtin.shell: reboot
|
||||||
when: amdgpu_install.failed
|
when: amdgpu_install.failed
|
||||||
|
|
||||||
- pause:
|
- pause:
|
||||||
@@ -199,10 +199,10 @@
|
|||||||
|
|
||||||
## We're done! ##
|
## We're done! ##
|
||||||
- name: Miner | Driver | AMDGPU | Test Driver
|
- name: Miner | Driver | AMDGPU | Test Driver
|
||||||
shell: clinfo -l
|
ansible.builtin.shell: clinfo -l
|
||||||
register: clinfo
|
register: clinfo
|
||||||
|
|
||||||
- name: Miner | Driver | AMDGPU | Test Results
|
- name: Miner | Driver | AMDGPU | Test Results
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
var: clinfo
|
var: clinfo
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
## Dependencies ##
|
## Dependencies ##
|
||||||
- name: Miner | Software | Ethminer | Install Dependencies
|
- name: Miner | Software | Ethminer | Install Dependencies
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- build-essential
|
- build-essential
|
||||||
- dkms
|
- dkms
|
||||||
@@ -16,73 +16,73 @@
|
|||||||
- name: Miner | Software | Ethminer | Add PPA
|
- name: Miner | Software | Ethminer | Add PPA
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: ppa:ethereum/ethereum
|
repo: ppa:ethereum/ethereum
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | Install Ethereum
|
- name: Miner | Software | Ethminer | Install Ethereum
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: ethereum
|
name: ethereum
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
|
||||||
## Test ##
|
## Test ##
|
||||||
- name: Miner | Software | Ethminer | Test If Installed
|
- name: Miner | Software | Ethminer | Test If Installed
|
||||||
shell: "which ethminer"
|
ansible.builtin.shell: "which ethminer"
|
||||||
register: ethminer_install
|
register: ethminer_install
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
|
|
||||||
## Download ##
|
## Download ##
|
||||||
- name: Miner | Software | Ethminer | Remove Git Repo
|
- name: Miner | Software | Ethminer | Remove Git Repo
|
||||||
shell: rm -rf ethminer
|
ansible.builtin.shell: rm -rf ethminer
|
||||||
args:
|
args:
|
||||||
chdir: "{{ root_home.stdout }}/Downloads"
|
chdir: "{{ root_home.stdout }}/Downloads"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
when: ethminer_install.failed
|
when: ethminer_install.failed
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | Clone Git Repo
|
- name: Miner | Software | Ethminer | Clone Git Repo
|
||||||
shell: git clone https://github.com/ethereum-mining/ethminer.git
|
ansible.builtin.shell: git clone https://github.com/ethereum-mining/ethminer.git
|
||||||
args:
|
args:
|
||||||
chdir: "{{ root_home.stdout }}/Downloads"
|
chdir: "{{ root_home.stdout }}/Downloads"
|
||||||
when: ethminer_install.failed
|
when: ethminer_install.failed
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | Update Repo's Repos
|
- name: Miner | Software | Ethminer | Update Repo's Repos
|
||||||
shell: git submodule update --init --recursive
|
ansible.builtin.shell: git submodule update --init --recursive
|
||||||
args:
|
args:
|
||||||
chdir: "{{ root_home.stdout }}/Downloads/ethminer"
|
chdir: "{{ root_home.stdout }}/Downloads/ethminer"
|
||||||
when: ethminer_install.failed
|
when: ethminer_install.failed
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | Create Build Folder
|
- name: Miner | Software | Ethminer | Create Build Folder
|
||||||
shell: mkdir -p build
|
ansible.builtin.shell: mkdir -p build
|
||||||
args:
|
args:
|
||||||
chdir: "{{ root_home.stdout }}/Downloads/ethminer"
|
chdir: "{{ root_home.stdout }}/Downloads/ethminer"
|
||||||
when: ethminer_install.failed
|
when: ethminer_install.failed
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | Default Flags
|
- name: Miner | Software | Ethminer | Default Flags
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
opencl_flag: "OFF"
|
opencl_flag: "OFF"
|
||||||
cuda_flag: "OFF"
|
cuda_flag: "OFF"
|
||||||
dbus_flag: "OFF"
|
dbus_flag: "OFF"
|
||||||
sys_opencl_flag: "ON"
|
sys_opencl_flag: "ON"
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | Determine OPENCL Flag
|
- name: Miner | Software | Ethminer | Determine OPENCL Flag
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
opencl_flag: "ON"
|
opencl_flag: "ON"
|
||||||
sys_opencl_flag: "OFF"
|
sys_opencl_flag: "OFF"
|
||||||
when: amdgpu == true
|
when: amdgpu
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | Determine CUDA Flag
|
- name: Miner | Software | Ethminer | Determine CUDA Flag
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
cuda_flag: "ON"
|
cuda_flag: "ON"
|
||||||
when: nvidia == true
|
when: nvidia
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | Determine DBUS Flag
|
- name: Miner | Software | Ethminer | Determine DBUS Flag
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
dbus_flag: "ON"
|
dbus_flag: "ON"
|
||||||
when: ansible_distribution == "Pop!_OS"
|
when: ansible_distribution == "Pop!_OS"
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | cmake Flags
|
- name: Miner | Software | Ethminer | cmake Flags
|
||||||
shell: "cmake .. -DETHASHCL={{ opencl_flag }} \
|
ansible.builtin.shell: "cmake .. -DETHASHCL={{ opencl_flag }} \
|
||||||
-DETHASHCUDA={{ cuda_flag }} \
|
-DETHASHCUDA={{ cuda_flag }} \
|
||||||
-DAPICORE=ON \
|
-DAPICORE=ON \
|
||||||
-DBINKERN=ON \
|
-DBINKERN=ON \
|
||||||
@@ -94,13 +94,13 @@
|
|||||||
when: ethminer_install.failed
|
when: ethminer_install.failed
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | cmake Build
|
- name: Miner | Software | Ethminer | cmake Build
|
||||||
shell: cmake --build .
|
ansible.builtin.shell: cmake --build .
|
||||||
args:
|
args:
|
||||||
chdir: "{{ root_home.stdout }}/Downloads/ethminer/build"
|
chdir: "{{ root_home.stdout }}/Downloads/ethminer/build"
|
||||||
when: ethminer_install.failed
|
when: ethminer_install.failed
|
||||||
|
|
||||||
- name: Miner | Software | Ethminer | make install
|
- name: Miner | Software | Ethminer | make install
|
||||||
shell: make install
|
ansible.builtin.shell: make install
|
||||||
args:
|
args:
|
||||||
chdir: "{{ root_home.stdout }}/Downloads/ethminer/build"
|
chdir: "{{ root_home.stdout }}/Downloads/ethminer/build"
|
||||||
when: ethminer_install.failed
|
when: ethminer_install.failed
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
|
|
||||||
## Personal Script Setup ##
|
## Personal Script Setup ##
|
||||||
- name: Miner | Software | Ethminer | Script
|
- name: Miner | Software | Ethminer | Script
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "scp {{ user }}@leet:InstallFiles/Miners/ethminer/ethminer.sh {{ user_mfn.home }}/"
|
- "scp {{ user }}@leet:InstallFiles/Miners/ethminer/ethminer.sh {{ user_mfn.home }}/"
|
||||||
- "chmod 755 {{ user_mfn.home }}/ethminer.sh"
|
- "chmod 755 {{ user_mfn.home }}/ethminer.sh"
|
||||||
|
|||||||
@@ -6,16 +6,18 @@
|
|||||||
## Installation ##
|
## Installation ##
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Installation | Create Home
|
- name: Miner | Software | Nanominer | Installation | Create Home
|
||||||
shell: "mkdir -p {{ nanominer_home }}"
|
ansible.builtin.shell: "mkdir -p {{ nanominer_home }}"
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Installation | Download Tarball
|
- name: Miner | Software | Nanominer | Installation | Download Tarball
|
||||||
shell: "scp {{ file_server }}:{{ nanominer_tar_remote }} {{ nanominer_tar_local }}; chown mfn {{ nanominer_tar_local }}"
|
ansible.builtin.shell: "scp {{ file_server }}:{{ nanominer_tar_remote }} {{ nanominer_tar_local }}; chown mfn {{ nanominer_tar_local }}"
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Installation | Extract Tarball
|
- name: Miner | Software | Nanominer | Installation | Extract Tarball
|
||||||
shell: "tar -xvf {{ nanominer_tar_local }}"
|
ansible.builtin.shell: "tar -xvf {{ nanominer_tar_local }}"
|
||||||
args:
|
args:
|
||||||
chdir: "{{ nanominer_home }}"
|
chdir: "{{ nanominer_home }}"
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
|
|
||||||
|
|
||||||
@@ -25,13 +27,13 @@
|
|||||||
# Delete Old Config #
|
# Delete Old Config #
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Configuration | Reset
|
- name: Miner | Software | Nanominer | Configuration | Reset
|
||||||
shell: "mv {{ nanominer_config }} ~/TRASH/"
|
ansible.builtin.shell: "mv {{ nanominer_config }} ~/TRASH/"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
# CPU #
|
# CPU #
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Configuration | CPU | Header Info
|
- name: Miner | Software | Nanominer | Configuration | CPU | Header Info
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ nanominer_config }}"
|
path: "{{ nanominer_config }}"
|
||||||
block: |
|
block: |
|
||||||
[{{ item.algorithm }}]
|
[{{ item.algorithm }}]
|
||||||
@@ -48,35 +50,38 @@
|
|||||||
marker_begin: ';;;;;;;;;;;; BEGIN'
|
marker_begin: ';;;;;;;;;;;; BEGIN'
|
||||||
marker_end: ' END'
|
marker_end: ' END'
|
||||||
state: "{{ item.state }}"
|
state: "{{ item.state }}"
|
||||||
create: yes
|
create: true
|
||||||
loop:
|
loop:
|
||||||
- { "algorithm": "RandomX", "wallet": '{{ wallet_xmr }}', "state": "{{ (nanominer_cpu == 'xmr') | ternary('present', 'absent') }}"}
|
- { "algorithm": "RandomX", "wallet": '{{ wallet_xmr }}', "state": "{{ (nanominer_cpu == 'xmr') | ternary('present', 'absent') }}"}
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
when: nanominer_cpu != false
|
when: nanominer_cpu != false
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Configuration | CPU | Add Pools
|
- name: Miner | Software | Nanominer | Configuration | CPU | Add Pools
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ nanominer_config }}"
|
path: "{{ nanominer_config }}"
|
||||||
line: "pool{{item.priority}} = {{ item.name }}"
|
line: "pool{{item.priority}} = {{ item.name }}"
|
||||||
state: present
|
state: present
|
||||||
create: no
|
create: false
|
||||||
loop: "{{ cpu_pool }}"
|
loop: "{{ cpu_pool }}"
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
when: nanominer_cpu != false
|
when: nanominer_cpu != false
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Configuration | CPU | End Section
|
- name: Miner | Software | Nanominer | Configuration | CPU | End Section
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ nanominer_config }}"
|
path: "{{ nanominer_config }}"
|
||||||
line: ";;;;;;;;;;;;; END CPU"
|
line: ";;;;;;;;;;;;; END CPU"
|
||||||
state: present
|
state: present
|
||||||
create: no
|
create: false
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
when: nanominer_cpu != false
|
when: nanominer_cpu != false
|
||||||
|
|
||||||
# Add Spacing #
|
# Add Spacing #
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Configuration | Spacing
|
- name: Miner | Software | Nanominer | Configuration | Spacing
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ nanominer_config }}"
|
path: "{{ nanominer_config }}"
|
||||||
block: |
|
block: |
|
||||||
;
|
;
|
||||||
@@ -84,14 +89,15 @@
|
|||||||
;
|
;
|
||||||
marker: ';'
|
marker: ';'
|
||||||
state: present
|
state: present
|
||||||
create: no
|
create: false
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
when: nanominer_config is file
|
when: nanominer_config is file
|
||||||
|
|
||||||
# GPU #
|
# GPU #
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Configuration | GPU | Header Info
|
- name: Miner | Software | Nanominer | Configuration | GPU | Header Info
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ nanominer_config }}"
|
path: "{{ nanominer_config }}"
|
||||||
block: |
|
block: |
|
||||||
[{{ item.algorithm }}]
|
[{{ item.algorithm }}]
|
||||||
@@ -113,28 +119,31 @@
|
|||||||
marker_begin: ';;;;;;;;;;;; BEGIN'
|
marker_begin: ';;;;;;;;;;;; BEGIN'
|
||||||
marker_end: ' END'
|
marker_end: ' END'
|
||||||
state: "{{ item.state }}"
|
state: "{{ item.state }}"
|
||||||
create: yes
|
create: true
|
||||||
loop:
|
loop:
|
||||||
- { "algorithm": "Ethash", "wallet": '{{ wallet_eth }}', "state": "{{ (nanominer_gpu == 'eth') | ternary('present', 'absent') }}"}
|
- { "algorithm": "Ethash", "wallet": '{{ wallet_eth }}', "state": "{{ (nanominer_gpu == 'eth') | ternary('present', 'absent') }}"}
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
when: nanominer_gpu != false
|
when: nanominer_gpu != false
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Configuration | GPU | Add Pools
|
- name: Miner | Software | Nanominer | Configuration | GPU | Add Pools
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ nanominer_config }}"
|
path: "{{ nanominer_config }}"
|
||||||
line: "pool{{item.priority}} = {{ item.name }}"
|
line: "pool{{item.priority}} = {{ item.name }}"
|
||||||
state: present
|
state: present
|
||||||
create: no
|
create: false
|
||||||
loop: "{{ gpu_pool }}"
|
loop: "{{ gpu_pool }}"
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
when: nanominer_gpu != false
|
when: nanominer_gpu != false
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Configuration | GPU | End Section
|
- name: Miner | Software | Nanominer | Configuration | GPU | End Section
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ nanominer_config }}"
|
path: "{{ nanominer_config }}"
|
||||||
line: ";;;;;;;;;;;;; END GPU"
|
line: ";;;;;;;;;;;;; END GPU"
|
||||||
state: present
|
state: present
|
||||||
create: no
|
create: false
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
when: nanominer_gpu != false
|
when: nanominer_gpu != false
|
||||||
|
|
||||||
@@ -143,11 +152,11 @@
|
|||||||
## Executable ##
|
## Executable ##
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Executable | Reset
|
- name: Miner | Software | Nanominer | Executable | Reset
|
||||||
shell: "mv {{ nanominer_script }} ~/TRASH/"
|
ansible.builtin.shell: "mv {{ nanominer_script }} ~/TRASH/"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Executable | Create
|
- name: Miner | Software | Nanominer | Executable | Create
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ nanominer_script }}"
|
path: "{{ nanominer_script }}"
|
||||||
block: |
|
block: |
|
||||||
# 2021-02-15 - Automate nanominer script creation.
|
# 2021-02-15 - Automate nanominer script creation.
|
||||||
@@ -164,7 +173,8 @@
|
|||||||
marker_begin: "#!{{ bash_exec.stdout }} -x"
|
marker_begin: "#!{{ bash_exec.stdout }} -x"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
|
|
||||||
|
|
||||||
@@ -172,7 +182,7 @@
|
|||||||
## Permissions ##
|
## Permissions ##
|
||||||
|
|
||||||
- name: Miner | Software | Nanominer | Permissions
|
- name: Miner | Software | Nanominer | Permissions
|
||||||
shell: "chown -R mfn {{ user_mfn.home }}/nanominer*; chmod -R 755 {{ user_mfn.home }}/nanominer*"
|
ansible.builtin.shell: "chown -R mfn {{ user_mfn.home }}/nanominer*; chmod -R 755 {{ user_mfn.home }}/nanominer*"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -182,6 +192,7 @@
|
|||||||
# It should kill the miner if a user logs into an X session, such as if I'm gaming.
|
# It should kill the miner if a user logs into an X session, such as if I'm gaming.
|
||||||
# Then once I log out the job should come back within the minute.
|
# Then once I log out the job should come back within the minute.
|
||||||
- name: Miner | Software | Nanominer | Reload
|
- name: Miner | Software | Nanominer | Reload
|
||||||
shell: "killall {{ nanominer_script }}; killall {{ nanominer_exec }}; killall nanominer.sh; killall nanominer"
|
ansible.builtin.shell: "killall {{ nanominer_script }}; killall {{ nanominer_exec }}; killall nanominer.sh; killall nanominer"
|
||||||
|
become: true
|
||||||
become_user: mfn
|
become_user: mfn
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
@@ -2,5 +2,5 @@
|
|||||||
# Mine monero with CPUs!
|
# Mine monero with CPUs!
|
||||||
|
|
||||||
- name: Miner | Software | XMR-Stak-CPU
|
- name: Miner | Software | XMR-Stak-CPU
|
||||||
shell: exit 0
|
ansible.builtin.shell: exit 0
|
||||||
when: '"1" == "0"'
|
when: '"1" == "0"'
|
||||||
@@ -2,15 +2,15 @@
|
|||||||
# Ensure certbot renews certs on time.
|
# Ensure certbot renews certs on time.
|
||||||
|
|
||||||
- name: Server | Cron | Certbot | Find Executable
|
- name: Server | Cron | Certbot | Find Executable
|
||||||
shell: which certbot
|
ansible.builtin.shell: which certbot
|
||||||
register: certbot
|
register: certbot
|
||||||
|
|
||||||
- name: Server | Cron | Certbot | Monthly Renewal
|
- name: Server | Cron | Certbot | Monthly Renewal
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: root
|
user: root
|
||||||
name: Monthly Renewal
|
name: Monthly Renewal
|
||||||
job: "{{ certbot.stdout }} renew"
|
job: "{{ certbot.stdout }} renew"
|
||||||
special_time: weekly
|
special_time: weekly
|
||||||
state: present
|
state: present
|
||||||
disabled: no
|
disabled: false
|
||||||
when: certbot == true and certbot.stdout is defined
|
when: certbot and certbot.stdout is defined
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
## Pre-reqs ##
|
## Pre-reqs ##
|
||||||
|
|
||||||
- name: Server | Grafana | Pre-Requirements | Install
|
- name: Server | Grafana | Pre-Requirements | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- apt-transport-https
|
- apt-transport-https
|
||||||
- software-properties-common
|
- software-properties-common
|
||||||
@@ -16,14 +16,14 @@
|
|||||||
## Install ##
|
## Install ##
|
||||||
|
|
||||||
- name: Server | Grafana | Install | Add Repo
|
- name: Server | Grafana | Install | Add Repo
|
||||||
shell: '{{ item }}'
|
ansible.builtin.shell: '{{ item }}'
|
||||||
loop:
|
loop:
|
||||||
- wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -
|
- wget -q -O - https://packages.grafana.com/gpg.key | apt-key add -
|
||||||
- echo "deb https://packages.grafana.com/oss/deb stable main" | tee /etc/apt/sources.list.d/grafana.list
|
- echo "deb https://packages.grafana.com/oss/deb stable main" | tee /etc/apt/sources.list.d/grafana.list
|
||||||
- apt update
|
- apt update
|
||||||
|
|
||||||
- name: Server | Grafana | Install | Main
|
- name: Server | Grafana | Install | Main
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- grafana
|
- grafana
|
||||||
state: present
|
state: present
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
## Configure ##
|
## Configure ##
|
||||||
|
|
||||||
- name: Server | Grafana | Configure
|
- name: Server | Grafana | Configure
|
||||||
shell: '{{ item }}'
|
ansible.builtin.shell: '{{ item }}'
|
||||||
loop:
|
loop:
|
||||||
- systemctl daemon-reload
|
- systemctl daemon-reload
|
||||||
- systemctl enable grafana-server
|
- systemctl enable grafana-server
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
# Install HUGO to host sites like parrotsec.org
|
# Install HUGO to host sites like parrotsec.org
|
||||||
|
|
||||||
- name: Server | Software | HUGO | Variables (apt)
|
- name: Server | Software | HUGO | Variables (apt)
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
hugo_package: hugo
|
hugo_package: hugo
|
||||||
when: ansible_pkg_mgr == "apt"
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
- name: Server | Software | HUGO | Variables (FreeBSD)
|
- name: Server | Software | HUGO | Variables (FreeBSD)
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
hugo_package: gohugo
|
hugo_package: gohugo
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
|
|
||||||
- name: Server | Software | HUGO | Variables (FreeBSD)
|
- name: Server | Software | HUGO | Variables (FreeBSD)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ hugo_package }}"
|
name: "{{ hugo_package }}"
|
||||||
state: present
|
state: present
|
||||||
@@ -3,12 +3,12 @@
|
|||||||
# https://docs.influxdata.com/influxdb/v1.8/introduction/get-started/
|
# https://docs.influxdata.com/influxdb/v1.8/introduction/get-started/
|
||||||
|
|
||||||
- name: Server | InfluxDB1 | Check
|
- name: Server | InfluxDB1 | Check
|
||||||
shell: which influxd
|
ansible.builtin.shell: which influxd
|
||||||
register: influxdb_check
|
register: influxdb_check
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Server | InfluxDB1 | Install
|
- name: Server | InfluxDB1 | Install
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
args:
|
args:
|
||||||
chdir: "{{ ansible_env.HOME }}/Downloads/"
|
chdir: "{{ ansible_env.HOME }}/Downloads/"
|
||||||
loop:
|
loop:
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
when: influxdb_check.failed
|
when: influxdb_check.failed
|
||||||
|
|
||||||
- name: Server | InfluxDB1 | Config
|
- name: Server | InfluxDB1 | Config
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- influx -execute "create database main"
|
- influx -execute "create database main"
|
||||||
- influx -execute "show databases"
|
- influx -execute "show databases"
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
# https://docs.influxdata.com/influxdb/v2.0/get-started/?t=Linux
|
# https://docs.influxdata.com/influxdb/v2.0/get-started/?t=Linux
|
||||||
|
|
||||||
- name: Server | InfluxDB2 | Check
|
- name: Server | InfluxDB2 | Check
|
||||||
shell: which influxd
|
ansible.builtin.shell: which influxd
|
||||||
register: influxdb_check
|
register: influxdb_check
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Server | InfluxDB2 | Install
|
- name: Server | InfluxDB2 | Install
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
args:
|
args:
|
||||||
chdir: "{{ ansible_env.HOME }}/Downloads/"
|
chdir: "{{ ansible_env.HOME }}/Downloads/"
|
||||||
loop:
|
loop:
|
||||||
@@ -20,6 +20,6 @@
|
|||||||
when: influxdb_check.failed
|
when: influxdb_check.failed
|
||||||
|
|
||||||
- name: Server | InfluxDB2 | Config
|
- name: Server | InfluxDB2 | Config
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- influx setup -f -u {{ user }} -p initpassword -o Hyperling -b main -r 0
|
- influx setup -f -u {{ user }} -p initpassword -o Hyperling -b main -r 0
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
## Pre-Reqs ##
|
## Pre-Reqs ##
|
||||||
|
|
||||||
- name: Server | OnlyOffice | Pre-Requirements | Install
|
- name: Server | OnlyOffice | Pre-Requirements | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- gnupg
|
- gnupg
|
||||||
- python3-certbot-nginx
|
- python3-certbot-nginx
|
||||||
@@ -17,35 +17,36 @@
|
|||||||
# Dependencies #
|
# Dependencies #
|
||||||
|
|
||||||
- name: Server | OnlyOffice | Postgres | Install
|
- name: Server | OnlyOffice | Postgres | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: postgresql
|
name: postgresql
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Server | OnlyOffice | Postgres | Configure
|
- name: Server | OnlyOffice | Postgres | Configure
|
||||||
shell: '{{ item }}'
|
ansible.builtin.shell: '{{ item }}'
|
||||||
loop:
|
loop:
|
||||||
- psql -c "CREATE DATABASE onlyoffice;"
|
- psql -c "CREATE DATABASE onlyoffice;"
|
||||||
- psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
|
- psql -c "CREATE USER onlyoffice WITH password 'onlyoffice';"
|
||||||
- psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
|
- psql -c "GRANT ALL privileges ON DATABASE onlyoffice TO onlyoffice;"
|
||||||
|
become: true
|
||||||
become_user: postgres
|
become_user: postgres
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Server | OnlyOffice | RabbitMQ | Install
|
- name: Server | OnlyOffice | RabbitMQ | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: rabbitmq-server
|
name: rabbitmq-server
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Actual Program #
|
# Actual Program #
|
||||||
|
|
||||||
- name: Server | OnlyOffice | Docs | Add Repo
|
- name: Server | OnlyOffice | Docs | Add Repo
|
||||||
shell: '{{ item }}'
|
ansible.builtin.shell: '{{ item }}'
|
||||||
loop:
|
loop:
|
||||||
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5
|
||||||
- echo "deb https://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list
|
- echo "deb https://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list
|
||||||
- apt update
|
- apt update
|
||||||
|
|
||||||
- name: Server | OnlyOffice | Docs | Install
|
- name: Server | OnlyOffice | Docs | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- ttf-mscorefonts-installer
|
- ttf-mscorefonts-installer
|
||||||
- onlyoffice-documentserver
|
- onlyoffice-documentserver
|
||||||
@@ -59,32 +60,32 @@
|
|||||||
# Certs #
|
# Certs #
|
||||||
|
|
||||||
#- name: Server | OnlyOffice | HTTPS | Check For Cert
|
#- name: Server | OnlyOffice | HTTPS | Check For Cert
|
||||||
# shell: "ls -l /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/{fullchain,privkey}.pem"
|
# ansible.builtin.shell: "ls -l /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/{fullchain,privkey}.pem"
|
||||||
# register: onlyoffice_cert
|
# register: onlyoffice_cert
|
||||||
# ignore_errors: yes
|
# ignore_errors: true
|
||||||
#
|
#
|
||||||
#- name: Server | OnlyOffice | HTTPS | Create Cert
|
#- name: Server | OnlyOffice | HTTPS | Create Cert
|
||||||
# shell: "certbot --nginx -d {{ ansible_hostname }}.{{ domain }}"
|
# ansible.builtin.shell: "certbot --nginx -d {{ ansible_hostname }}.{{ domain }}"
|
||||||
# when: onlyoffice_cert.failed
|
# when: onlyoffice_cert.failed
|
||||||
|
|
||||||
# Config #
|
# Config #
|
||||||
|
|
||||||
#- name: Server | OnlyOffice | HTTPS | Check For Config
|
#- name: Server | OnlyOffice | HTTPS | Check For Config
|
||||||
# shell: ls -l /etc/onlyoffice/documentserver/nginx/ds.conf
|
# ansible.builtin.shell: ls -l /etc/onlyoffice/documentserver/nginx/ds.conf
|
||||||
# register: onlyoffice_cert
|
# register: onlyoffice_cert
|
||||||
#
|
#
|
||||||
#- name: Server | OnlyOffice | HTTPS | Create Config
|
#- name: Server | OnlyOffice | HTTPS | Create Config
|
||||||
# shell: cp -f /etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl /etc/onlyoffice/documentserver/nginx/ds.conf
|
# ansible.builtin.shell: cp -f /etc/onlyoffice/documentserver/nginx/ds-ssl.conf.tmpl /etc/onlyoffice/documentserver/nginx/ds.conf
|
||||||
# when: onlyoffice_cert.failed
|
# when: onlyoffice_cert.failed
|
||||||
#
|
#
|
||||||
#- name: Server | OnlyOffice | HTTPS | Modify Config
|
#- name: Server | OnlyOffice | HTTPS | Modify Config
|
||||||
# lineinfile:
|
# ansible.builtin.lineinfile:
|
||||||
# path: /etc/onlyoffice/documentserver/nginx/ds.conf
|
# path: /etc/onlyoffice/documentserver/nginx/ds.conf
|
||||||
# regexp: '{{ item.regexp }}'
|
# regexp: '{{ item.regexp }}'
|
||||||
# line: '{{ item.line }}; # MANAGED BY ANSIBLE'
|
# line: '{{ item.line }}; # MANAGED BY ANSIBLE'
|
||||||
# state: present
|
# state: present
|
||||||
# create: no
|
# create: false
|
||||||
# backup: yes
|
# backup: true
|
||||||
# loop:
|
# loop:
|
||||||
# - { "regexp": "ssl_certificate ", "line": " ssl_certificate /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/fullchain.pem" }
|
# - { "regexp": "ssl_certificate ", "line": " ssl_certificate /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/fullchain.pem" }
|
||||||
# - { "regexp": "ssl_certificate_key ", "line": " ssl_certificate_key /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/privkey.pem" }
|
# - { "regexp": "ssl_certificate_key ", "line": " ssl_certificate_key /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/privkey.pem" }
|
||||||
@@ -92,7 +93,7 @@
|
|||||||
# Services #
|
# Services #
|
||||||
|
|
||||||
- name: Server | OnlyOffice | HTTPS | Reload nginx
|
- name: Server | OnlyOffice | HTTPS | Reload nginx
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: nginx
|
name: nginx
|
||||||
status: reloaded
|
status: reloaded
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
@@ -4,17 +4,17 @@
|
|||||||
## ACPID ##
|
## ACPID ##
|
||||||
|
|
||||||
- name: Server | Software | Services | ACPID | Install
|
- name: Server | Software | Services | ACPID | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ acpi }}"
|
name: "{{ acpi }}"
|
||||||
state: present
|
state: present
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Server | Software | Services | ACPID | Enable
|
- name: Server | Software | Services | ACPID | Enable
|
||||||
service:
|
ansible.builtin.service:
|
||||||
name: "{{ acpi }}"
|
name: "{{ acpi }}"
|
||||||
pattern: "{{ acpi_pattern }}"
|
pattern: "{{ acpi_pattern }}"
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: true
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
# Cron jobs specific to FreeBSD
|
# Cron jobs specific to FreeBSD
|
||||||
|
|
||||||
- name: General | Cron | Ansible | FreeBSD | Enable Security Update
|
- name: General | Cron | Ansible | FreeBSD | Enable Security Update
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: "Security Update"
|
name: "Security Update"
|
||||||
special_time: weekly
|
special_time: weekly
|
||||||
job: "sudo freebsd-update cron -t me@hyperling.com"
|
job: "sudo freebsd-update cron -t me@hyperling.com"
|
||||||
state: present
|
state: present
|
||||||
disabled: no
|
disabled: false
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# Provide FreeBSD with a DE.
|
# Provide FreeBSD with a DE.
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | GUI | Install UI Components
|
- name: Workstation | FreeBSD | Software | GUI | Install UI Components
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- xorg
|
- xorg
|
||||||
- gnome3-lite
|
- gnome3-lite
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | GUI | Create rc.conf Entries
|
- name: Workstation | FreeBSD | Software | GUI | Create rc.conf Entries
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ rc_conf }}"
|
path: "{{ rc_conf }}"
|
||||||
marker: "# {mark} MANAGED BY ANSIBLE | GNOME Components"
|
marker: "# {mark} MANAGED BY ANSIBLE | GNOME Components"
|
||||||
block: |
|
block: |
|
||||||
@@ -25,19 +25,19 @@
|
|||||||
gnome_enable="YES"
|
gnome_enable="YES"
|
||||||
#gdm_enable="YES"
|
#gdm_enable="YES"
|
||||||
lightdm_enable="YES"
|
lightdm_enable="YES"
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | GUI | Create fstab Entries
|
- name: Workstation | FreeBSD | Software | GUI | Create fstab Entries
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: /etc/fstab
|
path: /etc/fstab
|
||||||
block: |
|
block: |
|
||||||
proc /proc procfs rw 0 0
|
proc /proc procfs rw 0 0
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | GNOME Components'
|
marker: '# {mark} MANAGED BY ANSIBLE | GNOME Components'
|
||||||
state: present
|
state: present
|
||||||
backup: yes
|
backup: true
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | GUI | Mount All
|
- name: Workstation | FreeBSD | Software | GUI | Mount All
|
||||||
shell: mount -a
|
ansible.builtin.shell: mount -a
|
||||||
args:
|
args:
|
||||||
warn: false
|
warn: false
|
||||||
@@ -2,16 +2,16 @@
|
|||||||
# Provide FreeBSD with GPU driver.
|
# Provide FreeBSD with GPU driver.
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | GPU Driver | Install
|
- name: Workstation | FreeBSD | Software | GPU Driver | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- drm-kmod
|
- drm-kmod
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | GPU Driver | Create rc.conf Entries
|
- name: Workstation | FreeBSD | Software | GPU Driver | Create rc.conf Entries
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ rc_conf }}"
|
path: "{{ rc_conf }}"
|
||||||
marker: "# {mark} MANAGED BY ANSIBLE | GPU Components"
|
marker: "# {mark} MANAGED BY ANSIBLE | GPU Components"
|
||||||
block: |
|
block: |
|
||||||
kld_list="{{ freebsd_gpu }}"
|
kld_list="{{ freebsd_gpu }}"
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
# General #
|
# General #
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | Packages | General | Install
|
- name: Workstation | FreeBSD | Software | Packages | General | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- "{{ firefox_esr }}"
|
- "{{ firefox_esr }}"
|
||||||
- "{{ evolution }}"
|
- "{{ evolution }}"
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | Packages | General | Uninstall Bloat
|
- name: Workstation | FreeBSD | Software | Packages | General | Uninstall Bloat
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- "{{ firefox }}"
|
- "{{ firefox }}"
|
||||||
- "{{ thunderbird }}"
|
- "{{ thunderbird }}"
|
||||||
@@ -22,23 +22,23 @@
|
|||||||
# Coding #
|
# Coding #
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | Packages | Coding | Install
|
- name: Workstation | FreeBSD | Software | Packages | Coding | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- vscode
|
- vscode
|
||||||
state: present
|
state: present
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | Packages | Coding | Install
|
- name: Workstation | FreeBSD | Software | Packages | Coding | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- vscode
|
- vscode
|
||||||
state: absent
|
state: absent
|
||||||
when: not coding == true
|
when: not coding
|
||||||
|
|
||||||
# Media Editors #
|
# Media Editors #
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | Packages | Editing | Install
|
- name: Workstation | FreeBSD | Software | Packages | Editing | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- gimp
|
- gimp
|
||||||
- shotcut
|
- shotcut
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
when: editing in (true, "video")
|
when: editing in (true, "video")
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | Packages | Editing | Install
|
- name: Workstation | FreeBSD | Software | Packages | Editing | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- gimp
|
- gimp
|
||||||
- shotcut
|
- shotcut
|
||||||
@@ -58,17 +58,17 @@
|
|||||||
# Gaming #
|
# Gaming #
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | Packages | Gaming | Install
|
- name: Workstation | FreeBSD | Software | Packages | Gaming | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- 0ad
|
- 0ad
|
||||||
- supertuxkart
|
- supertuxkart
|
||||||
state: present
|
state: present
|
||||||
when: gaming == true
|
when: gaming
|
||||||
|
|
||||||
- name: Workstation | FreeBSD | Software | Packages | Gaming | Install
|
- name: Workstation | FreeBSD | Software | Packages | Gaming | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- 0ad
|
- 0ad
|
||||||
- supertuxkart
|
- supertuxkart
|
||||||
state: absent
|
state: absent
|
||||||
when: not gaming == true
|
when: not gaming
|
||||||
@@ -2,21 +2,21 @@
|
|||||||
# Cron jobs specific to Linux
|
# Cron jobs specific to Linux
|
||||||
|
|
||||||
- name: General | Cron | Ansible | Linux | Update System Flatpaks
|
- name: General | Cron | Ansible | Linux | Update System Flatpaks
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: "Update System Flatpaks"
|
name: "Update System Flatpaks"
|
||||||
special_time: hourly
|
special_time: hourly
|
||||||
job: "sudo flatpak update --noninteractive"
|
job: "sudo flatpak update --noninteractive"
|
||||||
state: present
|
state: present
|
||||||
disabled: "{{ 'yes' if battery else 'no' }}"
|
disabled: true # "{{ 'yes' if battery else 'no' }}"
|
||||||
when: flatpak_distro
|
when: flatpak_distro
|
||||||
|
|
||||||
- name: General | Cron | Ansible | Linux | Update User Flatpaks
|
- name: General | Cron | Ansible | Linux | Update User Flatpaks
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: "Update User Flatpaks"
|
name: "Update User Flatpaks"
|
||||||
special_time: hourly
|
special_time: hourly
|
||||||
job: "sudo -u {{ user }} flatpak update --noninteractive"
|
job: "sudo -u {{ user }} flatpak update --noninteractive"
|
||||||
state: present
|
state: present
|
||||||
disabled: "{{ 'yes' if battery else 'no' }}"
|
disabled: true # "{{ 'yes' if battery else 'no' }}"
|
||||||
when: flatpak_distro
|
when: flatpak_distro
|
||||||
@@ -12,23 +12,34 @@
|
|||||||
# Command-line tools is all Flutter actually needs:
|
# Command-line tools is all Flutter actually needs:
|
||||||
# https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
|
# https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Facts [1/3]
|
- name: Workstation | Linux | Software | Android | Facts [01]
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
android_url: "https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip"
|
android_url: "https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip"
|
||||||
android_download_file: "{{ user_user.home }}/Downloads/android-cmdline-tools.tar.xz"
|
android_download_file: "{{ user_user.home }}/Downloads/android-cmdline-tools.tar.xz"
|
||||||
android_sdk_location: "{{ user_user.home }}/SDKs/Android/Sdk"
|
android_sdk_location: "{{ user_user.home }}/SDKs/Android/Sdk"
|
||||||
android_report_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.sdk.android.txt"
|
android_report_file: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.sdk.android.txt"
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Facts [2/3]
|
- name: Workstation | Linux | Software | Android | Facts [02]
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
android_bin_location: "{{ android_sdk_location }}/platform-tools"
|
android_bin_location: "{{ android_sdk_location }}/platform-tools"
|
||||||
android_sdk_cmdline_temp: "{{ android_sdk_location }}/ansible"
|
android_sdk_cmdline_temp: "{{ android_sdk_location }}/ansible"
|
||||||
android_sdk_cmdline_final: "{{ android_sdk_location }}/cmdline-tools/latest/bin"
|
android_sdk_cmdline_final: "{{ android_sdk_location }}/cmdline-tools/latest/bin"
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Facts [3/3]
|
- name: Workstation | Linux | Software | Android | Facts [03]
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
android_sdkmanager_temp: "{{ android_sdk_cmdline_temp }}/cmdline-tools/bin/sdkmanager"
|
android_sdkmanager_temp: "{{ android_sdk_cmdline_temp }}/cmdline-tools/bin/sdkmanager"
|
||||||
android_sdkmanager_final: "{{ android_sdk_cmdline_final }}/sdkmanager"
|
android_sdkmanager_final: "{{ android_sdk_cmdline_final }}/sdkmanager"
|
||||||
|
android_sdkmanager_final2: "{{ android_sdk_cmdline_final }}/android"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Android | Facts [04]
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
android_sdkmanager2: "{{ android_sdkmanager_final2 }} sdk --sdk={{ android_sdk_location }}"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Android | Facts [05]
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
android_sdkmanager2_list: "{{ android_sdkmanager2 }} list"
|
||||||
|
android_sdkmanager2_install: "{{ android_sdkmanager2 }} install"
|
||||||
|
android_sdkmanager2_remove: "{{ android_sdkmanager2 }} remove"
|
||||||
|
|
||||||
# Regarding images to download; the `default` is the smallest, then `playstore`.
|
# Regarding images to download; the `default` is the smallest, then `playstore`.
|
||||||
# The `google_apis` images are significantly larger than the `playstore` option.
|
# The `google_apis` images are significantly larger than the `playstore` option.
|
||||||
@@ -68,163 +79,163 @@
|
|||||||
### 14G .
|
### 14G .
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Facts [Downloads]
|
- name: Workstation | Linux | Software | Android | Facts [Downloads]
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
android_downloads_required:
|
android_downloads_required:
|
||||||
### 36 ###
|
### 36 ### - Recommended by Android Studio and Flutter, deprecating August 2027.
|
||||||
- build-tools;36.0.0
|
- build-tools/36.0.0
|
||||||
- platforms;android-36
|
- platforms/android-36
|
||||||
- sources;android-36
|
- sources/android-36
|
||||||
# Images
|
- system-images/android-36/default/x86_64
|
||||||
#- system-images;android-35;default;x86_64 # TODO: Switch once it exists.
|
### 35 ###
|
||||||
- system-images;android-36;google_apis_playstore;x86_64
|
# Still used by Flutter to do Sunset Alarm compilations, even targeting 36, likely due to plugins.
|
||||||
### 16 ###
|
- platforms/android-35
|
||||||
- platforms;android-16
|
### 24 ### - Base for Flutter.
|
||||||
- sources;android-16
|
- system-images/android-24/default/x86_64
|
||||||
# Images
|
### 16 ### - Base for Android Studio.
|
||||||
- system-images;android-16;default;x86
|
- system-images/android-16/default/x86
|
||||||
android_downloads_additional:
|
android_downloads_additional:
|
||||||
### 35 ###
|
### 37 ### - Upcoming version, required by August 2027.
|
||||||
- platforms;android-35
|
- build-tools/37.0.0
|
||||||
- sources;android-35
|
- platforms/android-37.0
|
||||||
# Images
|
- sources/android-37.0
|
||||||
- system-images;android-35;default;x86_64
|
|
||||||
### 34 ###
|
|
||||||
- platforms;android-34
|
|
||||||
- sources;android-34
|
|
||||||
# Images
|
|
||||||
- system-images;android-34;default;x86_64
|
|
||||||
### 33 ###
|
|
||||||
- platforms;android-33
|
|
||||||
- sources;android-33
|
|
||||||
# Images
|
|
||||||
- system-images;android-33;default;x86_64
|
|
||||||
### 30 ###
|
### 30 ###
|
||||||
- platforms;android-30
|
- system-images/android-30/default/x86_64
|
||||||
- sources;android-30
|
|
||||||
# Images
|
|
||||||
- system-images;android-30;default;x86_64
|
|
||||||
### 27 ###
|
|
||||||
- platforms;android-27
|
|
||||||
- sources;android-27
|
|
||||||
# Images
|
|
||||||
- system-images;android-27;default;x86_64
|
|
||||||
### 21 ###
|
|
||||||
- platforms;android-21
|
|
||||||
- sources;android-21
|
|
||||||
# Images
|
|
||||||
- system-images;android-21;default;x86_64
|
|
||||||
android_downloads_unused:
|
android_downloads_unused:
|
||||||
|
### 37 ###
|
||||||
### 36 ###
|
### 36 ###
|
||||||
# Images
|
- system-images/android-36/google_apis_playstore/x86_64
|
||||||
- system-images;android-36;google_apis;x86_64
|
- system-images/android-36/google_apis/x86_64
|
||||||
### 35 ###
|
### 35 ###
|
||||||
- build-tools;35.0.0
|
- build-tools/35.0.0
|
||||||
- build-tools;35.0.1
|
- build-tools/35.0.1
|
||||||
# Images
|
- sources/android-35
|
||||||
- system-images;android-35;aosp_atd;x86_64 # ATD = Automated Test Device
|
- system-images/android-35/default/x86_64
|
||||||
- system-images;android-35;google_apis;x86_64
|
- system-images/android-35/aosp_atd/x86_64 # ATD = Automated Test Device
|
||||||
- system-images;android-35;google_apis_playstore;x86_64
|
- system-images/android-35/google_apis/x86_64
|
||||||
|
- system-images/android-35/google_apis_playstore/x86_64
|
||||||
### 34 ###
|
### 34 ###
|
||||||
- build-tools;34.0.0
|
- build-tools/34.0.0
|
||||||
- platforms;android-34
|
- platforms/android-34
|
||||||
- sources;android-34
|
- sources/android-34
|
||||||
# Images
|
- system-images/android-34/default/x86_64
|
||||||
- system-images;android-34;google_apis;x86_64
|
- system-images/android-34/google_apis/x86_64
|
||||||
- system-images;android-34;google_apis_playstore;x86_64
|
- system-images/android-34/google_apis_playstore/x86_64
|
||||||
|
### 33 ###
|
||||||
|
- platforms/android-33
|
||||||
|
- sources/android-33
|
||||||
|
- system-images/android-33/default/x86_64
|
||||||
|
### 30 ###
|
||||||
|
- platforms/android-30
|
||||||
|
- sources/android-30
|
||||||
|
### 27 ###
|
||||||
|
- platforms/android-27
|
||||||
|
- sources/android-27
|
||||||
|
- system-images/android-27/default/x86_64
|
||||||
|
### 24 ###
|
||||||
|
- platforms/android-24
|
||||||
|
- sources/android-24
|
||||||
|
### 21 ###
|
||||||
|
- platforms/android-21
|
||||||
|
- sources/android-21
|
||||||
|
- system-images/android-21/default/x86_64
|
||||||
### 16 ###
|
### 16 ###
|
||||||
# Images
|
- platforms/android-16
|
||||||
- system-images;android-16;google_apis;x86
|
- sources/android-16
|
||||||
|
- system-images/android-16/google_apis/x86
|
||||||
### 15 ###
|
### 15 ###
|
||||||
- platforms;android-15
|
- platforms/android-15
|
||||||
- sources;android-15
|
- sources/android-15
|
||||||
# Images
|
- system-images/android-15/default/x86 # Not working in Android AVDs
|
||||||
- system-images;android-15;default;x86 # Not working in Android AVDs
|
|
||||||
|
|
||||||
## Checks ##
|
## Checks ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Check SDK Manager Exists [1/2]
|
- name: Workstation | Linux | Software | Android | Check SDK Manager Exists [1/2]
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ android_sdkmanager_temp }}"
|
path: "{{ android_sdkmanager_temp }}"
|
||||||
get_attributes: false
|
get_attributes: false
|
||||||
get_checksum: false
|
get_checksum: false
|
||||||
get_mime: false
|
get_mime: false
|
||||||
register: android_sdkmanager_temp_stat
|
register: android_sdkmanager_temp_stat
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Check SDK Manager Exists [2/2]
|
- name: Workstation | Linux | Software | Android | Check SDK Manager Exists [2/2]
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ android_sdkmanager_final }}"
|
path: "{{ android_sdkmanager_final }}"
|
||||||
get_attributes: false
|
get_attributes: false
|
||||||
get_checksum: false
|
get_checksum: false
|
||||||
get_mime: false
|
get_mime: false
|
||||||
register: android_sdkmanager_final_stat
|
register: android_sdkmanager_check
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Check Download Exists
|
- name: Workstation | Linux | Software | Android | Check Download Exists
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ android_download_file }}"
|
path: "{{ android_download_file }}"
|
||||||
get_attributes: false
|
get_attributes: false
|
||||||
get_checksum: false
|
get_checksum: false
|
||||||
get_mime: false
|
get_mime: false
|
||||||
register: android_download_stat
|
register: android_download_stat
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
## Packages ##
|
## Packages ##
|
||||||
|
|
||||||
# https://docs.flutter.dev/get-started/install/linux/android
|
# https://docs.flutter.dev/get-started/install/linux/android
|
||||||
- name: Workstation | Linux | Software | Android | Dependencies [Install]
|
- name: Workstation | Linux | Software | Android | Dependencies [Install]
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- default-jdk
|
- "{{ android_jdk }}"
|
||||||
- libc6
|
- "{{ c_libs }}"
|
||||||
- libncurses5
|
- "{{ ncurses }}"
|
||||||
- libstdc++6
|
- "{{ cpp_libs }}"
|
||||||
- lib32z1
|
- "{{ z_libs }}"
|
||||||
- libbz2-1.0
|
- "{{ bzip }}"
|
||||||
|
- "{{ android_udev }}"
|
||||||
state: present
|
state: present
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Dependencies [Remove]
|
- name: Workstation | Linux | Software | Android | Dependencies [Remove]
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- sdkmanager
|
- "{{ android_sdkmanager }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: coding == true
|
when: coding
|
||||||
|
and ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
## Install SDK ##
|
## Install SDK ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | SDK
|
- name: Workstation | Linux | Software | Android | SDK
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Download Commandline Tools
|
- name: Workstation | Linux | Software | Android | Download Commandline Tools
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: "{{ android_url }}"
|
url: "{{ android_url }}"
|
||||||
dest: "{{ android_download_file }}"
|
dest: "{{ android_download_file }}"
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
group: "{{ user }}"
|
group: "{{ user }}"
|
||||||
mode: '0664'
|
mode: '0664'
|
||||||
when: not android_download_stat.stat.exists
|
when: not android_download_stat.stat.exists
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Create Folder
|
- name: Workstation | Linux | Software | Android | Create Folder
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ android_sdk_cmdline_temp }}"
|
path: "{{ android_sdk_cmdline_temp }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
group: "{{ user }}"
|
group: "{{ user }}"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Extract Tools
|
- name: Workstation | Linux | Software | Android | Extract Tools
|
||||||
unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: "{{ android_download_file }}"
|
src: "{{ android_download_file }}"
|
||||||
dest: "{{ android_sdk_cmdline_temp }}"
|
dest: "{{ android_sdk_cmdline_temp }}"
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
group: "{{ user }}"
|
group: "{{ user }}"
|
||||||
|
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true and not android_sdkmanager_temp_stat.stat.exists
|
when: coding
|
||||||
|
and not android_sdkmanager_temp_stat.stat.exists
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Delete Archive
|
- name: Workstation | Linux | Software | Android | Delete Archive
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ android_download_file }}"
|
path: "{{ android_download_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
@@ -232,128 +243,236 @@
|
|||||||
|
|
||||||
# This can only be run once, otherwise cmdline-tools creates latest-* folders.
|
# This can only be run once, otherwise cmdline-tools creates latest-* folders.
|
||||||
- name: Workstation | Linux | Software | Android | Install | Consistent Modules
|
- name: Workstation | Linux | Software | Android | Install | Consistent Modules
|
||||||
shell: "yes | {{ android_sdkmanager_temp }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
ansible.builtin.shell: "yes | {{ android_sdkmanager_temp }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
||||||
loop:
|
loop:
|
||||||
# Current
|
# Current
|
||||||
- cmdline-tools;latest
|
- cmdline-tools/latest
|
||||||
- platform-tools
|
- platform-tools
|
||||||
- emulator
|
- emulator
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true and not android_sdkmanager_final_stat.stat.exists
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: coding
|
||||||
|
and not android_sdkmanager_check.stat.exists
|
||||||
|
|
||||||
|
# Report the preliminary installed packges.
|
||||||
|
- name: Workstation | Linux | Software | Android | Report Modules
|
||||||
|
ansible.builtin.shell: "{{ android_sdkmanager2_list }} > {{ android_report_file }}"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: coding
|
||||||
|
|
||||||
# These are safe to run multiple times, and uses the new `latest` version.
|
# These are safe to run multiple times, and uses the new `latest` version.
|
||||||
- name: Workstation | Linux | Software | Android | Install | Required Modules
|
- name: Workstation | Linux | Software | Android | Install | Required Modules
|
||||||
shell: "yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
ansible.builtin.shell: |
|
||||||
|
set -o pipefail
|
||||||
|
if ! cat {{ android_report_file }} | grep -v 'unknown' | grep -q '{{ item }}'; then
|
||||||
|
yes | {{ android_sdkmanager2_install }} '{{ item }}'
|
||||||
|
|
||||||
|
if cat {{ android_report_file }} | grep -q '{{ item }}'; then
|
||||||
|
echo "INSTALLED"
|
||||||
|
else
|
||||||
|
echo "FAILED"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
loop: "{{ android_downloads_required }}"
|
loop: "{{ android_downloads_required }}"
|
||||||
|
register: install_required
|
||||||
|
changed_when: "'INSTALLED' in install_required.stdout"
|
||||||
|
failed_when: "'FAILED' in install_required.stdout"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
# Add more versions for testing across all the important platforms.
|
# Add more versions for testing across all the important platforms.
|
||||||
- name: Workstation | Linux | Software | Android | Install | Additional Modules
|
- name: Workstation | Linux | Software | Android | Install | Additional Modules
|
||||||
shell: "yes | {{ android_sdkmanager_final }} --install '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
ansible.builtin.shell: |
|
||||||
|
set -o pipefail
|
||||||
|
if ! cat {{ android_report_file }} | grep -v 'unknown' | grep -q '{{ item }}'; then
|
||||||
|
yes | {{ android_sdkmanager2_install }} '{{ item }}'
|
||||||
|
|
||||||
|
if cat {{ android_report_file }} | grep -q '{{ item }}'; then
|
||||||
|
echo "INSTALLED"
|
||||||
|
else
|
||||||
|
echo "FAILED"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
loop: "{{ android_downloads_additional }}"
|
loop: "{{ android_downloads_additional }}"
|
||||||
|
register: install_additional
|
||||||
|
changed_when: "'INSTALLED' in install_additional.stdout"
|
||||||
|
failed_when: "'FAILED' in install_additional.stdout"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true and sdks == true
|
when: coding
|
||||||
|
and sdks
|
||||||
|
|
||||||
# Remove extra downloads if system is not meant for full amount of testing.
|
# Remove extra downloads if system is not meant for full amount of testing.
|
||||||
- name: Workstation | Linux | Software | Android | Uninstall | Additional Modules
|
- name: Workstation | Linux | Software | Android | Uninstall | Additional Modules
|
||||||
shell: "yes | {{ android_sdkmanager_final }} --uninstall '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
ansible.builtin.shell: |
|
||||||
|
set -o pipefail
|
||||||
|
if cat {{ android_report_file }} | grep -q '{{ item }}'; then
|
||||||
|
yes | {{ android_sdkmanager2_remove }} '{{ item }}'
|
||||||
|
|
||||||
|
if cat {{ android_report_file }} | grep -q '{{ item }}'; then
|
||||||
|
echo "FAILED"
|
||||||
|
else
|
||||||
|
echo "REMOVED"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
loop: "{{ android_downloads_additional }}"
|
loop: "{{ android_downloads_additional }}"
|
||||||
|
register: remove_additional
|
||||||
|
changed_when: "'REMOVED' in remove_additional.stdout"
|
||||||
|
failed_when: "'FAILED' in remove_additional.stdout"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding != true or sdks != true
|
when: not coding
|
||||||
|
or not sdks
|
||||||
|
|
||||||
# Remove any versions which used to be part of this script and no longer used.
|
# Remove any versions which used to be part of this script and no longer used.
|
||||||
- name: Workstation | Linux | Software | Android | Uninstall | Unused Modules
|
- name: Workstation | Linux | Software | Android | Uninstall | Unused Modules
|
||||||
shell: "yes | {{ android_sdkmanager_final }} --uninstall '{{ item }}' --sdk_root={{ android_sdk_location }}"
|
ansible.builtin.shell: |
|
||||||
loop: "{{ android_downloads_unused }}"
|
set -o pipefail
|
||||||
become_user: "{{ user }}"
|
if cat {{ android_report_file }} | grep -q '{{ item }}'; then
|
||||||
when: coding == true
|
yes | {{ android_sdkmanager2_remove }} '{{ item }}'
|
||||||
|
|
||||||
# Report the currently installed packges.
|
if cat {{ android_report_file }} | grep -q '{{ item }}'; then
|
||||||
- name: Workstation | Linux | Software | Android | Report Modules
|
echo "REMOVED"
|
||||||
shell: "{{ android_sdkmanager_final }} --list_installed --sdk_root={{ android_sdk_location }} > {{ android_report_file }}"
|
else
|
||||||
|
echo "FAILED"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
loop: "{{ android_downloads_unused }}"
|
||||||
|
register: remove_unused
|
||||||
|
changed_when: "'REMOVED' in remove_unused.stdout"
|
||||||
|
failed_when: "'FAILED' in remove_unused.stdout"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
|
# Report the currently installed packages.
|
||||||
|
- name: Workstation | Linux | Software | Android | Report Modules
|
||||||
|
ansible.builtin.shell: "{{ android_sdkmanager2_list }} --all > {{ android_report_file }}"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: coding
|
||||||
|
|
||||||
## Flutter and Licenses ##
|
## Flutter and Licenses ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Inform Flutter
|
- name: Workstation | Linux | Software | Android | Inform Flutter
|
||||||
shell: "{{ flutter }} config --android-sdk={{ android_sdk_location }}"
|
ansible.builtin.shell: "{{ flutter }} config --android-sdk={{ android_sdk_location }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | License Agreements [1/2]
|
- name: Workstation | Linux | Software | Android | License Agreements [1/2]
|
||||||
shell: "yes | {{ android_sdkmanager_final }} --licenses --sdk_root={{ android_sdk_location }}"
|
ansible.builtin.shell: "yes | {{ android_sdkmanager_final }} --licenses --sdk_root={{ android_sdk_location }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | License Agreements [2/2]
|
- name: Workstation | Linux | Software | Android | License Agreements [2/2]
|
||||||
shell: "yes | {{ flutter }} doctor --android-licenses"
|
ansible.builtin.shell: "yes | {{ flutter }} doctor --android-licenses"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Refresh Flutter Doctor Report
|
- name: Workstation | Linux | Software | Android | Refresh Flutter Doctor Report
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop: "{{ flutter_report_commands }}"
|
loop: "{{ flutter_report_commands }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: coding
|
||||||
|
|
||||||
## Configure Environment ##
|
## Configure Environment ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Modify PATH (.bashrc)
|
- name: Workstation | Linux | Software | Android | Modify PATH (.bashrc)
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}/.bashrc"
|
path: "{{ item }}/.bashrc"
|
||||||
block: |
|
block: |
|
||||||
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
|
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | Android'
|
marker: '# {mark} MANAGED BY ANSIBLE | Android'
|
||||||
state: present
|
state: absent
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_root.home }}"
|
- "{{ user_root.home }}"
|
||||||
- "{{ user_user.home }}"
|
- "{{ user_user.home }}"
|
||||||
ignore_errors: yes
|
when: coding
|
||||||
when: coding == true and user_root.home != "" and user_user.home != ""
|
and user_root.home != ""
|
||||||
|
and user_user.home != ""
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Modify PATH (.zshrc)
|
- name: Workstation | Linux | Software | Android | Modify PATH (.zshrc)
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}/.zshrc"
|
path: "{{ item }}/.zshrc"
|
||||||
block: |
|
block: |
|
||||||
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
|
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | Android'
|
marker: '# {mark} MANAGED BY ANSIBLE | Android'
|
||||||
state: present
|
state: absent
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_root.home }}"
|
- "{{ user_root.home }}"
|
||||||
- "{{ user_user.home }}"
|
- "{{ user_user.home }}"
|
||||||
ignore_errors: yes
|
when: coding
|
||||||
when: coding == true and user_root.home != "" and user_user.home != ""
|
and user_root.home != ""
|
||||||
|
and user_user.home != ""
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Modify PATH (profiles)
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
|
block: |
|
||||||
|
export ANDROID_HOME="{{ android_sdk_location }}"
|
||||||
|
export ANDROID_SDK_ROOT="$ANDROID_HOME"
|
||||||
|
export PATH="$PATH:{{ android_bin_location }}:{{ android_sdk_cmdline_final }}"
|
||||||
|
marker: '# {mark} MANAGED BY ANSIBLE | Android'
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- ".bash_profile"
|
||||||
|
- ".zprofile"
|
||||||
|
when: coding
|
||||||
|
and user_user.home != ""
|
||||||
|
|
||||||
## Uninstall SDK ##
|
## Uninstall SDK ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | Remove SDK
|
- name: Workstation | Linux | Software | Android | Remove SDK
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ android_sdk_location }}"
|
path: "{{ android_sdk_location }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: not coding == true
|
when: not coding
|
||||||
|
|
||||||
## User Tools ##
|
## User Tools ##
|
||||||
# Only needed from repo if not a development device,
|
# Only needed from repo if not a development device,
|
||||||
# otherwise better versions are in the SDK.
|
# otherwise better versions are in the SDK.
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | System Tools [Install]
|
- name: Workstation | Linux | Software | Android | System Tools [Install]
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- fastboot
|
- "{{ android_fastboot }}"
|
||||||
- adb
|
- "{{ android_adb }}"
|
||||||
state: present
|
state: present
|
||||||
when: not coding == true
|
when: not coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Android | System Tools [Remove]
|
- name: Workstation | Linux | Software | Android | System Tools [Remove]
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- fastboot
|
- "{{ android_fastboot }}"
|
||||||
- adb
|
- "{{ android_adb }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: coding == true
|
when: coding
|
||||||
@@ -5,14 +5,14 @@
|
|||||||
# to Firefox months/years back for avoiding DRM and other junk Google stuff.
|
# to Firefox months/years back for avoiding DRM and other junk Google stuff.
|
||||||
###
|
###
|
||||||
###- name: Workstation | Software | Brave | Pre-Reqs [apt]
|
###- name: Workstation | Software | Brave | Pre-Reqs [apt]
|
||||||
### package:
|
### ansible.builtin.package:
|
||||||
### name:
|
### name:
|
||||||
### - apt-transport-https
|
### - apt-transport-https
|
||||||
### state: present
|
### state: present
|
||||||
### when: ansible_pkg_mgr == "apt"
|
### when: ansible_pkg_mgr == "apt"
|
||||||
###
|
###
|
||||||
###- name: Workstation | Software | Brave | Pre-Reqs [dnf]
|
###- name: Workstation | Software | Brave | Pre-Reqs [dnf]
|
||||||
### package:
|
### ansible.builtin.package:
|
||||||
### name:
|
### name:
|
||||||
### - dnf-plugins-core
|
### - dnf-plugins-core
|
||||||
### state: present
|
### state: present
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
###
|
###
|
||||||
#### https://brave.com/linux/#debian-ubuntu-mint
|
#### https://brave.com/linux/#debian-ubuntu-mint
|
||||||
###- name: Workstation | Software | Brave | Add Repo [apt]
|
###- name: Workstation | Software | Brave | Add Repo [apt]
|
||||||
### shell: "{{ item }}"
|
### ansible.builtin.shell: "{{ item }}"
|
||||||
### loop:
|
### loop:
|
||||||
### - curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
|
### - curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
|
||||||
### - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list
|
### - echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
###
|
###
|
||||||
#### https://brave.com/linux/#fedora-centos-streamrhel
|
#### https://brave.com/linux/#fedora-centos-streamrhel
|
||||||
###- name: Workstation | Software | Brave | Add Repo [dnf]
|
###- name: Workstation | Software | Brave | Add Repo [dnf]
|
||||||
### shell: "{{ item }}"
|
### ansible.builtin.shell: "{{ item }}"
|
||||||
### loop:
|
### loop:
|
||||||
### - dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/x86_64/
|
### - dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/x86_64/
|
||||||
### - rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
### - rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
||||||
@@ -37,15 +37,15 @@
|
|||||||
###
|
###
|
||||||
#### https://brave.com/linux/#opensuse
|
#### https://brave.com/linux/#opensuse
|
||||||
###- name: Workstation | Software | Brave | Add Repo [zypper]
|
###- name: Workstation | Software | Brave | Add Repo [zypper]
|
||||||
### shell: "{{ item }}"
|
### ansible.builtin.shell: "{{ item }}"
|
||||||
### loop:
|
### loop:
|
||||||
### - rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
### - rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
|
||||||
### - zypper addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
|
### - zypper addrepo https://brave-browser-rpm-release.s3.brave.com/brave-browser.repo
|
||||||
### when: ansible_pkg_mgr == "zypper"
|
### when: ansible_pkg_mgr == "zypper"
|
||||||
### ignore_errors: yes
|
### ignore_errors: true
|
||||||
###
|
###
|
||||||
###- name: Workstation | Software | Brave | Install
|
###- name: Workstation | Software | Brave | Install
|
||||||
### package:
|
### ansible.builtin.package:
|
||||||
### name:
|
### name:
|
||||||
### - brave-browser
|
### - brave-browser
|
||||||
### state: present
|
### state: present
|
||||||
@@ -55,25 +55,25 @@
|
|||||||
# https://support.brave.com/hc/en-us/articles/4404876135565-How-do-I-uninstall-Brave
|
# https://support.brave.com/hc/en-us/articles/4404876135565-How-do-I-uninstall-Brave
|
||||||
|
|
||||||
- name: Workstation | Software | Brave | Remove
|
- name: Workstation | Software | Brave | Remove
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- brave-browser
|
- brave-browser
|
||||||
- brave-keyring
|
- brave-keyring
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Workstation | Software | Brave | Remove Repo [apt]
|
- name: Workstation | Software | Brave | Remove Repo [apt]
|
||||||
shell: rm /etc/apt/sources.list.d/brave-browser-*.list && apt update || echo "Not Needed"
|
ansible.builtin.shell: rm /etc/apt/sources.list.d/brave-browser-*.list && apt update || echo "Not Needed"
|
||||||
when: ansible_pkg_mgr == "apt"
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
- name: Workstation | Software | Brave | Remove Repo [dnf]
|
- name: Workstation | Software | Brave | Remove Repo [dnf]
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- rm /etc/yum.repos.d/brave-browser-*.repo || echo "Not Needed"
|
- rm /etc/yum.repos.d/brave-browser-*.repo || echo "Not Needed"
|
||||||
- rpm -e gpg-pubkey-c2d4e821-5e7252b8 || echo "Not Needed"
|
- rpm -e gpg-pubkey-c2d4e821-5e7252b8 || echo "Not Needed"
|
||||||
when: ansible_pkg_mgr == "dnf"
|
when: ansible_pkg_mgr == "dnf"
|
||||||
|
|
||||||
- name: Workstation | Software | Brave | Remove Repo [zypper]
|
- name: Workstation | Software | Brave | Remove Repo [zypper]
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- zypper removerepo brave-browser || echo "Not Needed"
|
- zypper removerepo brave-browser || echo "Not Needed"
|
||||||
- rpm -e gpg-pubkey-c2d4e821-5e7252b8 || echo "Not Needed"
|
- rpm -e gpg-pubkey-c2d4e821-5e7252b8 || echo "Not Needed"
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
# 20260716 - Hyperling
|
||||||
|
# Begin customizing Cinnamon's dconf similar to GNOME.
|
||||||
|
|
||||||
|
# Favorites are handled in .config/cinnamon/spices/group*/*.json files.
|
||||||
|
# Does not seem as easy as GNOME and its dconf settings.
|
||||||
|
# Cinnamon does use some dconf though.
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Cinnamon | Facts | Defaults
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
cinnamon_package: cinnamon
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Cinnamon | Facts | Debian Derivitives
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
cinnamon_package: task-cinnamon-desktop
|
||||||
|
when: ansible_distribution in ("Debian", "Devuan")
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Cinnamon | Install
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "{{ cinnamon_package }}"
|
||||||
|
- "{{ lightdm }}"
|
||||||
|
state: present
|
||||||
@@ -10,12 +10,15 @@
|
|||||||
# Then remove, autoremove, and purge flatpak executable with package manager.
|
# Then remove, autoremove, and purge flatpak executable with package manager.
|
||||||
# Source: https://softhints.com/how-to-completely-remove-flatpak-linux-mint/
|
# Source: https://softhints.com/how-to-completely-remove-flatpak-linux-mint/
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
flatpak_extension: "-flatpak"
|
||||||
|
|
||||||
## Flatpak Pre-reqs ##
|
## Flatpak Pre-reqs ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Install
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: flatpak
|
name: flatpak
|
||||||
update_cache: yes
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Add Flathub for System
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Add Flathub for System
|
||||||
flatpak_remote:
|
flatpak_remote:
|
||||||
@@ -27,36 +30,37 @@
|
|||||||
## Flatpak Installs ##
|
## Flatpak Installs ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Variables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Variables
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpak_exec_dir: "{{ user_user.home }}/bin"
|
flatpak_exec_dir: "{{ user_user.home }}/bin"
|
||||||
flatpak_exec: "flatpak run"
|
flatpak_exec: "flatpak run"
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Arrays
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Arrays
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flatpaks_generic:
|
flatpaks_generic:
|
||||||
- { app: "org.mozilla.firefox", name: "firefox-flatpak", extra: "" }
|
|
||||||
- { app: "io.gitlab.librewolf-community", name: "librewolf", extra: "" }
|
- { app: "io.gitlab.librewolf-community", name: "librewolf", extra: "" }
|
||||||
- { app: "org.signal.Signal", name: "signal", extra: "" }
|
- { app: "org.signal.Signal", name: "signal", extra: "" }
|
||||||
- { app: "im.riot.Riot", name: "element", extra: "" }
|
- { app: "im.riot.Riot", name: "element", extra: "" }
|
||||||
- { app: "org.telegram.desktop", name: "telegram", extra: "" }
|
- { app: "io.github.forkgram.tdesktop", name: "forkgram", extra: "" }
|
||||||
- { app: "org.gimp.GIMP", name: "gimp", extra: "" }
|
|
||||||
- { app: "org.libreoffice.LibreOffice", name: "office", extra: "" }
|
|
||||||
- { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" }
|
|
||||||
- { app: "app.grayjay.Grayjay", name: "grayjay", extra: "" }
|
- { app: "app.grayjay.Grayjay", name: "grayjay", extra: "" }
|
||||||
- { app: "com.github.xournalpp.xournalpp", name: "xournal", extra: "" }
|
- { app: "network.loki.Session", name: "session", extra: "" }
|
||||||
|
- { app: "com.brave.Browser", name: "brave", extra: "" }
|
||||||
|
- { app: "net.ankiweb.Anki", name: "anki", extra: "" }
|
||||||
|
- { app: "app.organicmaps.desktop", name: "organic-maps", extra: "" }
|
||||||
|
- { app: "im.dino.Dino", name: "dino", extra: "" }
|
||||||
flatpaks_coding:
|
flatpaks_coding:
|
||||||
- { app: "com.vscodium.codium", name: "codium-flatpak", extra: "" }
|
- { app: "com.vscodium.codium", name: "codium", extra: "" }
|
||||||
- { app: "com.google.AndroidStudio", name: "android-studio", extra: "" }
|
- { app: "com.google.AndroidStudio", name: "android-studio", extra: "" }
|
||||||
- { app: "io.dbeaver.DBeaverCommunity", name: "dbeaver", extra: "" }
|
- { app: "io.dbeaver.DBeaverCommunity", name: "dbeaver", extra: "" }
|
||||||
- { app: "com.visualstudio.code-oss", name: "code-flatpak", extra: "" }
|
- { app: "org.gnome.Boxes", name: "gnome-boxes", extra: "" }
|
||||||
flatpaks_editing_video:
|
flatpaks_editing_video:
|
||||||
- { app: "org.shotcut.Shotcut", name: "shotcut", extra: "" }
|
- { app: "org.shotcut.Shotcut", name: "shotcut", extra: "" }
|
||||||
- { app: "com.obsproject.Studio", name: "obs", extra: "" }
|
- { app: "com.obsproject.Studio", name: "obs-studio", extra: "" }
|
||||||
- { app: "org.openshot.OpenShot", name: "openshot", extra: "" }
|
- { app: "org.openshot.OpenShot", name: "openshot", extra: "" }
|
||||||
flatpaks_editing_audio:
|
flatpaks_editing_audio:
|
||||||
- { app: "org.tenacityaudio.Tenacity", name: "tenacity", extra: "" }
|
- { app: "org.tenacityaudio.Tenacity", name: "tenacity", extra: "" }
|
||||||
- { app: "io.lmms.LMMS", name: "lmms", extra: "" }
|
- { app: "io.lmms.LMMS", name: "lmms", extra: "" }
|
||||||
- { app: "net.sourceforge.VMPK", name: "vmpk", extra: "" }
|
- { app: "net.sourceforge.VMPK", name: "vmpk", extra: "" }
|
||||||
|
- { app: "org.musicbrainz.Picard", name: "picard", extra: "" }
|
||||||
flatpaks_gaming:
|
flatpaks_gaming:
|
||||||
- { app: "com.valvesoftware.Steam", name: "steam", extra: "" }
|
- { app: "com.valvesoftware.Steam", name: "steam", extra: "" }
|
||||||
- { app: "com.play0ad.zeroad", name: "zeroad", extra: "" }
|
- { app: "com.play0ad.zeroad", name: "zeroad", extra: "" }
|
||||||
@@ -78,6 +82,15 @@
|
|||||||
- { app: "org.rncbc.qsynth", name: "qsynth", extra: "" } # 2024-12-15, Not worth the setup, use LMMS or VMPK.
|
- { app: "org.rncbc.qsynth", name: "qsynth", extra: "" } # 2024-12-15, Not worth the setup, use LMMS or VMPK.
|
||||||
- { app: "org.godotengine.Godot", name: "godot", extra: "" } # 2025-08-31, Stopped playing with this months / years ago. Seemed cool but Flutter is working well for this purpose.
|
- { app: "org.godotengine.Godot", name: "godot", extra: "" } # 2025-08-31, Stopped playing with this months / years ago. Seemed cool but Flutter is working well for this purpose.
|
||||||
- { app: "chat.simplex.simplex", name: "simplex", extra: "" } # 2025-11-22, Takes a ton of space and does not work without interacting with phone.
|
- { app: "chat.simplex.simplex", name: "simplex", extra: "" } # 2025-11-22, Takes a ton of space and does not work without interacting with phone.
|
||||||
|
- { app: "com.visualstudio.code-oss", name: "code", extra: "" } # 2026-09-29, reached end of life a few years ago.
|
||||||
|
# 2026-09-29, Preferring local versions of apps even if they are not as up to date. #
|
||||||
|
- { app: "org.mozilla.firefox", name: "firefox", extra: "" }
|
||||||
|
- { app: "org.gimp.GIMP", name: "gimp", extra: "" }
|
||||||
|
- { app: "com.transmissionbt.Transmission", name: "transmission", extra: "" }
|
||||||
|
- { app: "org.libreoffice.LibreOffice", name: "libreoffice", extra: "" }
|
||||||
|
- { app: "com.github.xournalpp.xournalpp", name: "xournal", extra: "" }
|
||||||
|
# End 2026-09-29 #
|
||||||
|
- { app: "org.telegram.desktop", name: "telegram", extra: "" } # 2026-10-02, Switching to Forkgram desktop!
|
||||||
|
|
||||||
# Generic #
|
# Generic #
|
||||||
|
|
||||||
@@ -87,24 +100,25 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ flatpaks_generic }}"
|
loop: "{{ flatpaks_generic }}"
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Executables
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
block: |
|
block: |
|
||||||
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
||||||
marker: '{mark}'
|
marker: '{mark}'
|
||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_generic }}"
|
loop: "{{ flatpaks_generic }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Executable Permissions
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Generic | Executable Permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: file
|
state: file
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_generic }}"
|
loop: "{{ flatpaks_generic }}"
|
||||||
@@ -117,30 +131,31 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ flatpaks_coding }}"
|
loop: "{{ flatpaks_coding }}"
|
||||||
ignore_errors: yes
|
when: coding
|
||||||
when: coding == true
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Executables
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
block: |
|
block: |
|
||||||
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
||||||
marker: '{mark}'
|
marker: '{mark}'
|
||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_coding }}"
|
loop: "{{ flatpaks_coding }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Executable Permissions
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Executable Permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: file
|
state: file
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_coding }}"
|
loop: "{{ flatpaks_coding }}"
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Uninstall
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Uninstall
|
||||||
flatpak:
|
flatpak:
|
||||||
@@ -148,16 +163,14 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_coding }}"
|
loop: "{{ flatpaks_coding }}"
|
||||||
ignore_errors: yes
|
when: not coding
|
||||||
when: not coding == true
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Remove Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Coding | Remove Executables
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_coding }}"
|
loop: "{{ flatpaks_coding }}"
|
||||||
ignore_errors: yes
|
when: not coding
|
||||||
when: not coding == true
|
|
||||||
|
|
||||||
# Media Editors #
|
# Media Editors #
|
||||||
|
|
||||||
@@ -167,26 +180,27 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ flatpaks_editing_video }}"
|
loop: "{{ flatpaks_editing_video }}"
|
||||||
ignore_errors: yes
|
|
||||||
when: editing in (true, "video")
|
when: editing in (true, "video")
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Executables
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
block: |
|
block: |
|
||||||
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
||||||
marker: '{mark}'
|
marker: '{mark}'
|
||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_editing_video }}"
|
loop: "{{ flatpaks_editing_video }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: editing in (true, "video")
|
when: editing in (true, "video")
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Executable Permissions
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Executable Permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: file
|
state: file
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_editing_video }}"
|
loop: "{{ flatpaks_editing_video }}"
|
||||||
@@ -198,15 +212,13 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_editing_video }}"
|
loop: "{{ flatpaks_editing_video }}"
|
||||||
ignore_errors: yes
|
|
||||||
when: not editing in (true, "video")
|
when: not editing in (true, "video")
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Remove Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Video Editors | Remove Executables
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_editing_video }}"
|
loop: "{{ flatpaks_editing_video }}"
|
||||||
ignore_errors: yes
|
|
||||||
when: not editing in (true, "video")
|
when: not editing in (true, "video")
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio Editors | Installs
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio Editors | Installs
|
||||||
@@ -215,26 +227,27 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ flatpaks_editing_audio }}"
|
loop: "{{ flatpaks_editing_audio }}"
|
||||||
ignore_errors: yes
|
|
||||||
when: editing in (true, "audio")
|
when: editing in (true, "audio")
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executables
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
block: |
|
block: |
|
||||||
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
||||||
marker: '{mark}'
|
marker: '{mark}'
|
||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_editing_audio }}"
|
loop: "{{ flatpaks_editing_audio }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: editing in (true, "audio")
|
when: editing in (true, "audio")
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executable Permissions
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Executable Permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: file
|
state: file
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_editing_audio }}"
|
loop: "{{ flatpaks_editing_audio }}"
|
||||||
@@ -246,15 +259,13 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_editing_audio }}"
|
loop: "{{ flatpaks_editing_audio }}"
|
||||||
ignore_errors: yes
|
|
||||||
when: not editing in (true, "audio")
|
when: not editing in (true, "audio")
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Remove Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Audio/Video Editors | Remove Executables
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_editing_audio }}"
|
loop: "{{ flatpaks_editing_audio }}"
|
||||||
ignore_errors: yes
|
|
||||||
when: not editing in (true, "audio")
|
when: not editing in (true, "audio")
|
||||||
|
|
||||||
# Gaming #
|
# Gaming #
|
||||||
@@ -265,30 +276,31 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ flatpaks_gaming }}"
|
loop: "{{ flatpaks_gaming }}"
|
||||||
ignore_errors: yes
|
when: gaming
|
||||||
when: gaming == true
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Executables
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
block: |
|
block: |
|
||||||
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
{{ item.extra }} {{ flatpak_exec }} {{ item.app }}
|
||||||
marker: '{mark}'
|
marker: '{mark}'
|
||||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||||
marker_end: "exit 0"
|
marker_end: "exit 0"
|
||||||
state: present
|
state: present
|
||||||
create: yes
|
create: true
|
||||||
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_gaming }}"
|
loop: "{{ flatpaks_gaming }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: gaming == true
|
when: gaming
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Executable Permissions
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Executable Permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: file
|
state: file
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop: "{{ flatpaks_gaming }}"
|
loop: "{{ flatpaks_gaming }}"
|
||||||
when: gaming == true
|
when: gaming
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Uninstalls
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Uninstalls
|
||||||
flatpak:
|
flatpak:
|
||||||
@@ -296,16 +308,14 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_gaming }}"
|
loop: "{{ flatpaks_gaming }}"
|
||||||
ignore_errors: yes
|
when: not gaming
|
||||||
when: not gaming == true
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Remove Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Gaming | Remove Executables
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_gaming }}"
|
loop: "{{ flatpaks_gaming }}"
|
||||||
ignore_errors: yes
|
when: not gaming
|
||||||
when: not gaming == true
|
|
||||||
|
|
||||||
# Removals #
|
# Removals #
|
||||||
|
|
||||||
@@ -315,11 +325,9 @@
|
|||||||
remote: flathub
|
remote: flathub
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_remove }}"
|
loop: "{{ flatpaks_remove }}"
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Flatpak Distro | Flatpak | Uninstalls | Remove Executables
|
- name: Workstation | Linux | Flatpak Distro | Flatpak | Uninstalls | Remove Executables
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flatpak_exec_dir }}/{{ item.name }}"
|
path: "{{ flatpak_exec_dir }}/{{ item.name }}{{ flatpak_extension }}"
|
||||||
state: absent
|
state: absent
|
||||||
loop: "{{ flatpaks_remove }}"
|
loop: "{{ flatpaks_remove }}"
|
||||||
ignore_errors: yes
|
|
||||||
@@ -3,175 +3,196 @@
|
|||||||
|
|
||||||
## Facts ##
|
## Facts ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Facts [1/4]
|
- name: Workstation | Linux | Software | Flutter | Facts 1
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flutter_url: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.27.2-stable.tar.xz"
|
flutter_url: "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.47.4-stable.tar.xz"
|
||||||
flutter_download_file: "{{ user_user.home }}/Downloads/flutter.tar.xz"
|
flutter_download_file: "{{ user_user.home }}/Downloads/flutter.tar.xz"
|
||||||
flutter_sdk_location: "{{ user_user.home }}/SDKs/Flutter"
|
flutter_sdk_location: "{{ user_user.home }}/SDKs/Flutter"
|
||||||
flutter_report: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.sdk.flutter.txt"
|
flutter_report: "{{ user_user.home }}/Reports/{{ ansible_hostname }}.sdk.flutter.txt"
|
||||||
when: coding == true
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Facts [2/4]
|
- name: Workstation | Linux | Software | Flutter | Facts 2
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flutter_bin_location: "{{ flutter_sdk_location }}/flutter/bin"
|
flutter_bin_location: "{{ flutter_sdk_location }}/flutter/bin"
|
||||||
when: coding == true
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Facts [3/4]
|
- name: Workstation | Linux | Software | Flutter | Facts 3
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flutter: "{{ flutter_bin_location }}/flutter"
|
flutter: "{{ flutter_bin_location }}/flutter"
|
||||||
when: coding == true
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Facts [3/3]
|
- name: Workstation | Linux | Software | Flutter | Facts 4
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
flutter_report_commands:
|
flutter_report_commands:
|
||||||
- "date > {{ flutter_report }}"
|
- "date > {{ flutter_report }}"
|
||||||
- "{{ flutter }} --disable-analytics >> {{ flutter_report }}"
|
- "{{ flutter }} --disable-analytics >> {{ flutter_report }}"
|
||||||
- "date >> {{ flutter_report }}"
|
- "date >> {{ flutter_report }}"
|
||||||
- "{{ flutter }} doctor -v >> {{ flutter_report }}"
|
- "{{ flutter }} doctor -v >> {{ flutter_report }}"
|
||||||
- "date >> {{ flutter_report }}"
|
- "date >> {{ flutter_report }}"
|
||||||
when: coding == true
|
|
||||||
|
|
||||||
## Checks ##
|
## Checks ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Check SDK Exists
|
- name: Workstation | Linux | Software | Flutter | Check SDK Exists
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ flutter_sdk_location }}"
|
path: "{{ flutter_sdk_location }}"
|
||||||
get_attributes: false
|
get_attributes: false
|
||||||
get_checksum: false
|
get_checksum: false
|
||||||
get_mime: false
|
get_mime: false
|
||||||
register: flutter_sdk_stat
|
register: flutter_sdk_stat
|
||||||
when: coding == true
|
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Check Download Exists
|
- name: Workstation | Linux | Software | Flutter | Check Download Exists
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ flutter_download_file }}"
|
path: "{{ flutter_download_file }}"
|
||||||
get_attributes: false
|
get_attributes: false
|
||||||
get_checksum: false
|
get_checksum: false
|
||||||
get_mime: false
|
get_mime: false
|
||||||
register: flutter_download_stat
|
register: flutter_download_stat
|
||||||
when: coding == true
|
|
||||||
|
|
||||||
## Packages ##
|
## Packages ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Necessities
|
- name: Workstation | Linux | Software | Flutter | Necessities
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- curl
|
- curl
|
||||||
- git
|
- git
|
||||||
- unzip
|
- unzip
|
||||||
- xz-utils
|
- "{{ xz }}"
|
||||||
- zip
|
- zip
|
||||||
- libglu1-mesa
|
- "{{ mesa }}"
|
||||||
|
- "{{ mesa_utils }}"
|
||||||
state: present
|
state: present
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
# https://docs.flutter.dev/get-started/install/linux/desktop
|
# https://docs.flutter.dev/get-started/install/linux/desktop
|
||||||
- name: Workstation | Linux | Software | Flutter | Linux App Dependencies
|
- name: Workstation | Linux | Software | Flutter | Linux App Dependencies
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- clang
|
- clang
|
||||||
- cmake
|
- cmake
|
||||||
- git
|
- git
|
||||||
- ninja-build
|
- "{{ ninja }}"
|
||||||
- pkg-config
|
- pkg-config
|
||||||
- libgtk-3-dev
|
- "{{ gtk3 }}"
|
||||||
- liblzma-dev
|
- "{{ xz_libs }}"
|
||||||
- libstdc++-12-dev
|
- "{{ cpp }}"
|
||||||
state: present
|
state: present
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
# https://docs.flutter.dev/get-started/install/linux/android
|
# https://docs.flutter.dev/get-started/install/linux/android
|
||||||
- name: Workstation | Linux | Software | Flutter | Android App Dependencies
|
- name: Workstation | Linux | Software | Flutter | Android App Dependencies
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- libc6:amd64
|
- "{{ c_libs }}"
|
||||||
- libstdc++6
|
- "{{ cpp_libs }}"
|
||||||
- lib32z1
|
- "{{ z_libs }}"
|
||||||
- libbz2-1.0
|
- "{{ bzip }}"
|
||||||
state: present
|
state: present
|
||||||
when: coding == true
|
when: coding
|
||||||
|
|
||||||
## Install SDK ##
|
## Install SDK ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | SDK
|
- name: Workstation | Linux | Software | Flutter | SDK
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Download SDK
|
- name: Workstation | Linux | Software | Flutter | Download SDK
|
||||||
get_url:
|
ansible.builtin.get_url:
|
||||||
url: "{{ flutter_url }}"
|
url: "{{ flutter_url }}"
|
||||||
dest: "{{ flutter_download_file }}"
|
dest: "{{ flutter_download_file }}"
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
group: "{{ user }}"
|
group: "{{ user }}"
|
||||||
mode: '0664'
|
mode: '0664'
|
||||||
when: not flutter_download_stat.stat.exists
|
when: not flutter_download_stat.stat.exists
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Create Folder
|
- name: Workstation | Linux | Software | Flutter | Create Folder
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flutter_sdk_location }}"
|
path: "{{ flutter_sdk_location }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
group: "{{ user }}"
|
group: "{{ user }}"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Extract SDK
|
- name: Workstation | Linux | Software | Flutter | Extract SDK
|
||||||
unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: "{{ flutter_download_file }}"
|
src: "{{ flutter_download_file }}"
|
||||||
dest: "{{ flutter_sdk_location }}"
|
dest: "{{ flutter_sdk_location }}"
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
group: "{{ user }}"
|
group: "{{ user }}"
|
||||||
|
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true and not flutter_sdk_stat.stat.exists
|
when: coding
|
||||||
|
and not flutter_sdk_stat.stat.exists
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Delete Archive
|
- name: Workstation | Linux | Software | Flutter | Delete Archive
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flutter_download_file }}"
|
path: "{{ flutter_download_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
when: coding
|
||||||
|
|
||||||
## Configure Environment ##
|
## Configure Environment ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Modify PATH (.bashrc)
|
- name: Workstation | Linux | Software | Flutter | Modify PATH (.bashrc)
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}/.bashrc"
|
path: "{{ item }}/.bashrc"
|
||||||
block: |
|
block: |
|
||||||
export PATH="$PATH:{{ flutter_bin_location }}"
|
export PATH="$PATH:{{ flutter_bin_location }}"
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
|
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
|
||||||
state: present
|
state: absent
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_root.home }}"
|
- "{{ user_root.home }}"
|
||||||
- "{{ user_user.home }}"
|
- "{{ user_user.home }}"
|
||||||
ignore_errors: yes
|
when: coding
|
||||||
when: coding == true and user_root.home != "" and user_user.home != ""
|
and user_root.home != ""
|
||||||
|
and user_user.home != ""
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Modify PATH (.zshrc)
|
- name: Workstation | Linux | Software | Flutter | Modify PATH (.zshrc)
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}/.zshrc"
|
path: "{{ item }}/.zshrc"
|
||||||
block: |
|
block: |
|
||||||
export PATH="$PATH:{{ flutter_bin_location }}"
|
export PATH="$PATH:{{ flutter_bin_location }}"
|
||||||
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
|
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
|
||||||
state: present
|
state: absent
|
||||||
create: yes
|
create: true
|
||||||
backup: yes
|
backup: true
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_root.home }}"
|
- "{{ user_root.home }}"
|
||||||
- "{{ user_user.home }}"
|
- "{{ user_user.home }}"
|
||||||
ignore_errors: yes
|
when: coding
|
||||||
when: coding == true and user_root.home != "" and user_user.home != ""
|
and user_root.home != ""
|
||||||
|
and user_user.home != ""
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Flutter | Modify PATH (profiles)
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
|
block: |
|
||||||
|
export PATH="$PATH:{{ flutter_bin_location }}"
|
||||||
|
marker: '# {mark} MANAGED BY ANSIBLE | Flutter'
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- ".bash_profile"
|
||||||
|
- ".zprofile"
|
||||||
|
when: coding
|
||||||
|
and user_user.home != ""
|
||||||
|
|
||||||
## Test SDK ##
|
## Test SDK ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Doctor Report
|
- name: Workstation | Linux | Software | Flutter | Doctor Report
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop: "{{ flutter_report_commands }}"
|
loop: "{{ flutter_report_commands }}"
|
||||||
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
when: coding == true
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: coding
|
||||||
|
|
||||||
## Uninstall SDK ##
|
## Uninstall SDK ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Flutter | Remove SDK
|
- name: Workstation | Linux | Software | Flutter | Remove SDK
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ flutter_sdk_location }}"
|
path: "{{ flutter_sdk_location }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: not coding == true
|
when: not coding
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
# Some Linux distros come with meh DE's, this fixes that.
|
# Some Linux distros come with meh DE's, this fixes that.
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | GNOME | Check (Parrot OS Only)
|
- name: Workstation | Linux | Software | GNOME | Check (Parrot OS Only)
|
||||||
shell: which gdm3
|
ansible.builtin.shell: which gdm3
|
||||||
register: gnome_install
|
register: gnome_install
|
||||||
when: ansible_distribution in ("Parrot OS")
|
when: ansible_distribution in ("Parrot OS")
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | GNOME | Install
|
- name: Workstation | Linux | Software | GNOME | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- gnome
|
- gnome
|
||||||
- gdm3
|
- gdm3
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
when: gnome_install is defined and gnome_install.failed is defined and gnome_install.failed
|
when: gnome_install is defined and gnome_install.failed is defined and gnome_install.failed
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | GNOME | Note Before Exiting
|
- name: Workstation | Linux | Software | GNOME | Note Before Exiting
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "You will need to run `dpkg-reconfigure gdm3` to ensure gdm3 is selected."
|
msg: "You will need to run `dpkg-reconfigure gdm3` to ensure gdm3 is selected."
|
||||||
when: gnome_install is defined and gnome_install.failed is defined and gnome_install.failed
|
when: gnome_install is defined and gnome_install.failed is defined and gnome_install.failed
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | GNOME | Exiting
|
- name: Workstation | Linux | Software | GNOME | Exiting
|
||||||
shell: exit 1
|
ansible.builtin.shell: exit 1
|
||||||
when: gnome_install is defined and gnome_install.failed is defined and gnome_install.failed
|
when: gnome_install is defined and gnome_install.failed is defined and gnome_install.failed
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
---
|
||||||
|
# 2026-09-11 Hyperling
|
||||||
|
# Move all Hugo development needs to a specific place.
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo | pacman
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo | pacman | Facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
sass_old: ruby-sass
|
||||||
|
sass_current: dart-sass
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo | pacman | Remove Old
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "{{ sass_old }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo | pacman | Install New
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "{{ sass_current }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|
||||||
|
# This must exist after nodejs.yml so that NPM is installed.
|
||||||
|
- name: Workstation | Linux | Software | Hugo | npm
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo | npm | Facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
sass_old: node-sass
|
||||||
|
sass_current: sass
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo | npm | Gather
|
||||||
|
ansible.builtin.shell: npm prefix -g
|
||||||
|
register: npm_bin_dir # Provides /usr/local/ on Devuan, /usr/ on Artix.
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo | npm | Remove Old
|
||||||
|
ansible.builtin.shell: "npm remove -g {{ sass_old }}"
|
||||||
|
args:
|
||||||
|
creates: "{{ npm_bin_dir.stdout }}/bin/sass"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Hugo | npm | Install New
|
||||||
|
ansible.builtin.shell: "npm install -g {{ sass_current }}"
|
||||||
|
args:
|
||||||
|
creates: "{{ npm_bin_dir.stdout }}/bin/sass"
|
||||||
|
|
||||||
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
|
when: coding is true
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
# 20260912 - Hyperling
|
||||||
|
# Arch has too new of Java for Android / Gradle to even run AGP Assistant on.
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Java | pacman
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Java | pacman | Facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
jdk_version: 21
|
||||||
|
jdk_dir: ~/SDKs/Java
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Java | pacman | Install
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "jdk{{ item }}-openjdk"
|
||||||
|
state: present
|
||||||
|
loop:
|
||||||
|
- "{{ jdk_version }}"
|
||||||
|
- 25
|
||||||
|
- 21
|
||||||
|
- 17
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Java | pacman | Set
|
||||||
|
ansible.builtin.shell: "archlinux-java set java-{{ jdk_version }}-openjdk"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Java | pacman | Link
|
||||||
|
ansible.builtin.shell: "ln -sf /usr/lib/jvm {{ jdk_dir }}"
|
||||||
|
args:
|
||||||
|
creates: "{{ jdk_dir }}"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
|
||||||
|
when: coding is true
|
||||||
|
and ansible_pkg_mgr == "pacman"
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -2,10 +2,21 @@
|
|||||||
# Lutris for running Windows games not in Steam.
|
# Lutris for running Windows games not in Steam.
|
||||||
# https://lutris.net/downloads
|
# https://lutris.net/downloads
|
||||||
|
|
||||||
|
## Starcraft 2 ##
|
||||||
|
# 2026-05-06: #
|
||||||
|
# Using "System (10.0 (Debian 10.0-repack-6))" works, not Proton.
|
||||||
|
# - Fails to actually open SC2, but Battle.net worss great, lol.
|
||||||
|
# does not get to login, pop-up freezes
|
||||||
|
# - wine 8
|
||||||
|
# - proton hotfix
|
||||||
|
# - proton exp
|
||||||
|
# - proton GE stabele / default
|
||||||
|
# - proton 9 (beta)
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Lutris | Facts
|
- name: Workstation | Linux | Software | Lutris | Facts
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
lutris_source_list: "/etc/apt/sources.list.d/lutris.list"
|
lutris_source_list: "/etc/apt/sources.list.d/lutris.list"
|
||||||
lutris_keyfile: "/usr/share/keyrings/lutris.gpg"
|
lutris_keyfile: "/usr/share/keyrings/lutris.gpg"
|
||||||
when: ansible_pkg_mgr == "apt"
|
when: ansible_pkg_mgr == "apt"
|
||||||
@@ -13,7 +24,7 @@
|
|||||||
# Checks
|
# Checks
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Lutris | Check PPA
|
- name: Workstation | Linux | Software | Lutris | Check PPA
|
||||||
stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ lutris_source_list }}"
|
path: "{{ lutris_source_list }}"
|
||||||
get_attributes: false
|
get_attributes: false
|
||||||
get_checksum: false
|
get_checksum: false
|
||||||
@@ -26,54 +37,54 @@
|
|||||||
- name: Workstation | Linux | Software | Lutris | Add PPA (Ubuntu)
|
- name: Workstation | Linux | Software | Lutris | Add PPA (Ubuntu)
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: ppa:lutris-team/lutris
|
repo: ppa:lutris-team/lutris
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution in ("Ubuntu") and gaming == true
|
when: ansible_distribution in ("Ubuntu") and gaming
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Lutris | Add PPA (Debian)
|
- name: Workstation | Linux | Software | Lutris | Add PPA (Debian)
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "wget -q -O- https://download.opensuse.org/repositories/home:/strycore/Debian_12/Release.key \
|
- "wget -q -O- https://download.opensuse.org/repositories/home:/strycore/Debian_13/Release.key \
|
||||||
| gpg --dearmor \
|
| gpg --dearmor \
|
||||||
| sudo tee {{ lutris_keyfile }} > /dev/null"
|
| sudo tee {{ lutris_keyfile }} > /dev/null"
|
||||||
- "echo 'deb [signed-by={{ lutris_keyfile }}] https://download.opensuse.org/repositories/home:/strycore/Debian_12/ ./' \
|
- "echo 'deb [signed-by={{ lutris_keyfile }}] https://download.opensuse.org/repositories/home:/strycore/Debian_13/ ./' \
|
||||||
| sudo tee {{ lutris_source_list }} > /dev/null"
|
| sudo tee {{ lutris_source_list }} > /dev/null"
|
||||||
- "sudo apt update"
|
- "sudo apt update"
|
||||||
when: ansible_distribution in ("Debian") and gaming == true and not lutris_source_exists.stat.exists
|
when: ansible_distribution in ("Debian") and gaming and not lutris_source_exists.stat.exists
|
||||||
|
|
||||||
## Install Package ##
|
## Install Package ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Lutris | Install (besides ARM)
|
- name: Workstation | Linux | Software | Lutris | Install (besides ARM)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- lutris
|
- lutris
|
||||||
state: present
|
state: present
|
||||||
when: ansible_architecture != "aarch64" and gaming == true
|
when: ansible_architecture != "aarch64" and gaming
|
||||||
|
|
||||||
## Uninstall Package ##
|
## Uninstall Package ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Lutris | Uninstall (besides ARM)
|
- name: Workstation | Linux | Software | Lutris | Uninstall (besides ARM)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- lutris
|
- lutris
|
||||||
state: absent
|
state: absent
|
||||||
when: ansible_architecture != "aarch64" and gaming != true
|
when: ansible_architecture != "aarch64" and not gaming
|
||||||
|
|
||||||
## Uninstall Repo ##
|
## Uninstall Repo ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Lutris | Remove PPA (Ubuntu)
|
- name: Workstation | Linux | Software | Lutris | Remove PPA (Ubuntu)
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: ppa:lutris-team/lutris
|
repo: ppa:lutris-team/lutris
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
state: absent
|
state: absent
|
||||||
when: ansible_distribution in ("Ubuntu") and gaming != true
|
when: ansible_distribution in ("Ubuntu") and not gaming
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Lutris | Remove PPA (Debian)
|
- name: Workstation | Linux | Software | Lutris | Remove PPA (Debian)
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "mv {{ lutris_source_list }} ~/TRASH/"
|
- "mv {{ lutris_source_list }} ~/TRASH/"
|
||||||
- "mv {{ lutris_keyfile }} ~/TRASH/"
|
- "mv {{ lutris_keyfile }} ~/TRASH/"
|
||||||
- "sudo apt update"
|
- "sudo apt update"
|
||||||
when: ansible_distribution in ("Debian") and gaming != true and lutris_source_exists.stat.exists
|
when: ansible_distribution in ("Debian") and not gaming and lutris_source_exists.stat.exists
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
# 20260716 - Hyperling
|
||||||
|
# Giving this DE a shot but not liking it as much as others.
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | LXQt | Facts | Defaults
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
lxqt_package: lxqt
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | LXQt | Facts | Debian Derivitives
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
lxqt_package: task-lxqt-desktop
|
||||||
|
when: ansible_distribution in ("Debian", "Devuan")
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | LXQt | Install
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "{{ lxqt_package }}"
|
||||||
|
- "{{ sddm }}"
|
||||||
|
state: present
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
---
|
||||||
|
# 20260730 - Hyperling
|
||||||
|
# Install much more recent Node versions.
|
||||||
|
|
||||||
|
# https://linuxcapable.com/how-to-install-node-js-on-debian-linux/
|
||||||
|
|
||||||
|
- name: Workstation | Software | NodeJS
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Software | NodeJS | apt
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Software | NodeJS | apt | Facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
node_version: node_24.x
|
||||||
|
|
||||||
|
- name: Workstation | Software | NodeJS | apt | Old | Remove
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: npm
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Workstation | Software | NodeJS | apt | extrepo | Install
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: extrepo
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Workstation | Software | NodeJS | apt | extrepo | Enable
|
||||||
|
ansible.builtin.shell: "extrepo enable {{ node_version }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
|
- name: Workstation | Software | NodeJS | apt | Install
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: nodejs
|
||||||
|
state: present
|
||||||
|
|
||||||
|
when: ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
|
- name: Workstation | Software | NodeJS | All Others | Install
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- nodejs
|
||||||
|
- npm
|
||||||
|
state: present
|
||||||
|
when: ansible_pkg_mgr != "apt"
|
||||||
|
|
||||||
|
when: coding
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
# Needed for dnf packages such as vlc.
|
# Needed for dnf packages such as vlc.
|
||||||
# https://docs.fedoraproject.org/en-US/quick-docs/rpmfusion-setup/
|
# https://docs.fedoraproject.org/en-US/quick-docs/rpmfusion-setup/
|
||||||
- name: Workstation | Linux | Software | Packages | Fedora Fusion Repos
|
- name: Workstation | Linux | Software | Packages | Fedora Fusion Repos
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- "dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm"
|
- "dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm"
|
||||||
- "dnf config-manager --enable rpmfusion-free"
|
- "dnf config-manager --enable rpmfusion-free"
|
||||||
@@ -14,15 +14,17 @@
|
|||||||
- "dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
|
- "dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
|
||||||
- "dnf config-manager --enable rpmfusion-nonfree"
|
- "dnf config-manager --enable rpmfusion-nonfree"
|
||||||
- "dnf config-manager --enable rpmfusion-nonfree-updates"
|
- "dnf config-manager --enable rpmfusion-nonfree-updates"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
when: ansible_distribution == "Fedora"
|
when: ansible_distribution == "Fedora"
|
||||||
|
|
||||||
|
|
||||||
## Packages ##
|
## Packages ##
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Packages | Install Software (Editing)
|
- name: Workstation | Linux | Software | Packages | Install Software (Editing)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- "{{ ffmpeg }}"
|
- "{{ ffmpeg }}"
|
||||||
state: present
|
state: present
|
||||||
when: editing in (true, "video", "audio")
|
when: editing in (true, "video", "audio")
|
||||||
|
|
||||||
@@ -32,37 +34,100 @@
|
|||||||
# Software not yet available or working properly in Flatpak form.
|
# Software not yet available or working properly in Flatpak form.
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Packages | Install From Repo
|
- name: Workstation | Linux | Software | Packages | Install From Repo
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- vlc
|
- "{{ vlc }}"
|
||||||
- "{{ appimagelauncher }}"
|
- "{{ vlc_plugins }}"
|
||||||
- "{{ evolution }}"
|
|
||||||
- "{{ evolution }}*"
|
|
||||||
- gparted
|
- gparted
|
||||||
- hugo
|
- "{{ firefox }}"
|
||||||
|
- "{{ firefox_esr }}"
|
||||||
|
- "{{ wireless_tools }}"
|
||||||
|
- "{{ notify_send }}"
|
||||||
|
- "{{ fyi }}"
|
||||||
|
- "{{ gnome_boxes }}"
|
||||||
|
- "{{ rhythmbox }}"
|
||||||
|
- "{{ blueman }}"
|
||||||
|
- "{{ mpv }}"
|
||||||
|
- "{{ transmission_gtk }}"
|
||||||
|
- "{{ transmission_qt }}"
|
||||||
|
- "{{ libreoffice }}"
|
||||||
|
- "{{ strawberry }}"
|
||||||
|
- "{{ dict_en }}"
|
||||||
|
- "{{ dict_es }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Packages | GS Connect (KDE Connect, Android Tool)
|
- name: Workstation | Linux | Software | Packages | Install From Repo [Coding]
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- gnome-shell-extension-gsconnect
|
- "{{ appimagelauncher }}"
|
||||||
|
- hugo
|
||||||
|
- ansible-lint
|
||||||
|
state: present
|
||||||
|
when: coding
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Packages | Install From Repo [Editing]
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- gimp
|
||||||
|
state: present
|
||||||
|
when: editing
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Packages | Install Audio (Looking at you, Artix)
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- pipewire
|
||||||
|
- pipewire-pulse
|
||||||
|
- wireplumber
|
||||||
|
- pipewire-alsa
|
||||||
|
state: present
|
||||||
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
and ansible_service_mgr == "runit"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Packages | Extra For Liberated Init Systems
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "{{ dunst }}"
|
||||||
|
state: present
|
||||||
|
when: ansible_service_mgr != "systemd"
|
||||||
|
|
||||||
|
# TBD/TODO: Change the below AUR tasks to echo EXISTS, INSTALLED, or FAILED
|
||||||
|
# and then catch it, similar to what's done in android.yml and others.
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Packages | Install From AUR
|
||||||
|
ansible.builtin.shell: "yay -Qs {{ item }} || yay --noconfirm -S {{ item }}"
|
||||||
|
loop:
|
||||||
|
- appimagelauncher
|
||||||
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
become: true
|
||||||
|
become_user: "{{ aur_user }}"
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Packages | Install From AUR [Coding]
|
||||||
|
ansible.builtin.shell: "yay -Qs {{ item }} || yay --noconfirm -S {{ item }}"
|
||||||
|
loop:
|
||||||
|
- vscodium-bin
|
||||||
|
- android-studio
|
||||||
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
and coding
|
||||||
|
become: true
|
||||||
|
become_user: "{{ aur_user }}"
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | Packages | GS Connect (KDE Connect, Android Tool)
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- gnome-shell-extension-gsconnect
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution in ("Debian")
|
when: ansible_distribution in ("Debian")
|
||||||
ignore_errors: yes
|
|
||||||
|
|
||||||
# Remove Repo Software #
|
# Remove Repo Software #
|
||||||
|
|
||||||
- name: Workstation | Linux | Software | Packages | Remove Applications
|
- name: Workstation | Linux | Software | Packages | Remove Applications
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- "{{ firefox }}"
|
- "{{ thunderbird }}"
|
||||||
- "{{ firefox_esr }}"
|
- "{{ evolution }}"
|
||||||
- "{{ thunderbird }}"
|
- steam
|
||||||
- steam
|
- code
|
||||||
- vscode
|
|
||||||
- code
|
|
||||||
- libreoffice
|
|
||||||
- "*libreoffice*"
|
|
||||||
- '*libreoffice*'
|
|
||||||
- gimp
|
|
||||||
state: absent
|
state: absent
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
---
|
||||||
|
# 20260716 - Hyperling
|
||||||
|
# Attempt to save battery life by having a daemon tune the CPU and disable
|
||||||
|
# unneeded components like USB, Bluetooth, WiFi, etc when not in use.
|
||||||
|
|
||||||
|
## Variables ##
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | Facts
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
tlp_package: "tlp"
|
||||||
|
tlp_rdw: "tlp-rdw"
|
||||||
|
tlp_smart: "smartmontools"
|
||||||
|
tlp_config: "/etc/tlp.conf"
|
||||||
|
tlp_service: "tlp"
|
||||||
|
tlp_run_script: "tlp"
|
||||||
|
ppd_package: "power-profiles-daemon"
|
||||||
|
ppd_service: "power-profiles-daemon"
|
||||||
|
acf_package: "auto-cpufreq"
|
||||||
|
acf_service: "auto-cpufreq"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | Facts (Artix)
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
ppd_package: "power-profiles-daemon power-profiles-daemon-runit"
|
||||||
|
tlp_run_script: tlp-runit
|
||||||
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
and ansible_service_mgr == "runit"
|
||||||
|
|
||||||
|
## Conflicts ##
|
||||||
|
|
||||||
|
#- name: Workstation | Linux | Software | TLP | Conflicts | Disable
|
||||||
|
# ansible.builtin.service:
|
||||||
|
# name: "{{ item }}"
|
||||||
|
# state: stopped
|
||||||
|
# enabled: false
|
||||||
|
# loop:
|
||||||
|
# - "{{ ppd_service }}"
|
||||||
|
# - "{{ acf_service }}"
|
||||||
|
# ignore_errors: true
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | Conflicts | Remove
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "{{ ppd_package }}"
|
||||||
|
- "{{ acf_package }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
## Install TLP + Associated Software ##
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | Install
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- "{{ tlp_package }}"
|
||||||
|
- "{{ tlp_rdw }}"
|
||||||
|
- "{{ tlp_smart }}"
|
||||||
|
- "{{ tlp_run_script }}"
|
||||||
|
|
||||||
|
## Configuration ##
|
||||||
|
|
||||||
|
# Device choices:
|
||||||
|
# - bluetooth
|
||||||
|
# - nfc
|
||||||
|
# - wifi
|
||||||
|
# - wwan
|
||||||
|
|
||||||
|
# Bluetooth and WiFi are not always used so disable on boot.
|
||||||
|
# NFC and WWAN (cellular) are never used so always disable.
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | Config
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: "{{ tlp_config }}"
|
||||||
|
regexp: '{{ item.key }}'
|
||||||
|
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: true
|
||||||
|
loop:
|
||||||
|
- { "key": '^[\#]?TLP_ENABLE', "value": 'TLP_ENABLE=1'}
|
||||||
|
- { "key": '^[\#]?TLP_DEFAULT_MODE', "value": 'TLP_DEFAULT_MODE=SAV'}
|
||||||
|
## Device Controls ##
|
||||||
|
- { "key": '^[\#]?DEVICES_TO_DISABLE_ON_STARTUP', "value": 'DEVICES_TO_DISABLE_ON_STARTUP="bluetooth nfc wwan"'}
|
||||||
|
# Ensure these stay commented, once the device is booted the user is in control. #
|
||||||
|
- { "key": '^[\#]?DEVICES_TO_ENABLE_ON_STARTUP', "value": '#DEVICES_TO_ENABLE_ON_STARTUP=""'}
|
||||||
|
- { "key": '^[\#]?DEVICES_TO_ENABLE_ON_AC', "value": '#DEVICES_TO_ENABLE_ON_AC=""'}
|
||||||
|
- { "key": '^[\#]?DEVICES_TO_DISABLE_ON_BAT', "value": '#DEVICES_TO_DISABLE_ON_BAT=""'}
|
||||||
|
# Help preserve battery life by not fully charging. #
|
||||||
|
- { "key": '^[\#]?START_CHARGE_THRESH_BAT0', "value": 'START_CHARGE_THRESH_BAT0={{ "60" if battery else "90" }}'}
|
||||||
|
- { "key": '^[\#]?STOP_CHARGE_THRESH_BAT0', "value": 'STOP_CHARGE_THRESH_BAT0={{ "80" if battery else "95" }}'}
|
||||||
|
- { "key": '^[\#]?START_CHARGE_THRESH_BAT1', "value": 'START_CHARGE_THRESH_BAT1={{ "60" if battery else "90" }}'}
|
||||||
|
- { "key": '^[\#]?STOP_CHARGE_THRESH_BAT1', "value": 'STOP_CHARGE_THRESH_BAT1={{ "80" if battery else "95" }}'}
|
||||||
|
# Do not let the WiFi device go DORMANT.
|
||||||
|
- { "key": '^[\#]?WIFI_PWR_ON_AC', "value": 'WIFI_PWR_ON_AC=off'}
|
||||||
|
- { "key": '^[\#]?WIFI_PWR_ON_BAT', "value": 'WIFI_PWR_ON_BAT=off'}
|
||||||
|
# Do not let USB devices go dormant.
|
||||||
|
- { "key": '^[\#]?USB_AUTOSUSPEND', "value": 'USB_AUTOSUSPEND=0'}
|
||||||
|
|
||||||
|
|
||||||
|
## Enable + Start ##
|
||||||
|
|
||||||
|
# Ensure the service is running and will run after reboot.
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | Enable + Start
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: "{{ tlp_service }}"
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
when: ansible_service_mgr not in ("runit")
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | runit | Devuan Block
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | runit | Devuan | Facts 01
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
devuan_tlp_dir: "{{ runit_script_dir }}/{{ tlp_service }}"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | runit | Devuan | Facts 02
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
devuan_tlp_run: "{{ devuan_tlp_dir }}/{{ runit_service_script }}"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | runit | Devuan | Create Script
|
||||||
|
ansible.builtin.shell: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- "mkdir -pv {{ devuan_tlp_dir }}"
|
||||||
|
- "echo '#!/bin/sh' > {{ devuan_tlp_run }}"
|
||||||
|
- "echo 'exec /usr/sbin/{{ tlp_service }} start' >> {{ devuan_tlp_run }}"
|
||||||
|
- "chmod +x {{ devuan_tlp_run }}"
|
||||||
|
|
||||||
|
when: ansible_service_mgr == "runit"
|
||||||
|
and ansible_pkg_mgr == "apt"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | runit | Enable + Start
|
||||||
|
command: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- "ln -sf {{ runit_script_dir }}/{{ tlp_service }} {{ runit_service_dir }}/{{ tlp_service }}"
|
||||||
|
#- "sv start {{ tlp_service }}" # Not necessary and sometimes gives a false negative.
|
||||||
|
when: ansible_service_mgr == "runit"
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | TLP | runit | Functions & Aliases
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ item }}"
|
||||||
|
block: |
|
||||||
|
function tlp-devices {
|
||||||
|
if [[ ! -z "$@" ]]; then
|
||||||
|
tlp-devices
|
||||||
|
echo -e "\n Applying '$@'...\n"
|
||||||
|
fi
|
||||||
|
wifi $@
|
||||||
|
bluetooth $@
|
||||||
|
nfc $@
|
||||||
|
wwan $@
|
||||||
|
}
|
||||||
|
alias devices="tlp-devices "
|
||||||
|
|
||||||
|
function devices-off {
|
||||||
|
echo -e "\n Checking Mullvad Status...\n"
|
||||||
|
mullvad status
|
||||||
|
|
||||||
|
echo -e "\n Checking Hardware Status...\n"
|
||||||
|
tlp-devices off
|
||||||
|
|
||||||
|
echo -e "\n Disconnecting Mullvad...\n"
|
||||||
|
mullvad disconnect
|
||||||
|
sleep 3
|
||||||
|
mullvad status
|
||||||
|
}
|
||||||
|
alias off="devices-off "
|
||||||
|
|
||||||
|
function devices-on {
|
||||||
|
echo -e "\n Checking Mullvad Status...\n"
|
||||||
|
mullvad status
|
||||||
|
|
||||||
|
echo -e "\n Checking Hardware Status...\n"
|
||||||
|
tlp-devices on
|
||||||
|
|
||||||
|
echo -e "\n Connecting Mullvad...\n"
|
||||||
|
mullvad connect
|
||||||
|
mullvad reconnect
|
||||||
|
sleep 3
|
||||||
|
mullvad status
|
||||||
|
|
||||||
|
echo -e "\n Rehecking Mullvad Status...\n"
|
||||||
|
sleep 12
|
||||||
|
mullvad status
|
||||||
|
}
|
||||||
|
alias on="devices-on "
|
||||||
|
marker: '# {mark} MANAGED BY ANSIBLE | tlp'
|
||||||
|
state: present
|
||||||
|
create: true
|
||||||
|
backup: false
|
||||||
|
loop:
|
||||||
|
- "{{ user_user.home }}/.bashrc"
|
||||||
|
- "{{ user_user.home }}/.zshrc"
|
||||||
|
- "{{ user_root.home }}/.bashrc"
|
||||||
|
- "{{ user_root.home }}/.zshrc"
|
||||||
Loaded 100 of 115 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user