Migrate documentation
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 24 May 2019 11:33:32 +0000 (13:33 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 27 May 2019 22:40:06 +0000 (00:40 +0200)
docs/migrate_hetzner.md [new file with mode: 0644]

diff --git a/docs/migrate_hetzner.md b/docs/migrate_hetzner.md
new file mode 100644 (file)
index 0000000..c7fbe20
--- /dev/null
@@ -0,0 +1,20 @@
+nixops show a deprecation message at each deployment because hetzner
+info is outdated. To fix it:
+
+    cp -a ~/.nixops ~/.nixops.bak
+
+    nixops export --all > all.json
+
+    network=$(cat all.json| jq -r '."cef694f3-081d-11e9-b31f-0242ec186adf".resources.eldiron."hetzner.networkInfo"' | jq -r -c '.networking.interfaces.eth0 = { "ipv4": { "addresses": [ { "address": .networking.interfaces.eth0.ipAddress, "prefixLength": .networking.interfaces.eth0.prefixLength } ] } }')
+
+    cat all.json | jq --arg network "$network" '."cef694f3-081d-11e9-b31f-0242ec186adf".resources.eldiron."hetzner.networkInfo" = $network' > all_new.json
+
+    nixops delete --force -d eldiron
+
+    nixops import < all_new.json
+
+    rm all.json all_new.json
+
+*check that everything works*, then:
+
+    rm -rf ~/.nixops.bak