fix: don't fill .ssh/known_hosts with copies of the same key

This commit is contained in:
Emmanuel BENOîT 2024-12-29 20:55:05 +01:00
parent 37beeb781f
commit 6cfbdaf9b3
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg

View file

@ -466,8 +466,7 @@
check_mode: true check_mode: true
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /home/vagrant/.ssh/known_hosts path: /home/vagrant/.ssh/known_hosts
line: "^{{ chezmoi_source | urlsplit( 'hostname' ) }} " regexp: "^{{ chezmoi_source | urlsplit( 'hostname' ) }} "
regex: true
state: absent state: absent
register: ssh_key_present register: ssh_key_present
- name: Add SSH key for chezmoi's Git repo - name: Add SSH key for chezmoi's Git repo