From 54a58abcaa23357d14f3825b5e31ee121a7b1ec2 Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Thu, 29 Dec 2016 14:47:29 +0100 Subject: [PATCH] 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 --- cdist/conf/type/__docker/man.rst | 9 ++++++++- cdist/conf/type/__docker_compose/man.rst | 7 +++++++ cdist/conf/type/__docker_compose/manifest | 10 +++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cdist/conf/type/__docker/man.rst b/cdist/conf/type/__docker/man.rst index 42e71af556..70b92cc79b 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 720a306ea2..d54b33709a 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 113e87e97a..3ab27c63a2 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