2017-06-28 11:19:32 +00:00
|
|
|
#!/bin/sh -e
|
2016-12-11 21:12:44 +00:00
|
|
|
#
|
|
|
|
# 2016 Dominique Roux (dominique.roux at ungleich.ch)
|
|
|
|
#
|
|
|
|
# This file is part of cdist.
|
|
|
|
#
|
|
|
|
# cdist is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# cdist is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2016-12-29 13:36:46 +00:00
|
|
|
state="$(cat "$__object/parameter/state")"
|
|
|
|
|
2016-12-11 21:12:44 +00:00
|
|
|
# Needed packages
|
2018-10-02 19:44:27 +00:00
|
|
|
if [ "${state}" = "present" ]; then
|
2016-12-29 13:47:29 +00:00
|
|
|
__docker
|
|
|
|
__package curl
|
2018-10-02 19:44:27 +00:00
|
|
|
elif [ "${state}" = "absent" ]; then
|
2016-12-29 13:36:46 +00:00
|
|
|
__file /usr/local/bin/docker-compose --state absent
|
2016-12-29 13:47:29 +00:00
|
|
|
else
|
2017-01-02 10:48:07 +00:00
|
|
|
echo "Unknown state: ${state}" >&2
|
2016-12-29 13:36:46 +00:00
|
|
|
exit 1
|
|
|
|
fi
|