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
|
- mattermost-desktop
|
||||||
- wireguard-tools
|
- wireguard-tools
|
||||||
#additional_aur_packages:
|
#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"
|
- ".gitconfig"
|
||||||
- ".gtkrc-2.0"
|
- ".gtkrc-2.0"
|
||||||
- ".local"
|
- ".local"
|
||||||
- ".ssh"
|
|
||||||
- ".themes"
|
- ".themes"
|
||||||
- "scripts"
|
- "scripts"
|
||||||
tags: config
|
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)
|
- name: Copy new files and directories (root)
|
||||||
ansible.posix.synchronize:
|
ansible.posix.synchronize:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
|
@ -217,18 +217,6 @@
|
|||||||
tags: packages
|
tags: packages
|
||||||
become: true
|
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
|
- name: Host | Install host specific packages
|
||||||
community.general.pacman:
|
community.general.pacman:
|
||||||
state: present
|
state: present
|
||||||
|
12
setup.yml
12
setup.yml
@ -1,5 +1,17 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- 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:
|
roles:
|
||||||
# install packages
|
# install packages
|
||||||
- role: packages
|
- role: packages
|
||||||
|
Loading…
Reference in New Issue
Block a user