Преглед на файлове

Make possible to checkout dotfiles from external git repository

Emmanuel Bouthenot преди 10 години
родител
ревизия
c74abca726
променени са 3 файла, в които са добавени 12 реда и са изтрити 0 реда
  1. 4 0
      roles/common/defaults/main.yml
  2. 7 0
      roles/common/tasks/dotfiles.yml
  3. 1 0
      roles/common/tasks/main.yml

+ 4 - 0
roles/common/defaults/main.yml

@@ -43,4 +43,8 @@ with_ovh: False
 
 sysfs_disk_settings: False
 
+with_dotfiles: False
+dotfiles_repo: git://forge.openics.org/server-dotfiles-zsh.git
+dotfiles_dest: /srv/hosting-tools/shell
+
 # vim: ft=yaml

+ 7 - 0
roles/common/tasks/dotfiles.yml

@@ -0,0 +1,7 @@
+- name: Install dotfiles
+  git: repo={{ dotfiles_repo }} dest={{ dotfiles_dest }} recursive=yes accept_hostkey=yes
+  when: with_dotfiles
+
+- name: Enable sourcing of dotfiles
+  lineinfile: dest=/etc/zsh/zshrc regexp='source .* {{ dotfiles_dest }}' line='[[ -f {{ dotfiles_dest }}/zsh/zshrc ]] && source {{ dotfiles_dest }}/zsh/zshrc'
+  when: with_dotfiles

+ 1 - 0
roles/common/tasks/main.yml

@@ -1,4 +1,5 @@
 - include: base.yml
+- include: dotfiles.yml
 - include: dns.yml
 - include: firewall.yml
 - include: ovh.yml