Compare commits

...

2 Commits

Author SHA1 Message Date
Daniel Tschada 5c616f2f2a if install value is wrong 2020-01-06 22:30:26 +01:00
Daniel Tschada 479d57450b add new type __podman_compose 2019-12-03 19:13:39 +01:00
9 changed files with 143 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#!/bin/sh -e
#
# 2019 Daniel Tschada
#
# 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/>.
#
install="$(cat "$__object/parameter/install")"
state="$(cat "$__object/parameter/state")"
user="$(cat "$__object/parameter/user")"
version="$(cat "$__object/parameter/version")"

View File

@ -0,0 +1,61 @@
cdist-type__podman_compose(7)
=============================
NAME
----
cdist-type__podman_compose - install podman-compose
DESCRIPTION
-----------
Installs podman-compose package.
State 'absent' will not remove podman binary itself,
only podman-compose binary will be removed
REQUIRED PARAMETERS
-------------------
install
defaults to 'pip'
OPTIONAL PARAMETERS
-------------------
state
'present' or 'absent', defaults to 'present'
user
the user who owns the file, defaults to 'root'
BOOLEAN PARAMETERS
------------------
None.
EXAMPLES
--------
.. code-block:: sh
# Install podman-compose
__podman_compose
# Install latest version via pip
__podman_compose --state present --install pip
# Install latest version via pip and change user
__podman_compose --state present --install pip --user root
# Remove podman-compose
__podman_compose --state absent
AUTHORS
-------
Daniel Tschada <mail--@--moep.name>
COPYING
-------
Copyright \(C) 2019 Daniel Tschada. Free use of this software is
granted under the terms of the GNU General Public License version 3 or later (GPLv3+).

View File

@ -0,0 +1,50 @@
#!/bin/sh -e
#
# 2019 Daniel Tschada
#
# 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/>.
#
# shellcheck disable=SC2154
# shellcheck disable=SC2034
install="$(cat "$__object/parameter/install")"
state="$(cat "$__object/parameter/state")"
user="$(cat "$__object/parameter/user")"
version="$(cat "$__object/parameter/version")"
# install it with pip
if [ "${install}" = "pip" ]; then
if [ "${state}" = "present" ]; then
__package_pip podman-compose --state present --pip /usr/local/bin/podman-compose --runas "${user}"
elif [ "${state}" = "absent" ]; then
__package_pip podman-compose --state absent
else
if [ "${state}" != "present" ] -a [ "${state}" != "absent" ]; then
echo "Unknown state: ${state}" >&2
exit 1
else
echo "Unknown user: ${user}" >&2
exit 1
fi
fi
else
echo "Unknown install value: ${install}" >&2
exit 1
fi

View File

@ -0,0 +1 @@
pip

View File

@ -0,0 +1 @@
present

View File

@ -0,0 +1 @@
root

View File

@ -0,0 +1,4 @@
install
state
user
version

View File

@ -0,0 +1 @@
install