From ee3e324680a15d59429b1a2a0615fe787d169068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Mon, 12 Dec 2022 21:59:58 +0100 Subject: feat(roles/_workstation): add dotfiles role --- roles/_workstation/dotfiles/tasks/main.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 roles/_workstation/dotfiles/tasks/main.yml (limited to 'roles/_workstation/dotfiles/tasks/main.yml') diff --git a/roles/_workstation/dotfiles/tasks/main.yml b/roles/_workstation/dotfiles/tasks/main.yml new file mode 100644 index 0000000..4b11e3c --- /dev/null +++ b/roles/_workstation/dotfiles/tasks/main.yml @@ -0,0 +1,27 @@ +--- + +- name: install yadm + ansible.builtin.package: + name: yadm + state: present + +- name: clone repository + ansible.builtin.shell: yes n | yadm clone "{{ dotfiles_repo_url }}" + register: dotfiles_clone_result + changed_when: + - dotfiles_clone_result.rc != 0 + - "'Git repo already exists' not in dotfiles_clone_result.stderr" + failed_when: + - dotfiles_clone_result.rc != 0 + - "'Git repo already exists' not in dotfiles_clone_result.stderr" + +- name: check that yadm bootstrap script exists + ansible.builtin.stat: + path: "/home/{{ dotfiles_workstation_user }}/.config/yadm/bootstrap" + register: dotfiles_bootstrap_result + +- name: execute yadm bootstrap + ansible.builtin.command: yadm bootstrap + when: + - dotfiles_bootstrap_result.stat.exists + - dotfiles_bootstrap_result.stat.executable -- cgit v1.2.3