ansible: pass list to package managers instead of looping
Passing the list and letting the package manager deal with it as a whole is much faster than looping, which is equivalent to invoking the package manager multiple times, each time with a single package.
This commit is contained in:
parent
38fb93fd16
commit
ce68613438
1 changed files with 49 additions and 65 deletions
|
@ -3,8 +3,10 @@
|
||||||
become: yes
|
become: yes
|
||||||
block:
|
block:
|
||||||
- name: Install apt packages
|
- name: Install apt packages
|
||||||
apt: name={{ item }} state=latest update_cache=yes
|
apt:
|
||||||
loop:
|
update_cache: yes
|
||||||
|
state: latest
|
||||||
|
name:
|
||||||
- curl
|
- curl
|
||||||
- exa
|
- exa
|
||||||
- exuberant-ctags
|
- exuberant-ctags
|
||||||
|
@ -22,14 +24,13 @@
|
||||||
- youtube-dl
|
- youtube-dl
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Set up macOS machine
|
- name: Set up macOS machine
|
||||||
when: ansible_os_family == "Darwin"
|
when: ansible_os_family == "Darwin"
|
||||||
block:
|
block:
|
||||||
- name: Install homebrew packages
|
- name: Install homebrew packages
|
||||||
homebrew: name={{ item }} state=latest
|
homebrew:
|
||||||
loop:
|
state: latest
|
||||||
|
name:
|
||||||
- coreutils
|
- coreutils
|
||||||
- ctags
|
- ctags
|
||||||
- curl
|
- curl
|
||||||
|
@ -56,20 +57,3 @@
|
||||||
- wget
|
- wget
|
||||||
- youtube-dl
|
- youtube-dl
|
||||||
|
|
||||||
# - name: Tap into homebrew/cask-fonts
|
|
||||||
# homebrew_tap: tap=homebrew/cask-fonts state=present
|
|
||||||
|
|
||||||
# - name: Install Mac apps with homebrew cask
|
|
||||||
# homebrew_cask: name={{item}} state=present
|
|
||||||
# loop:
|
|
||||||
# - 1password
|
|
||||||
# - cyberduck
|
|
||||||
# - dropbox
|
|
||||||
# - firefox
|
|
||||||
# - font-source-code-pro
|
|
||||||
# - google-chrome
|
|
||||||
# - iterm2
|
|
||||||
# - transmission
|
|
||||||
# - vagrant
|
|
||||||
# - virtualbox
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue