aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--maintenance.yml1
-rw-r--r--roles/dotfiles/defaults/main.yml1
-rw-r--r--roles/dotfiles/tasks/main.yml29
3 files changed, 31 insertions, 0 deletions
diff --git a/maintenance.yml b/maintenance.yml
index b3d4121..d6e4040 100644
--- a/maintenance.yml
+++ b/maintenance.yml
@@ -2,6 +2,7 @@
hosts: all
roles:
- common
+ - dotfiles
- {role: snap, when: has_snap}
- {role: apt, when: has_apt}
- {role: pacman, when: has_pacman}
diff --git a/roles/dotfiles/defaults/main.yml b/roles/dotfiles/defaults/main.yml
new file mode 100644
index 0000000..0ce4769
--- /dev/null
+++ b/roles/dotfiles/defaults/main.yml
@@ -0,0 +1 @@
+dotfiles_user: egor
diff --git a/roles/dotfiles/tasks/main.yml b/roles/dotfiles/tasks/main.yml
new file mode 100644
index 0000000..c4b6fef
--- /dev/null
+++ b/roles/dotfiles/tasks/main.yml
@@ -0,0 +1,29 @@
+- name: ssh-agent hack
+ acl:
+ name: "{{ item }}"
+ etype: user
+ entity: "{{ dotfiles_user }}"
+ permissions: rwx
+ state: present
+ loop:
+ - "{{ ansible_env.SSH_AUTH_SOCK | dirname }}"
+ - "{{ ansible_env.SSH_AUTH_SOCK }}"
+
+- name: Update my dotfiles
+ become: true
+ become_user: "{{ dotfiles_user }}"
+ block:
+ - name: Pull repositories
+ git:
+ accept_hostkey: true
+ dest: "~/workspace/personal/{{ item }}"
+ repo: "git@github.com:egor-tensin/{{ item }}.git"
+ loop:
+ - linux-home
+ - config-links
+
+ - name: Run links-update
+ shell: |
+ ../config-links/links-update && ../config-links/links-chmod go-w
+ args:
+ chdir: ~/workspace/personal/linux-home