1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

move pylib.yml to own role

This commit is contained in:
Jerry Vonau 2020-04-27 16:34:32 -05:00
parent 31ddfd8f39
commit 6acb9b5acd
6 changed files with 4 additions and 2 deletions

View file

@ -0,0 +1,27 @@
#!/usr/bin/python3
# read iiab.env from python
def get_iiab_env(name):
""" read iiab.env file for a value, return "" if does not exist"""
try:
fd = open("{{ iiab_env_file }}","r")
for line in fd:
line = line.lstrip()
line = line.rstrip('\n')
if len(line) == 0:
continue
if line[0] == "#":
continue
if line.find("=") == -1:
continue
chunks = line.split('=')
if chunks[0] == name:
return chunks[1]
return("")
except:
return("")
finally:
fd.close()
if __name__ == "__main__":
print(get_iiab_env("WWWROOT"))