summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-01-19 20:03:40 +0100
committermakefu <github@syntax-fehler.de>2016-01-19 20:03:40 +0100
commit40c077570d47776abd86694c9a0966cc9849909d (patch)
treefff6b0689dc4d187f07fa334bd4e226b034f947d
parenta3ea7268d8aa44aa15f5c9c3b99aec77ba362f89 (diff)
build-stuff/* -> init-stockholm
-rw-r--r--README2
-rw-r--r--init-stockholm/host.py (renamed from build-stuff/build-host.py)14
2 files changed, 8 insertions, 8 deletions
diff --git a/README b/README
index 6b2515a..8a930ef 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
# Build-Stuff
-Init stuff for stockholm, see `build-stuff/build-host.py --help` for usage.
+Init stuff for stockholm, see `init-stockholm/host.py --help` for usage.
# TODO
diff --git a/build-stuff/build-host.py b/init-stockholm/host.py
index 40fbc20..8740f33 100644
--- a/build-stuff/build-host.py
+++ b/init-stockholm/host.py
@@ -1,5 +1,5 @@
#!/bin/sh
-""" usage: build-host [options] HOSTNAME
+""" usage: init-host [options] HOSTNAME
Options:
--secrets-dir DIR Path to secrets [Default: ~/secrets/]
@@ -35,7 +35,9 @@ def retiolum_ip(hostname):
def write_stockholm_1systems(ret,stockholm_dir):
""" writes new nix file in stockholm/$LOGNAME/1systems/${HOSTNAME}.nix if
it not yet exists"""
- p=path_join(stockholm_dir, ret['username'],'1systems',ret['hostname'])
+ p=path_join(stockholm_dir,
+ ret['username'],'1systems',
+ "{}.nix".format(ret['hostname']))
if exists (p):
log.warn(" {} already exists, will not override with minimal config".format(p))
else:
@@ -53,8 +55,7 @@ def write_stockholm_1systems(ret,stockholm_dir):
fileSystems."/" = {{
device = "/dev/sda1";
}};
-}}
- """.format(**ret))
+}}""".format(**ret))
def print_stockholm_krebs_entry(ret):
@@ -71,11 +72,10 @@ def print_stockholm_krebs_entry(ret):
"{hostname}.retiolum"
];
tinc.pubkey = ''
-{pubkey}''
+{pubkey}'';
}};
}};
-}};
- """.format(**ret))
+}};""".format(**ret))
def create_zhosts_file(ret,path):
""" creates a new tinc hosts file in path