From 2a479cca524f09f9dbee7965709e0a6a778bcaf2 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 29 May 2013 10:45:31 -0400 Subject: [PATCH] Fixup fetch doc formatting. --- cloud/quantum_floating_ip_associate | 29 +++++++++++++++-------------- {network => files}/fetch | 23 ++++++++++++++--------- 2 files changed, 29 insertions(+), 23 deletions(-) rename {network => files}/fetch (70%) diff --git a/cloud/quantum_floating_ip_associate b/cloud/quantum_floating_ip_associate index 8fe48811bd0..a20d9974edf 100644 --- a/cloud/quantum_floating_ip_associate +++ b/cloud/quantum_floating_ip_associate @@ -27,9 +27,9 @@ except ImportError: DOCUMENTATION = ''' --- module: quantum_floating_ip_associate -short_description: Associate/Disassociate a particular floating ip with an instance +short_description: Associate or disassociate a particular floating ip with an instance description: - - Associates or disassociate's a specific floating ip with a particular instance + - Associates or disassociates a specific floating ip with a particular instance options: login_username: description: @@ -38,46 +38,47 @@ options: default: admin login_password: description: - - Password of login user + - password of login user required: true default: True login_tenant_name: description: - - The tenant name of the login user + - the tenant name of the login user required: true - default: True + default: true auth_url: description: - - The keystone url for authentication + - the keystone url for authentication required: false default: 'http://127.0.0.1:35357/v2.0/' region_name: description: - - Name of the region + - name of the region required: false default: None state: description: - - Indicate desired state of the resource + - indicates the desired state of the resource choices: ['present', 'absent'] default: present instance_name: description: - - Name of the instance to which the public ip should be assigned + - name of the instance to which the public ip should be assigned required: true default: None ip_address: description: - - Floating ip that should be assigned to the instance + - floating ip that should be assigned to the instance required: true default: None -examples: - - code: "quantum_floating_ip_associate: state=present login_username=admin login_password=admin login_tenant_name=admin - ip_address=1.1.1.1 instance_name=vm1" - description: "Associate a specific floating ip with an Instance" requirements: ["quantumclient", "keystoneclient"] ''' +EXAMPLES = ''' +# Associate a specific floating ip with an Instance +quantum_floating_ip_associate: state=present login_username=admin login_password=admin login_tenant_name=admin ip_address=1.1.1.1 instance_name=vm1 +''' + def _get_ksclient(module, kwargs): try: kclient = ksclient.Client(username=kwargs.get('login_username'), diff --git a/network/fetch b/files/fetch similarity index 70% rename from network/fetch rename to files/fetch index 5d2f55a6491..4e0eae51ca3 100644 --- a/network/fetch +++ b/files/fetch @@ -41,15 +41,20 @@ options: the destination. If dest ends with '/', it will use the basename of the source file, similar to the copy module. Obvioiusly this is only handy if the filenames are unqiue. -examples: - - code: "fetch: src=/var/log/messages dest=/home/logtree" - description: "Example from Ansible Playbooks" - - code: "fetch: src=/tmp/somefile dest="/tmp/beefcake-{{ ansible_hostname }}" flat=yes" - description: "Copies a file from remote machine and stores it at the absolute path /tmp/beefcake-{{ ansible_hostname }}" - - code: "fetch: src=/tmp/uniquefile dest="/tmp/special/" flat=yes" - description: "Copies a file from remote machine and stores it at the absolute path /tmp/special" - - code: "fetch: src=/tmp/uniquefile dest="special/" flat=yes" - description: "Copies a file from remote machine and stores it in special/uniquefile relative to the playbook" requirements: [] author: Michael DeHaan ''' + +EXAMPLES = ''' +# Store file into /tmp/fetched/host.example.com/tmp/somefile +fetch: src=/tmp/somefile dest=/tmp/fetched + +# Specifying a path directly +fetch: src=/tmp/somefile dest=/tmp/prefix-{{ ansible_hostname }} flat=yes + +# Specifying a destination path +fetch: src=/tmp/uniquefile dest=/tmp/special/ flat=yes + +# Storing in a path relative to the playbook +fetch: src=/tmp/uniquefile dest=special/prefix-{{ ansible_hostname }} flat=yes +'''