forked from ungleich-public/cdist
Created explorers, man page, jailbase placeholder. Began initial development of gencode-remote.
This commit is contained in:
parent
d5b015b268
commit
d082815c81
8 changed files with 187 additions and 0 deletions
27
conf/type/__jail/explorer/present
Executable file
27
conf/type/__jail/explorer/present
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2012 Jake Guffey (jake.guffey at eprotex.com)
|
||||||
|
#
|
||||||
|
# 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/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# See if the requested jail exists
|
||||||
|
#
|
||||||
|
|
||||||
|
name=$__object_id
|
||||||
|
|
||||||
|
[ -d "/usr/jail/$name" ] && echo "EXISTS"
|
||||||
|
|
28
conf/type/__jail/explorer/status
Executable file
28
conf/type/__jail/explorer/status
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2012 Jake Guffey (jake.guffey at eprotex.com)
|
||||||
|
#
|
||||||
|
# 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/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# See if the requested jail is started
|
||||||
|
#
|
||||||
|
|
||||||
|
name=$__object_id
|
||||||
|
|
||||||
|
jls_output=$(jls | grep "[ ]\/usr\/jail\/$name\$")
|
||||||
|
[ -n "$jls_output" ] && echo "STARTED"
|
||||||
|
|
1
conf/type/__jail/files/jailbase
Normal file
1
conf/type/__jail/files/jailbase
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Create a tarball jailbase.tgz in this directory containing the base filesystem for a jail.
|
44
conf/type/__jail/gencode-remote
Normal file → Executable file
44
conf/type/__jail/gencode-remote
Normal file → Executable file
|
@ -0,0 +1,44 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2012 Jake Guffey (jake.guffey at eprotex.com)
|
||||||
|
#
|
||||||
|
# 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/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# The __jail type creates, configures, and deletes FreeBSD jails for use as
|
||||||
|
# virtual machines.
|
||||||
|
#
|
||||||
|
|
||||||
|
jaildir="/usr/jail"
|
||||||
|
present="$(cat "$__object/explorer/present")"
|
||||||
|
status="$(cat "$__object/explorer/status")"
|
||||||
|
state="$(cat "$__object/parameter/state")"
|
||||||
|
name="$__object_id"
|
||||||
|
|
||||||
|
if [ -f "$__object/parameter/started" ]; then
|
||||||
|
started="$(cat "$__object/parameter/started")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
if [ "$present" = "EXISTS" ]; then
|
||||||
|
# blah
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$status" = "STARTED" ]; then
|
||||||
|
# blah
|
||||||
|
fi
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
cdist-type__jail(7)
|
||||||
|
==========================
|
||||||
|
Jake Guffey <jake.guffey--@--eprotex.com>
|
||||||
|
|
||||||
|
|
||||||
|
NAME
|
||||||
|
----
|
||||||
|
cdist-type__jail - Manage FreeBSD jails
|
||||||
|
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
-----------
|
||||||
|
This type is used on FreeBSD to manage jails.
|
||||||
|
|
||||||
|
|
||||||
|
REQUIRED PARAMETERS
|
||||||
|
-------------------
|
||||||
|
state::
|
||||||
|
Either "present" or "absent."
|
||||||
|
|
||||||
|
|
||||||
|
OPTIONAL PARAMETERS
|
||||||
|
-------------------
|
||||||
|
started::
|
||||||
|
Either "true" or "false."
|
||||||
|
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
--------
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
# Create a jail called www
|
||||||
|
__jail www --state present
|
||||||
|
|
||||||
|
# Remove the jail called www
|
||||||
|
__jail www --state absent
|
||||||
|
|
||||||
|
# Ensure that the jail called www is started
|
||||||
|
__jail www --state present --started true
|
||||||
|
|
||||||
|
# Use the name variable explicitly
|
||||||
|
__jail thisjail --state present --name www
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
SEE ALSO
|
||||||
|
--------
|
||||||
|
- cdist-type(7)
|
||||||
|
|
||||||
|
|
||||||
|
COPYING
|
||||||
|
-------
|
||||||
|
Copyright \(C) 2012 Jake Guffey. Free use of this software is
|
||||||
|
granted under the terms of the GNU General Public License version 3 (GPLv3).
|
31
conf/type/__jail/manifest
Executable file
31
conf/type/__jail/manifest
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# 2012 Jake Guffey (jake.guffey at eprotex.com)
|
||||||
|
#
|
||||||
|
# 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/>.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# The __jail type creates, configures, and deletes FreeBSD jails for use as
|
||||||
|
# virtual machines.
|
||||||
|
#
|
||||||
|
|
||||||
|
#FIXME: /usr/jail should never be hardcoded in this type
|
||||||
|
#FIXME: jailbase.tgz should not be hardcoded in this file
|
||||||
|
|
||||||
|
jailbase="/usr/jail/jailbase.tgz"
|
||||||
|
|
||||||
|
__rsyncer "$jailbase" --source "$__object/files/jailbase.tgz"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
started
|
|
@ -0,0 +1 @@
|
||||||
|
state
|
Loading…
Reference in a new issue