feat: replace ansible templating with makejinja (#1156)

This commit is contained in:
Devin Buhl authored and GitHub committed 2024-01-14 23:03:02 -05:00
1 parent a4731906d9
commit f9481d6202
114 files changed
+555 -906

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import netaddr, bcrypt
def nthhost(value: str, query: int) -> str:
value = netaddr.IPNetwork(value)
try:
nth = int(query)
if value.size > nth:
return str(value[nth])
except ValueError:
return False
return value
def encrypt(value: str) -> str:
return bcrypt.hashpw(value.encode(), bcrypt.gensalt(rounds=10)).decode("ascii")
class Loader:
def filters(self):
return [nthhost, encrypt]