- hosts: all
gather_facts: false
become: yes
user: username
tasks:
- name: List Available Patches (Non-Kernel)
yum:
list: updates
update_cache: true
exclude: kernel*
register: yumoutput
- debug: msg="{{ inventory_hostname}} {{ yumoutput.results }}"
味精:
Unsupported parameters for (yum) module: register Supported parameters
include: allow_downgrade, bugfix, conf_file, disable_gpg_check,
disable_plugin, disablerepo, enable_plugin, enablerepo, exclude,
install_repoquery, installroot, list, name, security, skip_broken, state,
update_cache, update_only, validate_certs
to retry, use:
ansible --version
ansible 2.6.5
与2.7.5
版本相同。
答案 0 :(得分:0)
这似乎是缩进错误。 register
必须与yum
放在同一列。
- hosts: all
gather_facts: false
become: yes
user: username
tasks:
- name: List Available Patches (Non-Kernel)
yum:
list: updates
update_cache: true
exclude: kernel*
register: yumoutput
- debug: msg="{{ inventory_hostname}} {{ yumoutput.results }}"