FIX: sshd template

FIX: sshd template

  • sshd template users were unable to rebuild
  • the replace command was trying to modify a file from the package before it was installed
diff --git a/templates/sshd.template.yml b/templates/sshd.template.yml
index b5f3c8f..605a11d 100644
--- a/templates/sshd.template.yml
+++ b/templates/sshd.template.yml
@@ -9,12 +9,6 @@ env:
 
 run:
 
-  - replace:
-      filename: /etc/pam.d/sshd
-      from: "session    required     pam_loginuid.so"
-      to: ""
-
-
   - file:
      path: /etc/service/sshd/run
      chmod: "+x"
@@ -39,6 +33,12 @@ run:
         - echo "$ssh_key" >> /root/.ssh/authorized_keys
         - echo "$$ENV_SSH_PUB_KEY" >> /root/.ssh/authorized_keys
         - chmod 640 /root/.ssh/authorized_keys
+
+  - replace:
+      filename: /etc/pam.d/sshd
+      from: "session    required     pam_loginuid.so"
+      to: ""
+
   - file:
      path: /etc/update-motd.d/00-discourse
      chmod: +x

GitHub sha: e46fe350

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/website-down-after-new-upgrade-from-command-line/149953/5