module DOCUMANTATION for apt, apt_respository cleanup

reviewable/pr18780/r1
Jan-Piet Mens 12 years ago
parent f51f10def5
commit e3a5de2624

55
apt

@ -22,14 +22,14 @@
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: apt module: apt
short_description: Manages apt-packages (such as for Debian/Ubuntu). short_description: Manages apt-packages
description: description:
- Manages apt-packages (such as for Debian/Ubuntu). - Manages apt-packages (such as for Debian/Ubuntu).
version_added: "0.0.2" version_added: "0.0.2"
options: options:
name: name:
description: description:
- A package name or package specifier with version, like foo or foo=1.0 - A package name or package specifier with version, like C(foo) or C(foo=1.0)
required: false required: false
default: null default: null
state: state:
@ -40,63 +40,50 @@ options:
choices: [ "installed", "latest", "remove", "absent", "present" ] choices: [ "installed", "latest", "remove", "absent", "present" ]
update_cache: update_cache:
description: description:
- Run the equivalent of apt-get update before the operation. Can be run as part of the package installation or a seperate step - Run the equivalent of C(apt-get update) before the operation. Can be run as part of the package installation or as a seperate step
required: false required: false
default: "no" default: "no"
choices: [ "yes", "no" ] choices: [ "yes", "no" ]
purge: purge:
description: description:
- Will forge purge of configuration files if state is set to 'absent'. - Will force purge of configuration files if state is set to C(absent).
required: false required: false
default: "no" default: "no"
choices: [ "yes", "no" ] choices: [ "yes", "no" ]
default_release: default_release:
description: description:
- Corresponds to the -t option for apt and sets pin priorities - Corresponds to the C(-t) option for I(apt) and sets pin priorities
required: false required: false
default: null default: null
install_recommends: install_recommends:
description: description:
- Corresponds to the --no-install-recommends option for apt, default behavior works as apt's default behavior, 'no' does not install recommended packages. Suggested packages are never installed. - Corresponds to the C(--no-install-recommends) option for I(apt), default behavior works as apt's default behavior, C(no) does not install recommended packages. Suggested packages are never installed.
required: false required: false
default: "no" default: "no"
choices: [ "yes", "no" ] choices: [ "yes", "no" ]
force: force:
description: description:
- If yes, force installs/removes. - If C(yes) force installs/removes.
required: false required: false
default: "no" default: "no"
choices: [ "yes", "no" ] choices: [ "yes", "no" ]
author: Matthew Williams author: Matthew Williams
notes: []
examples:
- code: apt pkg=foo update-cache=yes
description: Update repositories cache and install C(foo) package
- code: apt pkg=foo state=removed
description: Remove C(foo) package
- code: apt pkg=foo state=installed
description: Install the the package C(foo)
- code: apt pkg=foo=1.00 state=installed
description: Install the version '1.00' of package C(foo)
- code: apt pkg=nginx state=latest default-release=squeeze-backports update-cache=yes
description: Update the repository cache and update package C(ngnix) to latest version using default release C(squeeze-backport)
- code: apt pkg=openjdk-6-jdk state=latest install-recommends=no
description: Install latest version of C(openjdk-6-jdk) ignoring C(install-recomands)
''' '''
EXAMPLES = [
"""
- code: apt pkg=foo update-cache=yes
description: Update repositories cache and install 'foo' package
""",
"""
- code: apt pkg=foo state=removed
description: Remove 'foo' package
""",
"""
- code: apt pkg=foo state=installed
description: Install the the package 'foo'
""",
"""
- code: apt pkg=foo=1.00 state=installed
description: Install the version '1.00' of package 'foo'
""",
"""
- code: apt pkg=nginx state=latest default-release=squeeze-backports update-cache=yes
description: Update the repository cache and update package 'ngnix' to latest versione using default release 'squeeze-backport'
""",
"""
- code: apt pkg=openjdk-6-jdk state=latest install-recommends=no
description: Install latest version of 'openjdk-6-jdk' ignoring 'install-recomands'
"""
]
import traceback import traceback
# added to stave off future warnings about apt api # added to stave off future warnings about apt api
import warnings import warnings

@ -26,7 +26,7 @@
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: apt_repository module: apt_repository
short_description: Manages apt repositores (such as for Debian/Ubuntu). short_description: Manages apt repositores
description: description:
- Manages apt repositores (such as for Debian/Ubuntu). - Manages apt repositores (such as for Debian/Ubuntu).
version_added: "0.7" version_added: "0.7"
@ -43,22 +43,16 @@ options:
default: present default: present
choices: [ "present", "absent" ] choices: [ "present", "absent" ]
notes: notes:
- This module require 'apt-add-repository' wwill be available on destination server. To ensure this package is available use 'apt' module and install 'python-software-properties' package before use this module. - This module requires C(apt-add-repository) be available on destination server. To ensure this package is available use the C(apt) module and install the C(python-software-properties) package before using this module.
- This module work only on Ubuntu and unstable Debian, see U(https://github.com/ansible/ansible/pull/1082, this issue) - This module works on Ubuntu and unstable Debian only, see U(https://github.com/ansible/ansible/pull/1082).
- A bug in 'apt-add-repository' always add 'deb' and 'deb-src' type for repo (see the U(https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/987264, issue on lunchpad)), if some repo don't have source (eg: MongoDB repo from 10gen) the system fail on update repositories. - A bug in C(apt-add-repository) always adds C(deb) and C(deb-src) types for repositories (see the issue on Launchpad U(https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/987264)), if some repo don't have source (eg: MongoDB repo from 10gen) the system fails while updating repositories.
author: Matt Wright author: Matt Wright
''' examples:
EXAMPLES = [
"""
- code: apt_repository repo=ppa://nginx/stable - code: apt_repository repo=ppa://nginx/stable
description: Add nginx stable repository from PPA description: Add nginx stable repository from PPA
""",
"""
- code: apt_repository repo='deb http://archive.canonical.com/ubuntu hardy partner' - code: apt_repository repo='deb http://archive.canonical.com/ubuntu hardy partner'
description: Add specified repository into sources. description: Add specified repository into sources.
""" '''
]
import platform import platform

Loading…
Cancel
Save