rig to pull public dotfiles

Wed, 14 Jun 2017 22:07:16 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 14 Jun 2017 22:07:16 -0400
changeset 54
2a04e6d7bfcc
parent 53
4cac9ded1fb8
child 55
76686ae96f48

rig to pull public dotfiles

group_vars/all.yml file | annotate | diff | comparison | revisions
roles/user/tasks/main.yml file | annotate | diff | comparison | revisions
--- a/group_vars/all.yml
+++ b/group_vars/all.yml
@@ -5,7 +5,8 @@ user:
 
 gui_session: "i3"
 
-dotfiles_repository: ssh://mhoward@roomag.org/proj/dotfiles
+dotfiles_default: https://bitbucket.org/merrilymeredith/dotfiles
+dotfiles_default_push: ssh://mhoward@roomag.org/proj/dotfiles
 
 hostkeys:
   roomag.org:
--- a/roles/user/tasks/main.yml
+++ b/roles/user/tasks/main.yml
@@ -22,7 +22,7 @@
 - name: Clone dotfiles
   become: "{{user.name}}"
   shell: >
-    hg clone -U {{dotfiles_repository | quote}} _dotfiles_
+    hg clone -U {{dotfiles_default | quote}} _dotfiles_
     && mv _dotfiles_/.hg .
     && rmdir _dotfiles_
     && hg -R ~ update -C master
@@ -30,6 +30,19 @@
     chdir: "~"
     creates: "~/.hg"
 
+- name: Assert hg sources
+  become: "{{user.name}}"
+  ini_file:
+    dest: "~/.hg/hgrc"
+    section: paths
+    option: "{{item.name}}"
+    value:  "{{item.url}}"
+    mode: 0640
+    create: no
+  with_items:
+    - {name: 'default',      url: "{{dotfiles_default}}"}
+    - {name: 'default-push', url: "{{dotfiles_default_push}}"}
+
 - name: Update dotfiles
   become: "{{user.name}}"
   command: hg pull -u

mercurial