Skip to content

Commit

Permalink
WIP: TODO: Make it run on debian
Browse files Browse the repository at this point in the history
  • Loading branch information
claha committed Aug 30, 2023
1 parent 0e760ab commit 8cc726d
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 42 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on: # yamllint disable-line rule:truthy
pull_request:

jobs:
bootstrap:
bootstrap_archlinux:
runs-on: ubuntu-latest
container:
image: archlinux:latest
Expand All @@ -21,3 +21,19 @@ jobs:
passwd --delete ansible
echo 'ansible ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
sudo --user ansible ./bootstrap.sh
bootstrap_ubuntu:
runs-on: ubuntu-latest
container:
image: ubuntu:latest
options: --privileged
steps:
- uses: actions/[email protected]
- run: |
apt update
apt upgrade --yes
apt install --yes python3 python3-venv python-is-python3 sudo
useradd ansible --create-home
passwd --delete ansible
echo 'ansible ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
sudo --user ansible ./bootstrap.sh
6 changes: 6 additions & 0 deletions main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
become: true
community.general.pacman:
update_cache: true
when: ansible_facts.os_family == "Archlinux"
- name: Update list of available packages
become: true
ansible.builtin.apt:
update_cache: true
when: ansible_facts.os_family == "Debian"

roles:
- role: bash
Expand Down
1 change: 1 addition & 0 deletions roles/alacritty/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
ansible.builtin.package:
name: "{{ alacritty_packages }}"
state: latest
when: ansible_facts.os_family == "Archlinux"

- name: Link config files
ansible.builtin.include_role:
Expand Down
38 changes: 26 additions & 12 deletions roles/bash/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
---
bash_packages:
- bash
- exa
- fzf
- jq
- just
- pass
- starship
- the_silver_searcher
- tldr
- unzip
- vim
- xclip
Archlinux:
- bash
- exa
- fzf
- jq
- just
- pass
- starship
- the_silver_searcher
- tldr
- unzip
- vim
- xclip
Debian:
- bash
- exa
- fzf
- jq
# - just
- pass
# - starship
- silversearcher-ag
- tldr
- unzip
- vim
- xclip
bash_config_files:
- ~/.bashrc
- ~/.config/starship.toml
2 changes: 1 addition & 1 deletion roles/bash/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Install package
become: true
ansible.builtin.package:
name: "{{ bash_packages }}"
name: "{{ bash_packages[ansible_facts.os_family] }}"
state: latest

- name: Link config files
Expand Down
1 change: 1 addition & 0 deletions roles/bitwarden/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
ansible.builtin.package:
name: "{{ bitwarden_packages }}"
state: latest
when: ansible_facts.os_family == "Archlinux"
16 changes: 11 additions & 5 deletions roles/bluetooth/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---
bluetooth_packages:
- alsa-utils
- bluez
- bluez-utils
- pulseaudio
- pulseaudio-bluetooth
Archlinux:
- alsa-utils
- bluez
- bluez-utils
- pulseaudio
- pulseaudio-bluetooth
Debian:
- alsa-utils
- bluez
- pulseaudio
- pulseaudio-module-bluetooth
bluetooth_services:
- bluetooth
2 changes: 1 addition & 1 deletion roles/bluetooth/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Install package
become: true
ansible.builtin.package:
name: "{{ bluetooth_packages }}"
name: "{{ bluetooth_packages[ansible_facts.os_family] }}"
state: latest

- name: Enable and start service
Expand Down
1 change: 1 addition & 0 deletions roles/font/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
ansible.builtin.package:
name: "{{ font_packages }}"
state: latest
when: ansible_facts.os_family == "Archlinux"
1 change: 1 addition & 0 deletions roles/git/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
name: aur_package
vars:
aur_package_names: "{{ git_packages_aur }}"
when: ansible_facts.os_family == "Archlinux"

- name: Link config files
ansible.builtin.include_role:
Expand Down
29 changes: 20 additions & 9 deletions roles/i3/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
---
i3_packages:
- i3-wm
- i3status-rust
- dunst
- feh
- picom
- unclutter
- xautolock
- xbindkeys
- xorg
Archlinux:
- i3-wm
- i3status-rust
- dunst
- feh
- picom
- unclutter
- xautolock
- xbindkeys
- xorg
Debian:
- i3-wm
# - i3status-rust
- dunst
- feh
- picom
- unclutter
- xautolock
- xbindkeys
- xorg
i3_packages_aur:
- i3lock-color
i3_config_files:
Expand Down
3 changes: 2 additions & 1 deletion roles/i3/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
- name: Install package
become: true
ansible.builtin.package:
name: "{{ i3_packages }}"
name: "{{ i3_packages[ansible_facts.os_family] }}"
state: latest

- name: Install aur package
ansible.builtin.include_role:
name: aur_package
vars:
aur_package_names: "{{ i3_packages_aur }}"
when: ansible_facts.os_family == "Archlinux"

- name: Link config files
ansible.builtin.include_role:
Expand Down
8 changes: 6 additions & 2 deletions roles/lightdm/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
lightdm_packages:
- lightdm
- lightdm-slick-greeter
Archlinux:
- lightdm
- lightdm-slick-greeter
Debian:
- lightdm
- slick-greeter
lightdm_services:
- lightdm
lightdm_config_dir: /etc/lightdm
3 changes: 2 additions & 1 deletion roles/lightdm/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Install package
become: true
ansible.builtin.package:
name: "{{ lightdm_packages }}"
name: "{{ lightdm_packages[ansible_facts.os_family] }}"
state: latest

- name: Use lightdm slick greeter
Expand All @@ -11,6 +11,7 @@
path: "{{ lightdm_config_dir }}/lightdm.conf"
regexp: "^[#]?greeter-session="
line: "greeter-session=lightdm-slick-greeter"
when: ansible_facts.os_family == "Archlinux"

- name: Create slick greeter config
become: true
Expand Down
12 changes: 9 additions & 3 deletions roles/python/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
python_packages:
- python
- python-pip
- python-pipx
Archlinux:
- python
- python-pip
- python-pipx
Debian:
- python3
- python3-pip
- python-is-python3
- pipx
python_pipx_packages:
- ansible
- black
Expand Down
2 changes: 1 addition & 1 deletion roles/python/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Install package
become: true
ansible.builtin.package:
name: "{{ python_packages }}"
name: "{{ python_packages[ansible_facts.os_family] }}"
state: latest

- name: Install python package (pipx)
Expand Down
8 changes: 6 additions & 2 deletions roles/rofi/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
---
rofi_packages:
- rofi
- rofi-pass
Archlinux:
- rofi
- rofi-pass
Debian:
- rofi
# - rofi-pass
rofi_packages_aur:
- pinentry-rofi
- rofi-bluetooth-git
Expand Down
3 changes: 2 additions & 1 deletion roles/rofi/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
- name: Install package
become: true
ansible.builtin.package:
name: "{{ rofi_packages }}"
name: "{{ rofi_packages[ansible_facts.os_family] }}"
state: latest

- name: Install aur package
ansible.builtin.include_role:
name: aur_package
vars:
aur_package_names: "{{ rofi_packages_aur }}"
when: ansible_facts.os_family == "Archlinux"

- name: Link config files
ansible.builtin.include_role:
Expand Down
6 changes: 5 additions & 1 deletion roles/ssh/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
ssh_packages:
- openssh
Archlinux:
- openssh
Debian:
- openssh-server
- openssh-client
ssh_config_dir: ~/.ssh
2 changes: 1 addition & 1 deletion roles/ssh/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: Install package
become: true
ansible.builtin.package:
name: "{{ ssh_packages }}"
name: "{{ ssh_packages[ansible_facts.os_family] }}"
state: latest

- name: Create directory
Expand Down

0 comments on commit 8cc726d

Please sign in to comment.