From 521cbd0c2deb3a8302c4cb18941fa310342adfaa Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Sun, 8 Jul 2018 00:51:09 -0400 Subject: [PATCH] Continue work --- main.yml | 3 ++- roles/clean/tasks/main.yml | 1 + roles/core/tasks/main.yml | 24 ------------------------ roles/default/tasks/main.yml | 24 ++++++++++++++++++++++++ roles/private/tasks/main.yml | 4 ++-- 5 files changed, 29 insertions(+), 27 deletions(-) create mode 100644 roles/default/tasks/main.yml diff --git a/main.yml b/main.yml index 20de2e9..ac76e34 100644 --- a/main.yml +++ b/main.yml @@ -8,8 +8,9 @@ private_repo: "git@austenwares.com:stonewareslord/private" overwrite_existing: no roles: + - {role: core, tags: [core,default]} - {role: clean, tags: [clean]} - - {role: core, tags: [default]} + - {role: default, tags: [default]} - {role: private, tags: [private]} - {role: youcompleteme, tags: [youcompleteme]} - {role: secure, become: yes, tags: [secure]} diff --git a/roles/clean/tasks/main.yml b/roles/clean/tasks/main.yml index 6ac68fc..9e2313b 100644 --- a/roles/clean/tasks/main.yml +++ b/roles/clean/tasks/main.yml @@ -3,6 +3,7 @@ path: "{{ install_path }}/{{ item.path }}" state: absent with_filetree: "skel/" + when: item.state == 'file' - name: Remove cloned repositories file: path: "{{ install_path }}/{{ item }}" diff --git a/roles/core/tasks/main.yml b/roles/core/tasks/main.yml index 1e55896..afa9906 100644 --- a/roles/core/tasks/main.yml +++ b/roles/core/tasks/main.yml @@ -5,27 +5,3 @@ clone: yes update: yes force: yes -- name: Create directories - file: - path: "{{ install_path }}/{{ item.path }}" - state: directory - force: "{{ overwrite_existing }}" - with_filetree: "skel/" - when: item.state == 'directory' -- name: Link files - file: - src: "{{ item.src }}" - dest: "{{ install_path }}/{{ item.path }}" - state: link - force: "{{ overwrite_existing }}" - with_filetree: "skel/" - when: item.state == 'file' -- name: Clone fzf - git: - repo: "https://gitea.austenwares.com/stonewareslord/fzf.git" - dest: "{{ install_path }}/.fzf" - clone: yes - update: yes - force: yes -- name: Install fzf - shell: "{{ install_path|quote }}/.fzf/install --bin" diff --git a/roles/default/tasks/main.yml b/roles/default/tasks/main.yml new file mode 100644 index 0000000..3e47a56 --- /dev/null +++ b/roles/default/tasks/main.yml @@ -0,0 +1,24 @@ +- name: Create directories + file: + path: "{{ install_path }}/{{ item.path }}" + state: directory + force: "{{ overwrite_existing }}" + with_filetree: "skel/" + when: item.state == 'directory' +- name: Link files + file: + src: "{{ sync_path }}/skel/{{ item.path }}" + dest: "{{ install_path }}/{{ item.path }}" + state: link + force: "{{ overwrite_existing }}" + with_filetree: "skel/" + when: item.state == 'file' +- name: Clone fzf + git: + repo: "https://gitea.austenwares.com/stonewareslord/fzf.git" + dest: "{{ install_path }}/.fzf" + clone: yes + update: yes + force: yes +- name: Install fzf + shell: "{{ install_path|quote }}/.fzf/install --bin" diff --git a/roles/private/tasks/main.yml b/roles/private/tasks/main.yml index 6ece4f0..a0a5598 100644 --- a/roles/private/tasks/main.yml +++ b/roles/private/tasks/main.yml @@ -1,7 +1,7 @@ - name: Clone private repo git: repo: "{{ private_repo }}" - dest: "{{ playbook_dir }}/private" + dest: "{{ sync_path }}/private" clone: yes update: yes - name: Create priavte directories @@ -13,7 +13,7 @@ when: item.state == 'directory' - name: Copy priavte files copy: - src: "{{ item.src }}" + src: "{{ sync_path }}/private/skel/{{ item.path }}" dest: "{{ install_path }}/{{ item.path }}" mode: 0600 force: "yes"