40 lines
942 B
YAML
40 lines
942 B
YAML
# tasks/main.yml
|
|
|
|
- name: Ensure dependencies are installed
|
|
ansible.builtin.package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
loop:
|
|
- git
|
|
- python3
|
|
- python3-pip
|
|
|
|
- name: Ensure the dotfiles clone directory exists
|
|
ansible.builtin.file:
|
|
path: "{{ dotfiles_clone_dir }}"
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Clone dotfiles repository
|
|
ansible.builtin.git:
|
|
repo: "{{ dotfiles_repo_url }}"
|
|
dest: "{{ dotfiles_clone_dir }}"
|
|
version: master
|
|
force: yes
|
|
|
|
- name: Ensure Dotbot is executable
|
|
ansible.builtin.file:
|
|
path: "{{ dotfiles_clone_dir }}/install"
|
|
mode: '0755'
|
|
|
|
- name: Run Dotbot to bootstrap dotfiles
|
|
ansible.builtin.command:
|
|
cmd: "{{ dotbot_command }}"
|
|
chdir: "{{ dotfiles_clone_dir }}"
|
|
register: dotbot_output
|
|
changed_when: "'Everything is up to date!' not in dotbot_output.stdout"
|
|
|
|
- name: Print Dotbot output
|
|
ansible.builtin.debug:
|
|
var: dotbot_output.stdout
|