The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
name - / required | Package name, or package specifier with version. Syntax varies with package manager. For example name-1.0 or name=1.0 .Package names also vary with package manager; this module will not "translate" them per distro. For example libyaml-dev , libyaml-devel . | |
state - / required | Whether to install ( present ), or remove (absent ) a package.You can use other states like latest ONLY if they are supported by the underlying package module(s) executed. | |
use - | Default: "auto" | The required package manager module to use (yum, apt, etc). The default 'auto' will use existing facts or try to autodetect it. You should only use this field if the automatic selection is not working for some reason. |
Note
- name: install ntpdate package: name: ntpdate state: present # This uses a variable as this changes per distribution. - name: remove the apache package package: name: "{{ apache }}" state: absent - name: install the latest version of Apache and MariaDB package: name: - httpd - mariadb-server state: latest
More information about Red Hat’s support of this module is available from this Red Hat Knowledge Base article.
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/package_module.html