Skip to content

Commit

Permalink
feat(apt): added the ability to add ppa and deb repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNabokikh committed May 25, 2023
1 parent d9e15a0 commit 57d865a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This playbook helps to configure Ubuntu or any other Debian-based distro machine
> **NOTE:** The Playbook is fully configurable. You can skip or reconfigure any task by [Overriding Defaults](#overriding-defaults).
- **Software**
- Add ppa or deb repositories.
- Install **APT, Snap, Flatpak or Homebrew** packages.
- Install extra **PIP** or **NPM** packages.
- **Dotfiles**
Expand Down
3 changes: 3 additions & 0 deletions example.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ configure_tmux: true
tmux_dir: $HOME/.tmux

# Application packages
apt_repositories:
- ppa:aslatter/ppa
apt_packages:
- alacritty
- fzf

# Install snap and and listed packages
Expand Down
10 changes: 10 additions & 0 deletions tasks/apt.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
---
- name: Install apt repositories.
become: true
ansible.builtin.apt_repository:
repo: "{{ item }}"
loop: "{{ apt_repositories }}"
when:
- apt_repositories is defined
- apt_repositories is iterable
- apt_repositories | length > 0

- name: Install apt packages.
become: true
ansible.builtin.apt:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ installed_nerdfonts:

configure_gnome: false

apt_repositories:
- ppa:aslatter/ppa
apt_packages:
- alacritty
- fzf

install_snap: true
Expand Down

0 comments on commit 57d865a

Please sign in to comment.