Use templating for ssh to provide different paths
This commit is contained in:
parent
16b6e9f045
commit
0defa4022e
@ -3,3 +3,5 @@ additional_pacman_packages:
|
||||
- mattermost-desktop
|
||||
- wireguard-tools
|
||||
#additional_aur_packages:
|
||||
|
||||
ssh_key_git: "{{ ansible_user_dir }}/.ssh/id_ed25519"
|
||||
|
2
roles/config/defaults/main.yml
Normal file
2
roles/config/defaults/main.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
ssh_key_git: "{{ ansible_user_dir }}/.ssh/id_ed25519_git"
|
@ -45,11 +45,18 @@
|
||||
- ".gitconfig"
|
||||
- ".gtkrc-2.0"
|
||||
- ".local"
|
||||
- ".ssh"
|
||||
- ".themes"
|
||||
- "scripts"
|
||||
tags: config
|
||||
|
||||
- name: Copy new templated files
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}"
|
||||
dest: "~/"
|
||||
loop:
|
||||
- ".ssh/config.j2"
|
||||
tags: config
|
||||
|
||||
- name: Copy new files and directories (root)
|
||||
ansible.posix.synchronize:
|
||||
src: "{{ item }}"
|
||||
|
@ -217,18 +217,6 @@
|
||||
tags: packages
|
||||
become: true
|
||||
|
||||
- name: Host | Check if host variables exist
|
||||
ansible.builtin.stat:
|
||||
path: "host_vars/{{ ansible_hostname }}.yml"
|
||||
register: host_file
|
||||
tags: packages
|
||||
|
||||
- name: Host | Get host specific variables
|
||||
include_vars:
|
||||
file: "host_vars/{{ ansible_hostname }}.yml"
|
||||
when: host_file.stat.exists
|
||||
tags: packages
|
||||
|
||||
- name: Host | Install host specific packages
|
||||
community.general.pacman:
|
||||
state: present
|
||||
|
12
setup.yml
12
setup.yml
@ -1,5 +1,17 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
pre_tasks:
|
||||
- name: Host | Check if host variables exist
|
||||
ansible.builtin.stat:
|
||||
path: "host_vars/{{ ansible_hostname }}.yml"
|
||||
register: host_file
|
||||
tags: always
|
||||
|
||||
- name: Host | Get host specific variables
|
||||
include_vars:
|
||||
file: "host_vars/{{ ansible_hostname }}.yml"
|
||||
when: host_file.stat.exists
|
||||
tags: always
|
||||
roles:
|
||||
# install packages
|
||||
- role: packages
|
||||
|
Loading…
Reference in New Issue
Block a user