Use blocks to organize package installations

This commit is contained in:
Fernando Schauenburg 2019-11-16 12:18:32 +00:00
parent b9fb127fdf
commit 41f5acd61b

View file

@ -1,37 +1,41 @@
--- ---
- name: Install apt packages (Debian) - name: Set up Debian machine
when: ansible_os_family == "Debian" when: ansible_os_family == "Debian"
become: yes become: yes
apt: name={{ item }} state=latest update_cache=yes block:
loop: - name: Install apt packages
- curl apt: name={{ item }} state=latest update_cache=yes
- exuberant-ctags loop:
- gpg - curl
- htop - exuberant-ctags
- psmisc - gpg
- shellcheck - htop
- sqlite - psmisc
- stow - shellcheck
- tree - sqlite
- stow
- tree
- name: Install homebrew packages (macOS) - name: Set up macOS machine
when: ansible_os_family == "Darwin" when: ansible_os_family == "Darwin"
homebrew: name={{ item }} state=latest block:
loop: - name: Install homebrew packages
- coreutils homebrew: name={{ item }} state=latest
- ctags loop:
- curl - coreutils
- exiftool - ctags
- findutils - curl
- gnu-sed - exiftool
- gpg - findutils
- htop - gnu-sed
- imagemagic - gpg
- jupyter - htop
- pstree - imagemagic
- reattach-to-user-namespace - jupyter
- shellcheck - pstree
- sqlite - reattach-to-user-namespace
- stow - shellcheck
- tree - sqlite
- youtube-dl - stow
- tree
- youtube-dl