Ansible_workstation/roles/user/tasks/dotfiles.yml

38 lines
876 B
YAML
Raw Normal View History

2022-01-12 05:06:12 +00:00
---
- name: Install for arch
import_tasks: arch.yml
when: ansible_os_family == "Archlinux"
- name: Install for debian
import_tasks: debian.yml
when: ansible_os_family == "Debian"
- name: init neovim
import_tasks: neovim.yml
when: '"nvim" in user.config.stowing'
- name: init vim
import_tasks: vim.yml
when: '"vim" in user.config.stowing'
- name: init sway
import_tasks: sway.yml
when: '"sway" in user.config.stowing'
- name: Clone dotfiles
ansible.builtin.git:
repo: "{{ user.config.giturl }}"
dest: "/home/{{ user.username }}/.dotfiles"
- name: user owns its dotfiles
ansible.builtin.file:
path: "/home/{{ user.username }}/.dotfiles"
owner: "{{ user.username }}"
- name: stow configs
ansible.builtin.command:
cmd: stow {{ item }}
chdir: "/home/{{ user.username }}/.dotfiles"
with_items: "{{ user.config.stowing }}"