Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module DOCUMENTATION for template, wait_for, and yum #1131

Merged
merged 1 commit into from
Sep 28, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion hacking/templates/man.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
."
."
." ------ NOTES
{% if notes is defined -%}
{% if notes -%}
.SH NOTES
{% for note in notes -%}
.PP
Expand Down
41 changes: 41 additions & 0 deletions library/template
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
# this is a virtual module that is entirely implemented server side


DOCUMENTATION = '''
---
module: template
short_description: Templates a file out to a remote server.
description:
- Templates are processed by the Jinja2 templating language
(U(http://jinja.pocoo.org/docs/)) - documentation on the template
formatting can be found in the Template Designer Documentation
(U(http://jinja.pocoo.org/docs/templates/)).
options:
src:
description:
- Path of a Jinja2 formatted template on the local server. This can be a relative or absolute path.
required: true
default: null
aliases: []
dest:
description:
- Location to render the template to on the remote machine.
required: true
default: null
backup:
description:
- Create a backup file including the timestamp information so you can get
the original file back if you somehow clobbered it incorrectly.
required: false
choices: [ "yes", "no" ]
default: "no"
others:
description:
- all arguments accepted by the M(file) module also work here
required: false
examples:
- code: template src=/mytemplates/foo.j2 dest=/etc/file.conf owner=bin group=wheel mode=0644
description: "Example from Ansible Playbooks"
notes: []
requirements: null
author: Michael DeHaan
'''
45 changes: 45 additions & 0 deletions library/wait_for
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,51 @@ import datetime
import time
import sys

DOCUMENTATION = '''
---
module: wait_for
short_description: Waits for a given port to become accessible on a server.
description:
- This is useful for when services are not immediately available after
their init scripts return - which is true of certain Java application
servers. It is also useful when starting guests with the M(virt) module and
needing to pause until they are ready.
version_added: "0.7"
options:
host:
description:
- hostname or IP address to wait for
required: false
default: "127.0.0.1"
aliases: []
timeout:
description:
- maximum number of seconds to wait for
required: false
default: 300
delay:
description:
- number of seconds to wait before starting to poll
required: false
default: 0
port:
description:
- port number to poll
required: true
state:
description:
- either C(started), or C(stopped) depending on whether the module should
poll for the port being open or closed.
choices: [ "started", "stopped" ]
default: "started"
examples:
- code: wait_for port=8000 delay=10
description: "Example from Ansible Playbooks"
notes: []
requirements: null
author: Jeroen Hoekx
'''

def main():

module = AnsibleModule(
Expand Down
34 changes: 34 additions & 0 deletions library/yum
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,40 @@ import traceback
import os
import yum

DOCUMENTATION = '''
---
module: yum
short_description: Manages packages with the I(yum) package manager
description:
- Will install, upgrade, remove, and list packages with the I(yum) package manager.
options:
name:
description:
- package name, or package specifier with version, like C(name-1.0).
required: true
default: null
aliases: []
list:
description:
- various non-idempotent commands for usage with C(/usr/bin/ansible) and I(not) playbooks. See examples.
required: false
default: null
state:
description:
- whether to install (C(present), C(latest)), or remove (C(absent)) a package.
required: false
choices: [ "present", "latest", "absent" ]
default: "present"
examples:
- code: yum name=httpd state=latest
- code: yum name=httpd state=removed
- code: yum name=httpd state=installed
notes: []
# informational: requirements for nodes
requirements: [ yum, rpm ]
author: Seth Vidal
'''

def_qf = "%{name}-%{version}-%{release}.%{arch}"

repoquery='/usr/bin/repoquery'
Expand Down