aboutsummaryrefslogtreecommitdiffstats
path: root/roles/_workstation/dotfiles.yml
blob: d3e78553974d101e86dcd134bd07c6a83158cab2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---

- 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.