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:
parent
95b92627aa
commit
54a58abcaa
3 changed files with 20 additions and 6 deletions
|
@ -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
|
||||
-------
|
||||
|
|
|
@ -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
|
||||
-------
|
||||
|
|
|
@ -22,12 +22,12 @@
|
|||
state="$(cat "$__object/parameter/state")"
|
||||
|
||||
# Needed packages
|
||||
__docker --state ${state}
|
||||
if [ ${state} = "present" ]; then
|
||||
__docker
|
||||
__package curl
|
||||
|
||||
if [ ${state} = "absent" ]; then
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue