From 8a93fb3768797fa19a02c485a2d34d0b78f58557 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 16 Apr 2019 18:32:06 +0200 Subject: [PATCH] litle fix --- defaults/main.yml | 4 +++- tasks/main.yml | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 35a75d3..c751bd2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,4 +2,6 @@ # defaults file for user_config user: - name: vincent \ No newline at end of file + name: vincent + +user_config_repo: ssh://git@pi2/vincent/conf2.git \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 3126526..2907371 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,12 +3,17 @@ - name: clone user repository git: dest: /home/{{user.name}}/conf2 # required. The path of where the repository should be checked out. This parameter is required, unless C(clone) is set to C(no). - repo: ssh://git@pi2/vincent/conf2.git # required. git, SSH, or HTTP(S) protocol address of the git repository. + repo: "{{ user_config_repo }}" # required. git, SSH, or HTTP(S) protocol address of the git repository. clone: yes # not required. If C(no), do not clone the repository if it does not exist locally recursive: yes force: no - update: no + update: yes accept_hostkey: yes + register: config_download + + +- debug: + msg: "{{ config_download }}" - name: pass user shell to zsh user: @@ -21,5 +26,11 @@ shell: stow * args: chdir: /home/{{user.name}}/conf2 - creates: "/home/{{user.name}}/.zshrc.d/alias" # not required. a filename, when it already exists, this step will B(not) be run. + when: config_download.changed == true +- name: apply stow config on root + shell: stow --t /root zsh vim git + args: + chdir: /home/{{user.name}}/conf2 + when: config_download.changed == true + become: yes \ No newline at end of file