Changed man.rst of __docker and __docker_compose

- Added state parameter for both types in the man.rst
- Changed --state absent behavior of __docker_compose
-- only remove docker-compose binary not whole docker
This commit is contained in:
Dominique Roux 2016-12-29 14:47:29 +01:00
parent 95b92627aa
commit 54a58abcaa
3 changed files with 20 additions and 6 deletions

View file

@ -26,17 +26,24 @@ BOOLEAN PARAMETERS
experimental experimental
Install the experimental docker-engine package instead of the latest stable release. Install the experimental docker-engine package instead of the latest stable release.
state
'present' or 'absent', defaults to 'present'
EXAMPLES EXAMPLES
-------- --------
.. code-block:: sh .. code-block:: sh
# Install docker
__docker __docker
# experimental # Install experimental
__docker --experimental __docker --experimental
# Remove docker
__docker --state absent
AUTHORS AUTHORS
------- -------

View file

@ -21,6 +21,9 @@ OPTIONAL PARAMETERS
version version
Define docker_compose version, defaults to "1.9.0" Define docker_compose version, defaults to "1.9.0"
state
'present' or 'absent', defaults to 'present'
BOOLEAN PARAMETERS BOOLEAN PARAMETERS
------------------ ------------------
@ -32,11 +35,15 @@ EXAMPLES
.. code-block:: sh .. code-block:: sh
# Install docker-compose
__docker_compose __docker_compose
# Install version 1.9.0-rc4 # Install version 1.9.0-rc4
__docker_compose --version 1.9.0-rc4 __docker_compose --version 1.9.0-rc4
# Remove docker-compose
__docker_compose --state absent
AUTHORS AUTHORS
------- -------

View file

@ -22,12 +22,12 @@
state="$(cat "$__object/parameter/state")" state="$(cat "$__object/parameter/state")"
# Needed packages # Needed packages
__docker --state ${state} if [ ${state} = "present" ]; then
__package curl __docker
__package curl
if [ ${state} = "absent" ]; then elif [ ${state} = "absent" ]; then
__file /usr/local/bin/docker-compose --state absent __file /usr/local/bin/docker-compose --state absent
elif [ ${state} != "present" -a ${state} != "absent" ]; then else
echo "Unknown state: $state_should" >&2 echo "Unknown state: $state_should" >&2
exit 1 exit 1
fi fi