# HG changeset patch # User Meredith Howard # Date 1497494092 14400 # Node ID d03c346f71c250bc20c9b3038972a36865be3d59 # Parent 6172fc31a08fb94988131b73d9e812174c10ce46 simplify hostkeys diff --git a/group_vars/all.yml b/group_vars/all.yml --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -6,9 +6,3 @@ gui_session: "i3" dotfiles_default: https://bitbucket.org/merrilymeredith/dotfiles dotfiles_default_push: ssh://mhoward@roomag.org/proj/dotfiles - -hostkeys: - roomag.org: - "|1|9luVS5b1COPzsVIoHy3SZyFO7+w=|ofEQRdPBaHKq635vwgADi4+o8cM= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIlCnrGFQ7LiR4HPUv11Qp9d4vhctwqihA4+TBnYORm088OZMyC9WcqcsD5uOKrLSjireBmxEDMat0W7rKgJnpo=" - ramdas.roomag.org: - "|1|9luVS5b1COPzsVIoHy3SZyFO7+w=|ofEQRdPBaHKq635vwgADi4+o8cM= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBIlCnrGFQ7LiR4HPUv11Qp9d4vhctwqihA4+TBnYORm088OZMyC9WcqcsD5uOKrLSjireBmxEDMat0W7rKgJnpo=" diff --git a/roles/devbox/files/ssh_hosts b/roles/devbox/files/ssh_hosts new file mode 100644 --- /dev/null +++ b/roles/devbox/files/ssh_hosts @@ -0,0 +1,2 @@ +roomag.org +ramdas.roomag.org diff --git a/roles/devbox/files/ssh_known_hosts b/roles/devbox/files/ssh_known_hosts new file mode 100644 --- /dev/null +++ b/roles/devbox/files/ssh_known_hosts @@ -0,0 +1,4 @@ +|1|a6QxwLaJ1qHO7XRMHOvI1N0dEs4=|uPAhdR4hD0e0Dx5BSCaGuO7y/FE= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJfQNs49+CoRbiWO242lYWvS5XGXnVFC4oDlQecnr7MuNy1qzx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BBIlCnrGFQ7LiR4HPUv11Qp9d4vhctwqihA4+TBnYORm088OZMyC9WcqcsD5uOKrLSjireBmxEDMat0W7rKgJnpo= diff --git a/roles/devbox/tasks/main.yml b/roles/devbox/tasks/main.yml --- a/roles/devbox/tasks/main.yml +++ b/roles/devbox/tasks/main.yml @@ -3,20 +3,9 @@ - include: dist-debian.yml when: ansible_os_family == 'Debian' -- name: "ssh : Ensure known_hosts keys" - lineinfile: +- name: "ssh : Sync system ssh_known_hosts" + copy: + src: ssh_known_hosts dest: /etc/ssh/ssh_known_hosts - state: present - line: "{{item.value}}" - create: true mode: 0644 - with_dict: "{{hostkeys}}" tags: ssh - -- name: "ssh : Purge invalid known_hosts keys" - lineinfile: - dest: /etc/ssh/ssh_known_hosts - state: absent - line: "{{item.value}}" - with_dict: "{{hostkeys_removed}}" - tags: ssh