-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.yml
24 lines (21 loc) · 879 Bytes
/
site.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
---
- name: Gathering information on your stuff
hosts: local
tasks:
# This seems to work with Ansible 1.3--the relative directory
# of localhost is the directory in which the playbook resides.
- name: only on LOCAL find files
shell: cd {{dotfiles_src}} && find . -type f | grep -v .git
register: local_files
- name: only LOCAL find dirs
shell: cd {{dotfiles_src}} && find . -type d | grep -v .git
register: local_dirs
- name: Syncing your dotfiles
hosts: managed
tasks:
- name: make the dotfiles directories
file: path={{ dotfiles_dest }}/{{ item }} state=directory
with_items: hostvars[groups['local'][0]].local_dirs.stdout_lines
- name: copy dotfiles
template: src={{dotfiles_src}}/{{ item }} dest={{dotfiles_dest}}/{{ item }}
with_items: hostvars[groups['local'][0]].local_files.stdout_lines