1. Navigate to the correct directory for your new module: ``$ cd lib/ansible/modules/cloud/azure/``
2. Create your new module file: ``$ touch my_new_test_module.py``
2. Create your new module file: ``$ touch my_test.py``
3. Paste the content below into your new module file. It includes the :ref:`required Ansible format and documentation <developing_modules_documenting>` and some example code.
4. Modify and extend the code to do what you want your new module to do. See the :ref:`programming tips <developing_modules_best_practices>` and :ref:`Python 3 compatibility <developing_python_3>` pages for pointers on writing clean, concise module code.
@ -71,19 +71,19 @@ To create a new module:
DOCUMENTATION = '''
---
module: my_sample_module
module: my_test
short_description: This is my sample module
short_description: This is my test module
version_added: "2.4"
description:
- "This is my longer description explaining my sample module"
- "This is my longer description explaining my test module"
options:
name:
description:
- This is the message to send to the sample module
- This is the message to send to the test module
required: true
new:
description:
@ -100,18 +100,18 @@ To create a new module:
EXAMPLES = '''
# Pass in a message
- name: Test with a message
my_new_test_module:
my_test:
name: hello world
# pass in a message and have changed true
- name: Test with a message and changed output
my_new_test_module:
my_test:
name: hello world
new: true
# fail the module
- name: Test failure of the module
my_new_test_module:
my_test:
name: fail me
'''
@ -121,7 +121,7 @@ To create a new module:
type: str
returned: always
message:
description: The output message that the sample module generates
description: The output message that the test module generates
type: str
returned: always
'''
@ -214,7 +214,7 @@ If your module does not need to target a remote host, you can quickly and easily