Browse Source

add new type __podan_compose

master
Daniel Tschada 2 years ago
parent
commit
98b44739e8
  1. 24
      cdist/conf/type/__podman_compose/gencode-remote
  2. 61
      cdist/conf/type/__podman_compose/man.rst
  3. 50
      cdist/conf/type/__podman_compose/manifest
  4. 1
      cdist/conf/type/__podman_compose/parameter/default/install
  5. 1
      cdist/conf/type/__podman_compose/parameter/default/state
  6. 1
      cdist/conf/type/__podman_compose/parameter/default/user
  7. 4
      cdist/conf/type/__podman_compose/parameter/optional
  8. 1
      cdist/conf/type/__podman_compose/parameter/required
  9. 0
      cdist/conf/type/__podman_compose/singleton

24
cdist/conf/type/__podman_compose/gencode-remote vendored

@ -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")"

61
cdist/conf/type/__podman_compose/man.rst vendored

@ -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+).

50
cdist/conf/type/__podman_compose/manifest vendored

@ -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 user: ${install}" >&2
exit 1
fi

1
cdist/conf/type/__podman_compose/parameter/default/install vendored

@ -0,0 +1 @@
pip

1
cdist/conf/type/__podman_compose/parameter/default/state vendored

@ -0,0 +1 @@
present

1
cdist/conf/type/__podman_compose/parameter/default/user vendored

@ -0,0 +1 @@
root

4
cdist/conf/type/__podman_compose/parameter/optional vendored

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

1
cdist/conf/type/__podman_compose/parameter/required vendored

@ -0,0 +1 @@
install

0
cdist/conf/type/__podman_compose/singleton vendored

Loading…
Cancel
Save