Feat: init refact with test
This commit is contained in:
14
roles/dotfiles/tasks/arch.yml
Normal file
14
roles/dotfiles/tasks/arch.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Install stow
|
||||
community.general.pacman:
|
||||
name: stow
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: true
|
||||
|
||||
- name: Install git
|
||||
community.general.pacman:
|
||||
name: git
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: true
|
||||
14
roles/dotfiles/tasks/debian.yml
Normal file
14
roles/dotfiles/tasks/debian.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
- name: Install stow
|
||||
apt:
|
||||
name: stow
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: true
|
||||
|
||||
- name: Install git
|
||||
apt:
|
||||
name: git
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: true
|
||||
20
roles/dotfiles/tasks/main.yml
Normal file
20
roles/dotfiles/tasks/main.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- 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: Clone dotfiles
|
||||
ansible.builtin.git:
|
||||
repo: 'https://git.opytex.org/lafrite/dotfiles.git'
|
||||
dest: /home/{{ item.username }}/.dotfiles
|
||||
with_items: "{{ dotusers }}"
|
||||
|
||||
- name: stow configs
|
||||
ansible.builtin.command:
|
||||
cmd: stow {{ item }}
|
||||
chdir: ~/.dotfiles/
|
||||
with_items: "{{ config2stow }}"
|
||||
Reference in New Issue
Block a user