Skip to content

Commit

Permalink
ansible: remove old github.com ssh key from known_hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlau committed Mar 25, 2023
1 parent 82c3c1f commit 3c0bb37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions ansible/roles/jenkins-worker/files/github_bad_hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
9 changes: 9 additions & 0 deletions ansible/roles/jenkins-worker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
become_user: "{{ server_user }}"
loop: "{{ lookup('file', 'files/github_known_hosts').splitlines() }}"

- name: remove old github.com ssh keys
ansible.builtin.lineinfile:
path: "{{ home }}/{{ server_user }}/.ssh/known_hosts"
search_string: "{{ item }}"
state: absent
become: yes
become_user: "{{ server_user }}"
loop: "{{ lookup('file', 'files/github_bad_hosts').splitlines() }}"

- name: run raspberry pi jenkins-worker setup
when: "inventory_hostname|regex_search('-arm(v6l|v7l|64)_pi')"
include: "{{ role_path }}/tasks/partials/raspberry-pi.yml"
Expand Down

0 comments on commit 3c0bb37

Please sign in to comment.