Details regarding the update_homebrew option

I have a question about the homebrew module.

Consider the following task:

`

  • name: Install rbenv & ruby-build
    homebrew: name={{ item }} update_homebrew=yes
    with_items:
  • rbenv
  • ruby-build

`

This uses homebrew to install 2 packages. The “update_homebrew” option is set to “yes” which according to the docs will update homebrew itself first.

My question is will it update homebrew before each package (e.g. twice in my example)? The above task can be pretty slow so I’m starting to think that this may be happening.

If that’s the case then I may be better off updating homebrew once (pre_task?), in advance of installing packages, especially if I’m going to be installing quite a few.

I would just call update_homebrew on the first task.

Many of our modules, such as apt, allow updating the cache without installing a package, which makes a first step somewhat cleaner.

The homebrew one is a bit more bare bones ATM, and a name is required, so I’d just call it on the first one for now.

Thanks for the advice.