aboutsummaryrefslogtreecommitdiffstats
path: root/roles/_workstation/dotfiles.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2022-12-12 21:59:58 +0100
committerRomain Gonçalves <me@rgoncalves.se>2022-12-12 22:04:27 +0100
commitee3e324680a15d59429b1a2a0615fe787d169068 (patch)
treed385add5c412bb625e1e46f629a24267fa5acae2 /roles/_workstation/dotfiles.yml
parent7c1f7039170a25f192d87235476179f7cfe01a85 (diff)
downloadrules-ee3e324680a15d59429b1a2a0615fe787d169068.tar.gz
feat(roles/_workstation): add dotfiles role
Diffstat (limited to 'roles/_workstation/dotfiles.yml')
-rw-r--r--roles/_workstation/dotfiles.yml27
1 files changed, 27 insertions, 0 deletions
diff --git a/roles/_workstation/dotfiles.yml b/roles/_workstation/dotfiles.yml
new file mode 100644
index 0000000..90b9f44
--- /dev/null
+++ b/roles/_workstation/dotfiles.yml
@@ -0,0 +1,27 @@
+- name: install yadm
+ ansible.builtin.package:
+ name: yadm
+ state: present
+
+- name: retrieve yadm path # noqa no-changed-when command-instead-of-shell
+ ansible.builtin.shell: yes n | yadm clone "{{ workstation_dotfiles_repo }}"
+ register: workstation_dotfiles_clone_result
+ changed_when:
+ - workstation_dotfiles_clone_result.rc != 0
+ - "'Git repo already exists' not in
+ workstation_dotfiles_clone_result.stderr"
+ failed_when:
+ - workstation_dotfiles_clone_result.rc != 0
+ - "'Git repo already exists' not in
+ workstation_dotfiles_clone_result.stderr"
+
+- name: check that yadm bootstrap script exists
+ ansible.builtin.stat:
+ path: "/home/{{ workstation_user }}/.config/yadm/bootstrap"
+ register: workstation_dotfiles_bootstrap_result
+
+- name: execute yadm bootstrap
+ ansible.builtin.command: yadm bootstrap
+ when:
+ - workstation_dotfiles_bootstrap_result.stat.exists
+ - workstation_dotfiles_bootstrap_result.stat.executable
remember that computers suck.