2015-06-09 02:12:10 +02:00
#!/usr/bin/python
# -*- coding: utf-8 -*-
2015-06-09 02:18:59 +02:00
# (c) 2015, Ansible, inc
2015-06-09 02:12:10 +02:00
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
DOCUMENTATION = '''
- - -
module : package
version_added : 2.0
2015-07-16 22:52:56 +02:00
author :
- Ansible Inc
maintainers :
- Ansible Core Team
2015-06-09 02:12:10 +02:00
short_description : Generic OS package manager
description :
- Installs , upgrade and removes packages using the underlying OS package manager .
options :
name :
description :
- " Package name, or package specifier with version, like C(name-1.0). When using state=latest, this can be ' * ' which means run: yum -y update. You can also pass a url or a local path to a rpm file. To operate on several packages this can accept a comma separated list of packages or (as of 2.0) a list of packages. "
required : true
state :
description :
- Whether to install ( C ( present ) , C ( latest ) ) , or remove ( C ( absent ) ) a package .
required : true
2015-07-16 22:52:56 +02:00
use :
description :
- The required package manager module to use ( yum , apt , etc ) . The default ' auto ' will use existing facts or try to autodetect it .
required : false
default : auto
2015-06-09 02:12:10 +02:00
requirements :
- Whatever is required for the package plugins specific for each system .
notes :
- This module actually calls the pertinent package modules for each system ( apt , yum , etc ) .
'''
EXAMPLES = '''
2015-06-09 02:25:39 +02:00
- name : install the latest version of ntpdate
package : name = ntpdate state = latest
2015-06-09 02:12:10 +02:00
2015-06-09 02:25:39 +02:00
# This uses a variable as this changes per distribution.
- name : remove the apache package
package : name = { { apache } } state = absent
2015-06-09 02:12:10 +02:00
'''