community.general.homebrew_cask 模块 – 安装和卸载 Homebrew casks
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。
要在 playbook 中使用它,请指定:community.general.homebrew_cask
。
概要
管理 Homebrew casks。
参数
参数 |
注释 |
---|---|
允许外部应用。 选项
|
|
升级自动更新的 casks。 当检查已安装的 cask 是否有新版本可用时,将 选项
|
|
用于安装软件包的选项标志。 |
|
要安装或删除的 cask 的名称。 |
|
用“:”分隔的搜索“brew”可执行文件的路径列表。 默认值: |
|
cask 的状态。 选项
|
|
要传递给 SUDO_ASKPASS 的 sudo 密码。 |
|
首先更新 Homebrew 本身。 请注意, 选项
|
|
升级所有 casks。 与 选项
|
属性
属性 |
支持 |
描述 |
---|---|---|
支持: 完全 |
可以在 |
|
支持: 无 |
当处于差异模式时,将返回有关已更改的内容(或在 |
示例
- name: Install cask
community.general.homebrew_cask:
name: alfred
state: present
- name: Remove cask
community.general.homebrew_cask:
name: alfred
state: absent
- name: Install cask with install options
community.general.homebrew_cask:
name: alfred
state: present
install_options: 'appdir=/Applications'
- name: Install cask with install options
community.general.homebrew_cask:
name: alfred
state: present
install_options: 'debug,appdir=/Applications'
- name: Install cask with force option
community.general.homebrew_cask:
name: alfred
state: present
install_options: force
- name: Allow external app
community.general.homebrew_cask:
name: alfred
state: present
accept_external_apps: true
- name: Remove cask with force option
community.general.homebrew_cask:
name: alfred
state: absent
install_options: force
- name: Upgrade all casks
community.general.homebrew_cask:
upgrade_all: true
- name: Upgrade all casks with greedy option
community.general.homebrew_cask:
upgrade_all: true
greedy: true
- name: Upgrade given cask with force option
community.general.homebrew_cask:
name: alfred
state: upgraded
install_options: force
- name: Upgrade cask with greedy option
community.general.homebrew_cask:
name: 1password
state: upgraded
greedy: true
- name: Using sudo password for installing cask
community.general.homebrew_cask:
name: wireshark
state: present
sudo_password: "{{ ansible_become_pass }}"