From c58dcd70150d63e01dfe01adbb38244598e6a881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 24 May 2019 13:33:32 +0200 Subject: Migrate documentation --- docs/migrate_hetzner.md | 20 ++++++++++++++++++++ nixops/migrate_hetzner.md | 20 -------------------- 2 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 docs/migrate_hetzner.md delete mode 100644 nixops/migrate_hetzner.md diff --git a/docs/migrate_hetzner.md b/docs/migrate_hetzner.md new file mode 100644 index 0000000..c7fbe20 --- /dev/null +++ b/docs/migrate_hetzner.md @@ -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 diff --git a/nixops/migrate_hetzner.md b/nixops/migrate_hetzner.md deleted file mode 100644 index c7fbe20..0000000 --- a/nixops/migrate_hetzner.md +++ /dev/null @@ -1,20 +0,0 @@ -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 -- cgit v1.2.3