SSH: Add global known hosts

This commit is contained in:
Jannik Beyerstedt 2026-04-13 09:58:09 +02:00
parent 7c1d978654
commit 03c99a7b8c
6 changed files with 53 additions and 10 deletions

View file

@ -26,3 +26,7 @@
# run this for every maintenance/ update cycle
- name: Apply user settings
ansible.builtin.import_tasks: usersettings.yml
# run this for every maintenance/ update cycle
- name: Apply SSH client settings
ansible.builtin.import_tasks: sshsettings.yml

23
tasks/sshsettings.yml Normal file
View file

@ -0,0 +1,23 @@
---
# Common/SSH Setting: Universal SSH client settings
- name: Sshsettings - Add global config
become: true
tags: common_ssh
ansible.builtin.copy:
dest: /etc/ssh/ssh_config.d/global-known-hosts
mode: "0644"
owner: root
content: |
Host *
GlobalKnownHostsFile {{ ssh_client_global_known_hosts_file }}
VerifyHostKeyDNS yes
- name: Sshsettings - Add global known_hosts
become: true
tags: common_ssh
ansible.builtin.template:
src: "{{ role_path }}/templates/ssh_known_hosts.j2"
dest: "{{ ssh_client_global_known_hosts_file }}"
mode: "0644"
owner: root

View file

@ -1,5 +1,5 @@
---
# Common/Usersettings: Universial Dotfiles. Update regularly.
# Common/Usersettings: Universal Dotfiles. Update regularly.
- name: Usersettings - Install required tools
become: "{{ ansible_facts['os_family'] != 'Darwin' }}"
@ -75,10 +75,7 @@
src: "{{ role_path }}/files/_gitignore_global",
dest: "{{ ansible_facts['user_dir'] }}/.gitignore_global",
}
- {
src: "{{ role_path }}/files/_config/mpv.conf",
dest: "{{ ansible_facts['user_dir'] }}/.config/mpv/",
}
- { src: "{{ role_path }}/files/_config/mpv.conf", dest: "{{ ansible_facts['user_dir'] }}/.config/mpv/" }
- {
src: "{{ role_path }}/files/_oh-my-zsh/jtbx.zsh-theme",
dest: "{{ ansible_facts['user_dir'] }}/.oh-my-zsh/custom/themes/jtbx.zsh-theme",
@ -148,10 +145,7 @@
repo: "https://github.com/itchyny/lightline.vim",
dest: "{{ ansible_facts['user_dir'] }}/.vim/bundle/lightline",
}
- {
repo: "https://github.com/w0rp/ale",
dest: "{{ ansible_facts['user_dir'] }}/.vim/bundle/ale",
}
- { repo: "https://github.com/w0rp/ale", dest: "{{ ansible_facts['user_dir'] }}/.vim/bundle/ale" }
- {
repo: "https://github.com/airblade/vim-gitgutter",
dest: "{{ ansible_facts['user_dir'] }}/.vim/bundle/vim-gitgutter",