Add default ssh config with include directory
This commit is contained in:
parent
ba09d4ae1a
commit
b5a6ddbc22
4 changed files with 18 additions and 1 deletions
roles/home-cli
6
roles/home-cli/files/ssh_config
Normal file
6
roles/home-cli/files/ssh_config
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Host *
|
||||||
|
AddKeysToAgent yes
|
||||||
|
ServerAliveInterval 20
|
||||||
|
UpdateHostKeys ask
|
||||||
|
|
||||||
|
Include config.d/*.config
|
|
@ -42,6 +42,11 @@
|
||||||
path: "{{ ansible_env.HOME }}/.ssh"
|
path: "{{ ansible_env.HOME }}/.ssh"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0700'
|
mode: '0700'
|
||||||
|
- name: Create $HOME/.ssh/config.d
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ ansible_env.HOME }}/.ssh/config.d"
|
||||||
|
state: directory
|
||||||
|
mode: '0700'
|
||||||
- name: Create $XDG_CONFIG_HOME/git
|
- name: Create $XDG_CONFIG_HOME/git
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ ansible_env.XDG_CONFIG_HOME }}/git"
|
path: "{{ ansible_env.XDG_CONFIG_HOME }}/git"
|
||||||
|
|
|
@ -18,4 +18,4 @@
|
||||||
- import_tasks: dirs.yml
|
- import_tasks: dirs.yml
|
||||||
- import_tasks: dotfiles.yml
|
- import_tasks: dotfiles.yml
|
||||||
- import_tasks: vim.yml
|
- import_tasks: vim.yml
|
||||||
- import_tasks: ssh-authorized-keys.yml
|
- import_tasks: ssh.yml
|
||||||
|
|
|
@ -13,6 +13,12 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
- name: Copy default ssh config
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: ssh_config
|
||||||
|
dest: "{{ ansible_env.HOME }}/.ssh/config"
|
||||||
|
mode: '0600'
|
||||||
|
backup: yes
|
||||||
- name: Add home rsa key to authorized_keys
|
- name: Add home rsa key to authorized_keys
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
|
path: "{{ ansible_env.HOME }}/.ssh/authorized_keys"
|
Loading…
Add table
Reference in a new issue