Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/homebrew/tasks/package_names.yml

raw
1 # Copyright (c) Ansible Project
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 # A series of package tests that check all the
6 # different ways that "brew info" can refer to a package.
7 #
8 # The homebrew module must mimic what brew info supports,
9 # or else errors will occur.
10
11 - name: Find brew binary
12 command: which brew
13 register: brew_which
14
15 - name: Get owner of brew binary
16 stat:
17 path: "{{ brew_which.stdout }}"
18 register: brew_stat
19
20 # Note: We no longer use sqlite3 for "formula alias" tests, because mac
21 # ships with old python3 and if we use python3 from homebrew, sqlite3
22 # cannot be uninstalled, which is part of the alias test. We use mandoc
23 # instead.
24
25 # An example of a case were old_tokens support is important: User has an
26 # ansible task that installs homebrew/cask/docker (the tap prefix is
27 # required, or else one gets the formula ansible/core/docker). Homebrew
28 # recently changed the name of the cask to docker-desktop, moving
29 # "docker" into its old_tokens array. At that point
30 # community.general.homebrew stopped working, because it succeeds in
31 # running "brew info" on the name "homebrew/cask/docker", which adds
32 # docker-desktop to the list of affected packages. But, later, when it
33 # asks which user name entry corresponds to the affected cask, it
34 # failed, because the code didn't think to consider old_tokens as one of
35 # the valid ways of referring to a cask. That is issue #10804, herein
36 # fixed.
37
38 - name: Test brew uninstall/install using various names accepted by "brew info"
39 vars:
40 packages:
41 # All packages are carefully selected to have no dependencies, to reduce install time
42 # homebrew/cask/kitty crashed on 4867eb4 - Ref: issue #9777
43 - [kitty, homebrew/cask/kitty, "cask by name with tap prefix"]
44 # mdocml test replaces old sqlite3 test, see above.
45 - [mandoc, mdocml, "formula alias"]
46 - [mandoc, homebrew/core/mdocml, "formula alias with tap prefix"]
47 # These all crash on f772bcd - Ref: issue #10804
48 - [cmark, commonmark, "formula with oldnames"]
49 - [cmark, homebrew/core/commonmark, "formula with oldnames and tap prefix"]
50 - [sipgate, clinq, "cask with old_tokens"]
51 - [sipgate, homebrew/cask/clinq, "cask with old_tokens and tap prefix"]
52 include_tasks: package_names_item.yml
53 loop: "{{ packages }}"
54 loop_control:
55 loop_var: package