Repository: ansible/ansible

Issue:
Added mdadm module that will create, stop and remove Linux software RAID devices.
This is a module that utilizes mdadm to create, stop and remove Linux software RAID devices.

``` yaml
  tasks:
    - name: Create mdadm raid device
      mdadm: >
        level=0
        chunk=256
        metadata="1.0"
        devices="/dev/xvdb,/dev/xvdc"
        device_name="/dev/md0"
        state=present
      tags:
      - present
    - name: Stop mdadm raid device
      mdadm: >
        device_name="/dev/md0"
        state=stopped
      tags:
      - stop
    - name: Removing mdadm raid device
      mdadm: >
        device_name="/dev/md0"
        state=absent
      tags:
      - remove
```



Discussion:
Would it make more sense if devices were a a list instead of a comma separate string?

Yes, this probably would be better off with as a list.  I'll look in to making those changes.  Thanks @jsmartin.

You need to expose the --name and --homehost options too, apparently mdadm can/will rename your devices on reboot in some cases otherwise, very annoying.

Best documentation I could find on that is here:
https://bugzilla.redhat.com/show_bug.cgi?id=606481

Geryon, any updates on this?

Hi!

Thanks very much for your interest in Ansible.  It sincerely means a lot to us. 

On September 26, 2014, due to enormous levels of contribution to the project Ansible decided to reorganize module repos, making it easier
for developers to work on the project and for us to more easily manage new contributions and tickets.

We split modules from the main project off into two repos, http://github.com/ansible/ansible-modules-core and http://github.com/ansible/ansible-modules-extras

If you still would like this pull request merged, we will need your help making this target the new repo.  If you do not take any action, this
pull request unfortunately cannot be applied.

We apologize that we are not able to make this transition happen seamlessly, though this is a one-time change and your help is greatly appreciated -- 
this will greatly improve velocity going forward.

Both sets of modules will ship with Ansible, though they'll receive slightly different ticket handling.

To locate where a module lives between 'core' and 'extras'
- Find the module at http://docs.ansible.com/list_of_all_modules.html
- Open the documentation page for that module
- If the bottom of the docs say "This is an extras module", submit your ticket to https://github.com/ansible/ansible-modules-extras
- Otherwise, submit your pull request to update the existing module to https://github.com/ansible/ansible-modules-core
- Note that python modules in ansible now also end in ".py" and this extension is required for new contributions.
- action_plugins (modules with server side components) still live in the main repo.  If your pull request touches both, which should be
   exceedingly rare, submit two new pull requests and make sure to mention the links to each other in the comments.

Otherwise, if this is a new module:
- Submit your pull request to add a module to https://github.com/ansible/ansible-modules-extras

It may be possible to re-patriate your pull requests automatically, one user-submitted approach for advanced git users
has been suggested at https://gist.github.com/willthames/afbaaab0c9681ed45619

Additionally, should you need more help with this, you can ask questions on:
- the development mailing list: https://groups.google.com/forum/#!forum/ansible-devel

Thank you very much!


Resolving patch:
diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py
--- a/lib/ansible/modules/source_control/git.py
+++ b/lib/ansible/modules/source_control/git.py
@@ -229,6 +229,29 @@
     refspec: '+refs/pull/*:refs/heads/*'
 '''
 
+RETURN = '''
+after:
+    description: last commit revision of the repository retrived during the update
+    returned: success
+    type: string
+    sample: 4c020102a9cd6fe908c9a4a326a38f972f63a903
+before:
+    description: commit revision before the repository was updated, "null" for new repository
+    returned: success
+    type: string
+    sample: 67c04ebe40a003bda0efb34eacfb93b0cafdf628
+remote_url_changed:
+    description: Contains True or False whether or not the remote URL was changed.
+    returned: success
+    type: boolean
+    sample: True
+warnings:
+    description: List of warnings if requested features were not available due to a too old git version.
+    returned: error
+    type: string
+    sample: Your git version is too old to fully support the depth argument. Falling back to full checkouts.
+'''
+
 import os
 import re
 import shlex


Test patch: