Added support for Docker's 'restart_policy' (PR 504)

Hey guys,

I really like ‘restart_policy’ in Docker (introduced in 1.2). Unfortunately, this feature is not supported in Ansible at this point. To solve this, I decided to block some time today to hack together this support. The Pull request is available here [1].

Since I haven’t contributed to Ansible before, I don’t know the exact process for this. In any case, I’ve tested this with success on 1.8.2.

Let me know what you think.

Thanks.

[1] https://github.com/ansible/ansible-modules-core/pull/504

Hi Victor,

You will need to add a “version_added: ‘1.8’” to the new param in the documentation block.

As for this part in the docs, it seems to contradict a little with the example? I’m wondering if the param should take a dict instead of whether we should show additional examples.

The module parameter in the argument_spec seems to take a dict which conflicts with the example value of ‘always’.

Thoughts?

The syntax is ‘:’ or ', where ‘policy’ can be ‘always’ or ‘on_failure’. ‘count’ is optional, and set to ‘0’ (unlimited) if not explictly set. Set to ‘0’ for no limit. Requires Docker >= 1.2.0.