-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoolbox.yml
49 lines (44 loc) · 1.16 KB
/
toolbox.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
# THIS SCRIPT IS INTENDED TO BE RAN INSIDE A TOOLBOX CONTAINER
- hosts: localhost
connection: local
ignore_unreachable: true
become: true
vars_files:
- packages.yml
pre_tasks:
- name: create projects folder (if not exist)
file:
path: ~/projects
state: directory
- name: create ssh directory (if not exist)
file:
path: ~/.ssh
state: directory
tasks:
- name: clone .dotfile
git:
repo: "https://github.com/LegitCamper/.dotfiles.git"
dest: ~/projects/.dotfiles
clone: yes
update: no
- name: stow dotfiles
shell: stow -t ~ --adopt -S dots
check_mode: false
changed_when: false
failed_when: false
- name: copy and decrypt keys (if needed)
with_items:
- src: ./dots/ssh_key
dest: ~/.ssh/id_ed25519
- src: ./dots/ssh_key.pub
dest: ~/.ssh/id_ed25519.pub
loop_control:
loop_var: ssh_file
copy:
src: "{{ ssh_file.src }}"
dest: "{{ ssh_file.dest }}"
decrypt: yes
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
mode: 0600