This commit is contained in:
JMARyA 2023-12-04 11:02:23 +01:00
commit c5cd492449
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
475 changed files with 27928 additions and 0 deletions

View file

@ -0,0 +1,30 @@
# ansible.builtin.package
Generic OS package manager
## Parameter
| Parameter | Type | Default | Description |
| --------- | --------------------- | ------- | ------------------------------------------------ |
| **name** | string / required | - | Package name, or package specifier with version. |
| **state** | "absent"<br>"present" | - | Whether to install, or remove a package. |
| | | | |
## Examples
```yaml
- name: Install ntpdate
ansible.builtin.package:
name: ntpdate
state: present
# This uses a variable as this changes per distribution.
- name: Remove the apache package
ansible.builtin.package:
name: "{{ apache }}"
state: absent
- name: Install the latest version of Apache and MariaDB
ansible.builtin.package:
name:
- httpd
- mariadb-server
state: latest
```