Skip to content

Commit

Permalink
homebrew: Honor update_homebrew value (#112)
Browse files Browse the repository at this point in the history
Added environment variable to honor update_homebrew argument specified
by user.

Fixes: ansible/ansible#56650

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
  • Loading branch information
Akasurde committed Apr 5, 2020
1 parent e338938 commit 645fe91
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/56650-homebrew-update_brew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- homebrew - Added environment variable to honor update_homebrew setting (https://github.com/ansible/ansible/issues/56650).
4 changes: 4 additions & 0 deletions plugins/modules/packaging/os/homebrew.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,10 @@ def main():
state = 'absent'

update_homebrew = p['update_homebrew']
if not update_homebrew:
module.run_command_environ_update.update(
dict(HOMEBREW_NO_AUTO_UPDATE="True")
)
upgrade_all = p['upgrade_all']
p['install_options'] = p['install_options'] or []
install_options = ['--{0}'.format(install_option)
Expand Down
8 changes: 0 additions & 8 deletions tests/integration/targets/homebrew/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
become: yes
become_user: "{{ brew_stat.stat.pw_name }}"
register: xz_result
environment:
HOMEBREW_NO_AUTO_UPDATE: True

- assert:
that:
Expand All @@ -50,8 +48,6 @@
become: yes
become_user: "{{ brew_stat.stat.pw_name }}"
register: xz_result
environment:
HOMEBREW_NO_AUTO_UPDATE: True

- assert:
that:
Expand All @@ -65,8 +61,6 @@
become: yes
become_user: "{{ brew_stat.stat.pw_name }}"
register: xz_result
environment:
HOMEBREW_NO_AUTO_UPDATE: True

- assert:
that:
Expand All @@ -80,8 +74,6 @@
become: yes
become_user: "{{ brew_stat.stat.pw_name }}"
register: xz_result
environment:
HOMEBREW_NO_AUTO_UPDATE: True

- assert:
that:
Expand Down

0 comments on commit 645fe91

Please sign in to comment.