Skip to content

Commit

Permalink
Add support for flatpak, neovim, xorg
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaweees committed May 15, 2024
1 parent 6670cf8 commit 533e7a6
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 43 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,25 @@ To get a local copy of the project up and running on your machine, follow these

### Installation

It is best to run this playbook remotely, as it is designed to be executed on a fresh install of Linux. To do so, run the following command:
It is best to run this playbook remotely, as it is designed to be executed on a fresh install of Linux. To do so, run the following commands:

```bash
bash < <(curl -s https://raw.githubusercontent.com/Kaweees/ansible/main/ansible-install)
```
1. Add your user to the sudoers group
```bash
# execute the following commands from root
apt install -y sudo curl
sudo usermod -aG sudo <username>
```
2. Execute the ansible-install script
```bash
bash < <(curl -s https://raw.githubusercontent.com/Kaweees/ansible/main/ansible-install)
```
3. Start and enable NetworkManager
```bash
sudo systemctl start NetworkManager #.service
sudo systemctl enable NetworkManager #.service
```

Enter your machine's password when prompted.
Enter your machine's password when prompted by Ansible.
<!-- USAGE EXAMPLES -->
## Usage
Expand Down
16 changes: 9 additions & 7 deletions ansible-install
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
#
# Title: Kaweees's Ansible Playbook
# Description: A bash script to install Kaweee's Ansible playbook and run it.
# Author: Your Name
# Description: A bash script to install Kaweees's Ansible playbook and run it.
# Author: Miguel Villa Floran

title() {
local color='\033[1;37m'
Expand All @@ -16,9 +16,11 @@ title "Greetings, $USER. Let's install Kaweees's Ansible Playbook."
sudo apt update -y && sudo apt upgrade -y
sudo apt install -y software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install -y ansible git
sudo apt install -y ansible git cowsay

# Execute Ansible playbook
ansible-pull -K -U https://github.com/Kaweees/ansible.git -t install local.yml
# Or run locally
# ansible-playbook -K local.yml -t install
# Execute Ansible playbook remotely
# ansible-pull -K -U https://github.com/Kaweees/ansible.git local.yml --ask-become-pass --tags minimal-install

# Clone and execute Ansible playbook locally
git clone https://github.com/Kaweees/ansible.git ~/Documents/GitHub/Projects/ansible --recusive && cd ~/Documents/GitHub/Projects/ansible
ansible-playbook -K local.yml --ask-become-pass --tags minimal-install
28 changes: 21 additions & 7 deletions local.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
- hosts: localhost
- name: Kaweees's Ansible Playbook
hosts: localhost
become: true

vars_files:
Expand All @@ -13,21 +14,34 @@
personal: "{{ lookup('env', 'HOME') }}/personal"

pre_tasks:
- name: Add non-free, contrib repos
become: true
replace:
path: /etc/apt/sources.list
regexp: '(non-free-firmware)$'
replace: 'contrib non-free'
tags:
- minimal-install
- install
- name: Update Apt cache
become: true
apt:
force_apt_get: true
update_cache: true
state: present
tags:
- minimal-install
- install
- core

tasks:
- include: tasks/ssh.yml
- include: tasks/core-setup.yml
- include: tasks/node-setup.yml
- include: tasks/zsh-setup.yml
- include: tasks/slack-setup.yml
- include: tasks/dotfiles.yml
- include: tasks/git-setup.yml
- include: tasks/gui-setup.yml
- include: tasks/flatpak-setup.yml
- include: tasks/discord-setup.yml
- include: tasks/neovim-setup.yml
# - include: tasks/zsh-setup.yml
# - include: tasks/dotfiles.yml
# - include: tasks/suckless-setup.yml
# - include: tasks/node-setup.yml
# - include: tasks/git-setup.yml
45 changes: 45 additions & 0 deletions tasks/core-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
- name: Install required CLI utilities
become: true
package:
name:
- ansible
- atool
- autoconf
- build-essential
- curl
- dkms # Dynamic Kernel Module Support
- ffmpeg
- firmware-misc-nonfree
- fzf
- gcc
- git
- libtool
- lm-sensors
- make
- man
- network-manager # nmtui
- network-manager-gnome # nm-connection-editor
- nvidia-driver
- ripgrep
- stow
- sudo
- tree
- unzip
- wget
tags:
- minimal-install
- install
- core

- name: Install additional CLI utilities
become: true
package:
name:
- htop
- neofetch
- nmap
- ranger
- cowsay
tags:
- install
- core
28 changes: 28 additions & 0 deletions tasks/discord-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

- name: Download Discord
get_url:
url: "https://discord.com/api/download?platform=linux&format=deb"
dest: /tmp/discord.deb
tags:
- minimal-install
- install
- discord

- name: Install Discord
become: true
apt:
deb: /tmp/discord.deb
state: present
tags:
- minimal-install
- install
- discord

- name: Remove Discord .deb package
file:
path: /tmp/discord.deb
state: absent
tags:
- minimal-install
- install
- discord
42 changes: 42 additions & 0 deletions tasks/flatpak-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
- name: Install flatpak
become: true
package:
name:
- flatpak
tags:
- minimal-install
- install
- flatpak

- name: Add flathub repo
become: true
shell: flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
tags:
- minimal-install
- install
- flatpak

- name: Install flatpak core utilities
flatpak:
name:
- com.github.tchx84.Flatseal
- com.vivaldi.Vivaldi

tags:
- minimal-install
- install
- flatpak

- name: Install flatpak GUI extras
flatpak:
name:
- camp.nook.nookdesktop
- com.axosoft.GitKraken
- com.slack.Slack
- com.spotify.Client
- io.github.shiftey.Desktop
- org.signal.Signal
- org.qbittorrent.qBittorrent
tags:
- install
- flatpak
18 changes: 18 additions & 0 deletions tasks/gui-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- name: Install Xorg utilities
become: true
package:
name:
- xserver-xorg-core
# - xserver-xorg-video-nvidia
# - xorg-video-abi-11
- xinit
- xinput
- xclip
- x11-xserver-utils
- libx11-dev
- libxinerama-dev
- libxft-dev
tags:
- minimal-install
- install
- xorg
48 changes: 48 additions & 0 deletions tasks/neovim-setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
- name: Download neovim
become: true
ansible.builtin.shell:
cmd: "curl https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz"
tags:
- minimal-install
- install
- neovim
- name: Remove old neovim directory
become: true
ansible.builtin.shell:
cmd: "rm -rf /opt/nvim-linux64"
tags:
- minimal-install
- install
- neovim
- name: Create neovim directory
become: true
ansible.builtin.shell:
cmd: "mkdir -p /opt/nvim-linux64"
tags:
- minimal-install
- install
- neovim
- name: Change neovim directory to read and execute for everyone
become: true
ansible.builtin.shell:
cmd: "chmod a+rX /opt/nvim-linux64"
tags:
- minimal-install
- install
- neovim
- name: Extract neovim
become: true
ansible.builtin.shell:
cmd: "tar -C /opt -xzf nvim-linux64.tar.gz"
tags:
- minimal-install
- install
- neovim
- name: Create symlink for neovim
become: true
ansible.builtin.shell:
cmd: "ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/"
tags:
- minimal-install
- install
- neovim
4 changes: 4 additions & 0 deletions tasks/node-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@
- install
- node
with_items: "{{ nodejs_npm_global_packages }}"

- name: Install pnpm
ansible.builtin.shell:
cmd: "curl -fsSL https://get.pnpm.io/install.sh | sh -"
24 changes: 0 additions & 24 deletions tasks/slack.yml

This file was deleted.

Empty file added tasks/suckless-setup.yml
Empty file.

0 comments on commit 533e7a6

Please sign in to comment.