diff --git a/README.md b/README.md index c7a6bc2..43c8020 100644 --- a/README.md +++ b/README.md @@ -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** diff --git a/example.config.yml b/example.config.yml index c5e5d48..62a47a1 100644 --- a/example.config.yml +++ b/example.config.yml @@ -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 diff --git a/tasks/apt.yml b/tasks/apt.yml index 50ec9e3..843101e 100644 --- a/tasks/apt.yml +++ b/tasks/apt.yml @@ -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: diff --git a/tests/test_config.yml b/tests/test_config.yml index a5ea419..27013fc 100644 --- a/tests/test_config.yml +++ b/tests/test_config.yml @@ -23,7 +23,10 @@ installed_nerdfonts: configure_gnome: false +apt_repositories: + - ppa:aslatter/ppa apt_packages: + - alacritty - fzf install_snap: true