forked from ungleich-public/cdist
Merge branch 'master' into 4.0-pre-not-stable
This commit is contained in:
commit
0a3b5d33d9
16 changed files with 26 additions and 48 deletions
|
@ -27,23 +27,11 @@ else
|
|||
shell=""
|
||||
fi
|
||||
|
||||
if [ -f "$__object/parameter/username" ]; then
|
||||
username="$(cat "$__object/parameter/username")"
|
||||
else
|
||||
username="cdist"
|
||||
fi
|
||||
username="$(cat "$__object/parameter/username")"
|
||||
|
||||
if [ -f "$__object/parameter/branch" ]; then
|
||||
branch="$(cat "$__object/parameter/branch")"
|
||||
else
|
||||
branch="master"
|
||||
fi
|
||||
branch="$(cat "$__object/parameter/branch")"
|
||||
|
||||
if [ -f "$__object/parameter/source" ]; then
|
||||
source="$(cat "$__object/parameter/source")"
|
||||
else
|
||||
source="git://github.com/telmich/cdist.git"
|
||||
fi
|
||||
source="$(cat "$__object/parameter/source")"
|
||||
|
||||
# Currently hardcoded - if anyone cares, make a parameter
|
||||
# out of it
|
||||
|
|
1
cdist/conf/type/__cdist/parameter/default/branch
Normal file
1
cdist/conf/type/__cdist/parameter/default/branch
Normal file
|
@ -0,0 +1 @@
|
|||
master
|
1
cdist/conf/type/__cdist/parameter/default/source
Normal file
1
cdist/conf/type/__cdist/parameter/default/source
Normal file
|
@ -0,0 +1 @@
|
|||
git://github.com/telmich/cdist.git
|
1
cdist/conf/type/__cdist/parameter/default/username
Normal file
1
cdist/conf/type/__cdist/parameter/default/username
Normal file
|
@ -0,0 +1 @@
|
|||
cdist
|
|
@ -21,8 +21,8 @@
|
|||
|
||||
key="$__object_id"
|
||||
[ -f "$__object/parameter/key" ] && key="$(cat "$__object/parameter/key")"
|
||||
state_should=present
|
||||
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
|
||||
|
||||
state_should="$(cat "$__object/parameter/state")"
|
||||
|
||||
file="$(cat "$__object/parameter/file")"
|
||||
delimiter="$(cat "$__object/parameter/delimiter")"
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
state_should=present
|
||||
[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")"
|
||||
state_should="$(cat "$__object/parameter/state")"
|
||||
|
||||
if [ "$state_should" = "present" -a ! -f "$__object/parameter/value" ]; then
|
||||
echo "Missing required parameter 'value'" >&2
|
||||
|
|
1
cdist/conf/type/__key_value/parameter/default/state
Normal file
1
cdist/conf/type/__key_value/parameter/default/state
Normal file
|
@ -0,0 +1 @@
|
|||
present
|
|
@ -2,8 +2,7 @@
|
|||
# State: absent is handled by manifest - we need only to do stuff if image is
|
||||
# not existing and state != absent
|
||||
#
|
||||
state="present"
|
||||
[ -f "$__object/parameter/state" ] && state="$(cat "$__object/parameter/state")"
|
||||
state="$(cat "$__object/parameter/state")"
|
||||
[ "$state" = "absent" ] && exit 0
|
||||
|
||||
exists="$(cat "$__object/explorer/exists")"
|
||||
|
@ -13,8 +12,7 @@ exists="$(cat "$__object/explorer/exists")"
|
|||
# Still there? Create image
|
||||
#
|
||||
|
||||
format=qcow2
|
||||
[ -f "$__object/parameter/format" ] && format="$(cat "$__object/parameter/format")"
|
||||
format="$(cat "$__object/parameter/format")"
|
||||
size="$(cat "$__object/parameter/size")"
|
||||
diskimage="/$__object_id"
|
||||
|
||||
|
|
|
@ -2,10 +2,8 @@
|
|||
# Default settings
|
||||
#
|
||||
|
||||
format=qcow2
|
||||
state=present
|
||||
[ -f "$__object/parameter/format" ] && format="$(cat "$__object/parameter/format")"
|
||||
[ -f "$__object/parameter/state" ] && state="$(cat "$__object/parameter/state")"
|
||||
format="$(cat "$__object/parameter/format")"
|
||||
state="$(cat "$__object/parameter/state")"
|
||||
|
||||
diskimage="/$__object_id"
|
||||
|
||||
|
|
1
cdist/conf/type/__qemu_img/parameter/default/format
Normal file
1
cdist/conf/type/__qemu_img/parameter/default/format
Normal file
|
@ -0,0 +1 @@
|
|||
qcow2
|
1
cdist/conf/type/__qemu_img/parameter/default/state
Normal file
1
cdist/conf/type/__qemu_img/parameter/default/state
Normal file
|
@ -0,0 +1 @@
|
|||
present
|
|
@ -1 +1,2 @@
|
|||
format
|
||||
state
|
||||
|
|
|
@ -45,11 +45,7 @@ else
|
|||
id="$__object_id"
|
||||
fi
|
||||
|
||||
if [ -f "$__object/parameter/state" ]; then
|
||||
state="$(cat "$__object/parameter/state")"
|
||||
else
|
||||
state="present"
|
||||
fi
|
||||
state="$(cat "$__object/parameter/state")"
|
||||
|
||||
repo_id="$(cat "$__object/explorer/repo_id")"
|
||||
|
||||
|
|
|
@ -39,17 +39,8 @@ else
|
|||
uri="$__object_id"
|
||||
fi
|
||||
|
||||
if [ -f "$__object/parameter/state" ]; then
|
||||
state_should="$(cat "$__object/parameter/state")"
|
||||
else
|
||||
state_should="present"
|
||||
fi
|
||||
|
||||
if [ -f "$__object/parameter/type" ]; then
|
||||
stype="$(cat "$__object/parameter/type")"
|
||||
else
|
||||
stype="ris"
|
||||
fi
|
||||
state_should="$(cat "$__object/parameter/state")"
|
||||
stype="$(cat "$__object/parameter/type")"
|
||||
|
||||
exp_uri="$(cat "$__object/explorer/service_uri")"
|
||||
exp_id="$(cat "$__object/explorer/service_id")"
|
||||
|
|
|
@ -33,11 +33,7 @@ else
|
|||
uri="$__object_id"
|
||||
fi
|
||||
|
||||
if [ -f "$__object/parameter/state" ]; then
|
||||
state_should="$(cat "$__object/parameter/state")"
|
||||
else
|
||||
state_should="present"
|
||||
fi
|
||||
state_should="$(cat "$__object/parameter/state")"
|
||||
|
||||
exp_uri="$(cat "$__object/explorer/service_uri")"
|
||||
|
||||
|
|
|
@ -13,7 +13,12 @@ Changelog
|
|||
* Core: Add environment variable to select shell for executing scripts (Daniel Heule)
|
||||
* Explorer hostname: Return host name by using uname -n
|
||||
* New Type: __hostname (Steven Armstrong)
|
||||
* Type __cdist: Use default paremeters (Daniel Heule)
|
||||
* Type __key_value: Use default paremeters (Daniel Heule)
|
||||
* Type __line: Use printf instead of echo for printing user input
|
||||
* Type __qemu_img: Use default paremeters (Daniel Heule)
|
||||
* Type __zypper_repo: Use default paremeters (Daniel Heule)
|
||||
* Type __zypper_service: Use default paremeters (Daniel Heule)
|
||||
|
||||
3.0.2: 2014-01-19
|
||||
* Documentation: Document all messages sent by types (Daniel Heule)
|
||||
|
|
Loading…
Reference in a new issue