Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Dominique Roux committed Dec 29, 2016
1 parent 95b9262 commit 54a58ab
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
9 changes: 8 additions & 1 deletion cdist/conf/type/__docker/man.rst
Expand Up @@ -26,17 +26,24 @@ BOOLEAN PARAMETERS
experimental
Install the experimental docker-engine package instead of the latest stable release.

state
'present' or 'absent', defaults to 'present'


EXAMPLES
--------

.. code-block:: sh
# Install docker
__docker
# experimental
# Install experimental
__docker --experimental
# Remove docker
__docker --state absent
AUTHORS
-------
Expand Down
7 changes: 7 additions & 0 deletions cdist/conf/type/__docker_compose/man.rst
Expand Up @@ -21,6 +21,9 @@ OPTIONAL PARAMETERS
version
Define docker_compose version, defaults to "1.9.0"

state
'present' or 'absent', defaults to 'present'


BOOLEAN PARAMETERS
------------------
Expand All @@ -32,11 +35,15 @@ EXAMPLES

.. code-block:: sh
# Install docker-compose
__docker_compose
# Install version 1.9.0-rc4
__docker_compose --version 1.9.0-rc4
# Remove docker-compose
__docker_compose --state absent
AUTHORS
-------
Expand Down
10 changes: 5 additions & 5 deletions cdist/conf/type/__docker_compose/manifest
Expand Up @@ -22,12 +22,12 @@
state="$(cat "$__object/parameter/state")"

# Needed packages
__docker --state ${state}
__package curl

if [ ${state} = "absent" ]; then
if [ ${state} = "present" ]; then
__docker
__package curl
elif [ ${state} = "absent" ]; then
__file /usr/local/bin/docker-compose --state absent
elif [ ${state} != "present" -a ${state} != "absent" ]; then
else
echo "Unknown state: $state_should" >&2
exit 1
fi

0 comments on commit 54a58ab

Please sign in to comment.