spacepaste

  1.  
  2. {% if salt['file.search'](user_info.home + "/.ssh/authorized_keys", "[huge key here]"): %}
  3. # Rename authorized_keys if it contains a known revoked key
  4. # This can be removed "Some time in the future"™
  5. "{{ user_info.home }}/.ssh/authorized_keys.old":
  6. file.rename:
  7. - source: "{{ user_info.home }}/.ssh/authorized_keys"
  8. {% endif %}
  9. "{{ user_info.home }}/.ssh/authorized_keys.old":
  10. file.rename:
  11. - source: "{{ user_info.home }}/.ssh/authorized_keys"
  12. - onlyif:
  13. - grep -Fq '[huge key here]' {{ user_info.home }}/.ssh/authorized_keys
  14.