Skip to content

Commit

Permalink
Merge pull request #21 from AlexNabokikh/packages
Browse files Browse the repository at this point in the history
feat(apt): added the ability to add ppa and deb repositories
  • Loading branch information
AlexNabokikh authored May 25, 2023
2 parents d9e15a0 + 79544a1 commit 69b82d1
Show file tree
Hide file tree
Showing 4 changed files with 19 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
12 changes: 12 additions & 0 deletions tasks/apt.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
---
- name: Install apt repositories.
become: true
ansible.builtin.apt_repository:
repo: "{{ item }}"
state: present
update_cache: true
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 69b82d1

Please sign in to comment.