playbook to configure dotfiles

This commit is contained in:
Ibrahim Mkusa 2024-09-04 22:56:43 -04:00
parent 3878a8695c
commit f42e0a614e
2 changed files with 52 additions and 3 deletions

View File

@ -1,12 +1,15 @@
# dotfiles
Quick configs i can't live without on my machines.
`./install.sh `
```./install.sh ```
installs everything to your system
`./install.sh undo`
```./install.sh undo```
removes only the configs from your home directory
`./install.sh wipe`
```./install.sh wipe```
removes both the configs and packages installed
if you find yourself in a machine that has ansible pre-installed you could use
it too to install
```ansible-playbook localhost install.yml -ask-become-pass```

46
install.yml Normal file
View File

@ -0,0 +1,46 @@
---
- name: installs and setups dotfiles and packages
hosts: localhost
tasks:
- name: test loops
debug:
msg: "{{ ansible_os_family }}"
- name: install packages on a debian host
apt:
name: "{{ item }}"
state: latest
loop:
- vim-nox
- git
- stow
- curl
- ranger
- tmux
when: ansible_os_family == "Debian"
become: yes
- name: install packages on redhat host
dnf:
name:
- vim-enhanced
- git
- stow
- curl
- ranger
- tmux
state: latest
when: ansible_os_family == "RedHat"
become: yes
- name: link the dotfiles to users home directory
command:
cmd: stow "{{ item }}"
loop:
- bash
- git
- ranger
- shellenv
- tmux
- vim