diff --git a/cdist/conf/type/__docker/man.rst b/cdist/conf/type/__docker/man.rst index 42e71af5..70b92cc7 100644 --- a/cdist/conf/type/__docker/man.rst +++ b/cdist/conf/type/__docker/man.rst @@ -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 ------- diff --git a/cdist/conf/type/__docker_compose/man.rst b/cdist/conf/type/__docker_compose/man.rst index 720a306e..d54b3370 100644 --- a/cdist/conf/type/__docker_compose/man.rst +++ b/cdist/conf/type/__docker_compose/man.rst @@ -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 ------------------ @@ -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 ------- diff --git a/cdist/conf/type/__docker_compose/manifest b/cdist/conf/type/__docker_compose/manifest index 113e87e9..3ab27c63 100644 --- a/cdist/conf/type/__docker_compose/manifest +++ b/cdist/conf/type/__docker_compose/manifest @@ -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