Merge remote-tracking branch 'ungleich/master' into parallel-global-explorers-execution

This commit is contained in:
Darko Poljak 2016-08-14 22:27:39 +02:00
commit f858191976
127 changed files with 2156 additions and 238 deletions

View file

@ -55,5 +55,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011-2014 Steven Armstrong. Free use of this software is Copyright \(C) 2011-2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -45,5 +45,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011-2014 Steven Armstrong. Free use of this software is Copyright \(C) 2011-2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -36,5 +36,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2014 Steven Armstrong. Free use of this software is Copyright \(C) 2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -44,5 +44,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011-2014 Steven Armstrong. Free use of this software is Copyright \(C) 2011-2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -63,5 +63,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011-2014 Steven Armstrong. Free use of this software is Copyright \(C) 2011-2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -35,5 +35,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is Copyright \(C) 2011 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -76,5 +76,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2013 Steven Armstrong. Free use of this software is Copyright \(C) 2013 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -63,5 +63,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2014 Nico Schottelius. Free use of this software is Copyright \(C) 2014 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -57,5 +57,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2013 Nico Schottelius. Free use of this software is Copyright \(C) 2013 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -49,5 +49,7 @@ Daniel Maher <phrawzty+cdist--@--gmail.com>
COPYING COPYING
------- -------
Copyright \(C) 2011 Daniel Maher. Free use of this software is granted under Copyright \(C) 2011 Daniel Maher. You can redistribute it
the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -58,5 +58,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -48,5 +48,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -175,5 +175,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -96,5 +96,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015-2016 Steven Armstrong. Free use of this software is Copyright \(C) 2015-2016 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -36,5 +36,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -76,5 +76,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -135,5 +135,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -78,5 +78,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015-2016 Steven Armstrong. Free use of this software is Copyright \(C) 2015-2016 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -67,5 +67,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -60,5 +60,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -57,5 +57,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -57,5 +57,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -53,5 +53,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -77,5 +77,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -53,5 +53,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -78,5 +78,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011-2013 Steven Armstrong. Free use of this software is Copyright \(C) 2011-2013 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -47,5 +47,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011-2014 Nico Schottelius. Free use of this software is Copyright \(C) 2011-2014 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -95,5 +95,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011 Nico Schottelius. Free use of this software is Copyright \(C) 2011 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -53,5 +53,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2014 Nico Schottelius. Free use of this software is Copyright \(C) 2014 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -106,5 +106,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011-2013 Nico Schottelius. Free use of this software is Copyright \(C) 2011-2013 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -75,5 +75,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2015 Nico Schottelius. Free use of this software is Copyright \(C) 2015 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -54,5 +54,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2012 Nico Schottelius. Free use of this software is Copyright \(C) 2012 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -74,5 +74,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011-2015 Steven Armstrong. Free use of this software is Copyright \(C) 2011-2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -46,5 +46,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is Copyright \(C) 2012 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -39,5 +39,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2013 Nico Schottelius. Free use of this software is Copyright \(C) 2013 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -60,5 +60,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2013 Nico Schottelius. Free use of this software is Copyright \(C) 2013 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -41,5 +41,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011 Nico Schottelius. Free use of this software is Copyright \(C) 2011 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -118,5 +118,7 @@ Jake Guffey <jake.guffey--@--jointheirstm.org>
COPYING COPYING
------- -------
Copyright \(C) 2012,2016 Jake Guffey. Free use of this software is Copyright \(C) 2012,2016 Jake Guffey. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -117,5 +117,7 @@ Jake Guffey <jake.guffey--@--jointheirstm.org>
COPYING COPYING
------- -------
Copyright \(C) 2012-2016 Jake Guffey. Free use of this software is Copyright \(C) 2012-2016 Jake Guffey. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -118,5 +118,7 @@ Jake Guffey <jake.guffey--@--eprotex.com>
COPYING COPYING
------- -------
Copyright \(C) 2012-2016 Jake Guffey. Free use of this software is Copyright \(C) 2012-2016 Jake Guffey. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -88,5 +88,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is Copyright \(C) 2011 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -0,0 +1,37 @@
cdist-type__keyboard(7)
=======================
NAME
----
cdit-type__keyboard - Set keyboard layout
DESCRIPTION
-----------
This cdist type allows you to modify keyboard layout.
REQUIRED PARAMETERS
-------------------
type
Any valid type, for example "us"
EXAMPLES
--------
.. code-block:: sh
# Set keyboard type to "us"
__keyboard --type "us"
AUTHORS
-------
Carlos Ortigoza <carlos.ortigoza--@--ungleich.ch>
COPYING
-------
Copyright \(C) 2016 Carlos Ortigoza. Free use of this software is
granted under the terms of the GNU General Public License v3 or later (GPLv3+).

View file

@ -0,0 +1,50 @@
#!/bin/sh
#
# Carlos Ortigoza (carlos.ortigoza 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/>.
#
#
# Configure keyboard type by modifying /etc/sysconfig/keyboard file.
#
os=$(cat "$__global/explorer/os")
keyboard_type="$(cat "$__object/parameter/type")"
case "$os" in
centos)
__file /etc/sysconfig/keyboard \
--owner root --group root --mode 644 \
--state exists
require="__file/etc/sysconfig/keyboard" \
__key_value KEYTABLE \
--file /etc/sysconfig/keyboard \
--delimiter '=' \
--value "\"$keyboard_type\""
require="__file/etc/sysconfig/keyboard" \
__key_value LAYOUT \
--file /etc/sysconfig/keyboard \
--delimiter '=' \
--value "\"$keyboard_type\""
;;
*)
echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2
echo "Please contribute an implementation for it if you can." >&2
exit 1
;;
esac

View file

@ -0,0 +1 @@
type

View file

View file

@ -71,5 +71,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2012-2013 Nico Schottelius. Free use of this software is Copyright \(C) 2012-2013 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -54,5 +54,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is Copyright \(C) 2011-2012 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -42,5 +42,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011 Nico Schottelius. Free use of this software is Copyright \(C) 2011 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -78,5 +78,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2014 Steven Armstrong. Free use of this software is Copyright \(C) 2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -43,5 +43,7 @@ Benedikt Koeppel <code@benediktkoeppel.ch>
COPYING COPYING
------- -------
Copyright \(C) 2012 Benedikt Koeppel. Free use of this software is Copyright \(C) 2012 Benedikt Koeppel. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -58,5 +58,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is Copyright \(C) 2011 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -56,5 +56,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is Copyright \(C) 2011-2012 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -57,5 +57,7 @@ Thomas Oettli <otho--@--sfs.biz>
COPYING COPYING
------- -------
Copyright \(C) 2013 Thomas Oettli. Free use of this software is Copyright \(C) 2013 Thomas Oettli. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -46,5 +46,7 @@ Thomas Oettli <otho--@--sfs.biz>
COPYING COPYING
------- -------
Copyright \(C) 2013 Thomas Oettli. Free use of this software is Copyright \(C) 2013 Thomas Oettli. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -49,5 +49,7 @@ Christian G. Warden <cwarden@xerus.org>
COPYING COPYING
------- -------
Copyright \(C) 2012 SwellPath, Inc. Free use of this software is Copyright \(C) 2012 SwellPath, Inc. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -49,5 +49,7 @@ Giel van Schijndel <giel+cdist--@--mortis.eu>
COPYING COPYING
------- -------
Copyright \(C) 2012 Giel van Schijndel. Free use of this software is Copyright \(C) 2012 Giel van Schijndel. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -52,5 +52,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is Copyright \(C) 2011-2012 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -59,5 +59,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2012 Nico Schottelius. Free use of this software is Copyright \(C) 2012 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -64,5 +64,7 @@ Jake Guffey <jake.guffey--@--eprotex.com>
COPYING COPYING
------- -------
Copyright \(C) 2012 Jake Guffey. Free use of this software is Copyright \(C) 2012 Jake Guffey. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -95,5 +95,7 @@ Jake Guffey <jake.guffey--@--eprotex.com>
COPYING COPYING
------- -------
Copyright \(C) 2014 Jake Guffey. Free use of this software is Copyright \(C) 2014 Jake Guffey. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -49,5 +49,8 @@ Chase Allen James <nx-cdist@nu-ex.com>
COPYING COPYING
------- -------
Copyright \(C) 2011 Chase Allen James. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3). Copyright \(C) 2011 Chase Allen James. 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.

View file

@ -47,5 +47,8 @@ Ricardo Catalinas Jiménez <jimenezrick--@--gmail.com>
COPYING COPYING
------- -------
Copyright \(C) 2014 Ricardo Catalinas Jiménez. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3). Copyright \(C) 2014 Ricardo Catalinas Jiménez. 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.

View file

@ -44,8 +44,10 @@ AUTHORS
------- -------
Ricardo Catalinas Jiménez <jimenezrick--@--gmail.com> Ricardo Catalinas Jiménez <jimenezrick--@--gmail.com>
COPYING COPYING
------- -------
Copyright \(C) 2014 Ricardo Catalinas Jiménez. Free use of this software is
granted under the terms of the GNU General Public License version 3 (GPLv3). Copyright \(C) 2014 Ricardo Catalinas Jiménez. 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.

View file

@ -59,5 +59,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is Copyright \(C) 2011-2012 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -68,4 +68,6 @@ COPYING
------- -------
Copyright \(C) 2012 Nico Schottelius. Copyright \(C) 2012 Nico Schottelius.
Copyright \(C) 2013 Daniel Heule. Copyright \(C) 2013 Daniel Heule.
Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -69,5 +69,7 @@ Dominique Roux <dominique.roux4@gmail.com>
COPYING COPYING
------- -------
Copyright \(C) 2015 Dominique Roux. Free use of this software is Copyright \(C) 2015 Dominique Roux. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -45,5 +45,7 @@ Dominique Roux <dominique.roux4@gmail.com>
COPYING COPYING
------- -------
Copyright \(C) 2015 Dominique Roux. Free use of this software is Copyright \(C) 2015 Dominique Roux. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -49,5 +49,7 @@ Jake Guffey <jake.guffey--@--eprotex.com>
COPYING COPYING
------- -------
Copyright \(C) 2012 Jake Guffey. Free use of this software is Copyright \(C) 2012 Jake Guffey. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -49,5 +49,7 @@ Jake Guffey <jake.guffey--@--eprotex.com>
COPYING COPYING
------- -------
Copyright \(C) 2012 Jake Guffey. Free use of this software is Copyright \(C) 2012 Jake Guffey. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -36,5 +36,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is Copyright \(C) 2012 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -78,6 +78,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is Copyright \(C) 2012 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -48,5 +48,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is Copyright \(C) 2012 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -36,5 +36,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is Copyright \(C) 2012 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -36,5 +36,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is Copyright \(C) 2012 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -40,5 +40,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is Copyright \(C) 2011 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -61,5 +61,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is Copyright \(C) 2011 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -68,5 +68,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2011-2012 Nico Schottelius. Free use of this software is Copyright \(C) 2011-2012 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -47,5 +47,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2012-2014 Nico Schottelius. Free use of this software is Copyright \(C) 2012-2014 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -43,5 +43,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2012-2014 Nico Schottelius. Free use of this software is Copyright \(C) 2012-2014 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -108,5 +108,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2015 Nico Schottelius. Free use of this software is Copyright \(C) 2015 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -65,5 +65,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2014 Steven Armstrong. Free use of this software is Copyright \(C) 2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -115,5 +115,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2012-2014 Steven Armstrong. Free use of this software is Copyright \(C) 2012-2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -43,5 +43,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2014 Nico Schottelius. Free use of this software is Copyright \(C) 2014 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -109,5 +109,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2015 Steven Armstrong. Free use of this software is Copyright \(C) 2015 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -55,5 +55,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2012 Nico Schottelius. Free use of this software is Copyright \(C) 2012 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -40,5 +40,7 @@ Nico Schottelius <nico-cdist--@--schottelius.org>
COPYING COPYING
------- -------
Copyright \(C) 2013 Nico Schottelius. Free use of this software is Copyright \(C) 2013 Nico Schottelius. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -94,5 +94,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2011 Steven Armstrong. Free use of this software is Copyright \(C) 2011 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -46,5 +46,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2012 Steven Armstrong. Free use of this software is Copyright \(C) 2012 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -118,5 +118,7 @@ Steven Armstrong <steven-cdist--@--armstrong.cc>
COPYING COPYING
------- -------
Copyright \(C) 2014 Steven Armstrong. Free use of this software is Copyright \(C) 2014 Steven Armstrong. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -67,5 +67,7 @@ Daniel Heule <hda--@--sfs.biz>
COPYING COPYING
------- -------
Copyright \(C) 2013 Daniel Heule. Free use of this software is Copyright \(C) 2013 Daniel Heule. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -60,5 +60,7 @@ Daniel Heule <hda--@--sfs.biz>
COPYING COPYING
------- -------
Copyright \(C) 2013 Daniel Heule. Free use of this software is Copyright \(C) 2013 Daniel Heule. You can redistribute it
granted under the terms of the GNU General Public License version 3 (GPLv3). 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.

View file

@ -28,6 +28,7 @@ import time
import pprint import pprint
import itertools import itertools
import tempfile import tempfile
import socket
import cdist import cdist
@ -74,7 +75,7 @@ class Config(object):
self.local = local self.local = local
self.remote = remote self.remote = remote
self.log = logging.getLogger(self.local.target_host) self.log = logging.getLogger(self.local.target_host[0])
self.dry_run = dry_run self.dry_run = dry_run
self.jobs = jobs self.jobs = jobs
@ -230,15 +231,39 @@ class Config(object):
log.debug("remote_copy for host \"{}\": {}".format( log.debug("remote_copy for host \"{}\": {}".format(
host, remote_copy)) host, remote_copy))
try:
# getaddrinfo returns a list of 5-tuples:
# (family, type, proto, canonname, sockaddr)
# where sockaddr is:
# (address, port) for AF_INET,
# (address, port, flow_info, scopeid) for AF_INET6
ip_addr = socket.getaddrinfo(
host, None, type=socket.SOCK_STREAM)[0][4][0]
# gethostbyaddr returns triple
# (hostname, aliaslist, ipaddrlist)
host_name = socket.gethostbyaddr(ip_addr)[0]
except socket.gaierror as e:
log.error("{}: {}".format(e[0], e[1]))
# in case of error provide empty value
host_name = None
try:
host_fqdn = socket.getfqdn(host)
except socket.herror as e:
log.error("{}: {}".format(e[0], e[1]))
# in case of error provide empty value
host_fqdn = None
target_host = (host, host_name, host_fqdn)
local = cdist.exec.local.Local( local = cdist.exec.local.Local(
target_host=host, target_host=target_host,
base_root_path=host_base_path, base_root_path=host_base_path,
host_dir_name=host_dir_name, host_dir_name=host_dir_name,
initial_manifest=args.manifest, initial_manifest=args.manifest,
add_conf_dirs=args.conf_dir) add_conf_dirs=args.conf_dir)
remote = cdist.exec.remote.Remote( remote = cdist.exec.remote.Remote(
target_host=host, target_host=target_host,
remote_exec=remote_exec, remote_exec=remote_exec,
remote_copy=remote_copy) remote_copy=remote_copy)

View file

@ -36,6 +36,9 @@ common:
env: env:
PATH: prepend directory with type emulator symlinks == local.bin_path PATH: prepend directory with type emulator symlinks == local.bin_path
__target_host: the target host we are working on __target_host: the target host we are working on
__target_hostname: the target hostname provided from __target_host
__target_fqdn: the target's fully qualified domain name provided from
__target_host
__cdist_manifest: full qualified path of the manifest == script __cdist_manifest: full qualified path of the manifest == script
__cdist_type_base_path: full qualified path to the directory where __cdist_type_base_path: full qualified path to the directory where
types are defined for use in type emulator types are defined for use in type emulator
@ -46,6 +49,9 @@ gencode-local
env: env:
__target_host: the target host we are working on __target_host: the target host we are working on
__target_hostname: the target hostname provided from __target_host
__target_fqdn: the target's fully qualified domain name provided from
__target_host
__global: full qualified path to the global __global: full qualified path to the global
output dir == local.out_path output dir == local.out_path
__object: full qualified path to the object's dir __object: full qualified path to the object's dir
@ -61,6 +67,9 @@ gencode-remote
env: env:
__target_host: the target host we are working on __target_host: the target host we are working on
__target_hostname: the target hostname provided from __target_host
__target_fqdn: the target's fully qualified domain name provided from
__target_host
__global: full qualified path to the global __global: full qualified path to the global
output dir == local.out_path output dir == local.out_path
__object: full qualified path to the object's dir __object: full qualified path to the object's dir
@ -89,12 +98,17 @@ class Code(object):
"""Generates and executes cdist code scripts. """Generates and executes cdist code scripts.
""" """
# target_host is tuple (target_host, target_hostname, target_fqdn)
def __init__(self, target_host, local, remote): def __init__(self, target_host, local, remote):
self.target_host = target_host self.target_host = target_host[0]
self.target_hostname = target_host[1]
self.target_fqdn = target_host[2]
self.local = local self.local = local
self.remote = remote self.remote = remote
self.env = { self.env = {
'__target_host': self.target_host, '__target_host': self.target_host[0],
'__target_hostname': self.target_host[1],
'__target_fqdn': self.target_host[2],
'__global': self.local.base_path, '__global': self.local.base_path,
'__files': self.local.files_path, '__files': self.local.files_path,
} }

View file

@ -74,14 +74,16 @@ class Explorer(object):
self.local = local self.local = local
self.remote = remote self.remote = remote
self.env = { self.env = {
'__target_host': self.target_host, '__target_host': self.target_host[0],
'__target_hostname': self.target_host[1],
'__target_fqdn': self.target_host[2],
'__explorer': self.remote.global_explorer_path, '__explorer': self.remote.global_explorer_path,
} }
self._type_explorers_transferred = [] self._type_explorers_transferred = []
self.jobs = jobs self.jobs = jobs
def _open_logger(self): def _open_logger(self):
self.log = logging.getLogger(self.target_host) self.log = logging.getLogger(self.target_host[0])
# global # global

View file

@ -32,6 +32,9 @@ common:
env: env:
PATH: prepend directory with type emulator symlinks == local.bin_path PATH: prepend directory with type emulator symlinks == local.bin_path
__target_host: the target host we are working on __target_host: the target host we are working on
__target_hostname: the target hostname provided from __target_host
__target_fqdn: the target's fully qualified domain name provided from
__target_host
__global: full qualified path to the global __global: full qualified path to the global
output dir == local.out_path output dir == local.out_path
__cdist_manifest: full qualified path of the manifest == script __cdist_manifest: full qualified path of the manifest == script
@ -95,14 +98,16 @@ class Manifest(object):
self.target_host = target_host self.target_host = target_host
self.local = local self.local = local
self.log = logging.getLogger(self.target_host) self.log = logging.getLogger(self.target_host[0])
self.env = { self.env = {
'PATH': "%s:%s" % (self.local.bin_path, os.environ['PATH']), 'PATH': "%s:%s" % (self.local.bin_path, os.environ['PATH']),
# for use in type emulator # for use in type emulator
'__cdist_type_base_path': self.local.type_path, '__cdist_type_base_path': self.local.type_path,
'__global': self.local.base_path, '__global': self.local.base_path,
'__target_host': self.target_host, '__target_host': self.target_host[0],
'__target_hostname': self.target_host[1],
'__target_fqdn': self.target_host[2],
'__files': self.local.files_path, '__files': self.local.files_path,
} }

View file

@ -64,7 +64,11 @@ class Emulator(object):
try: try:
self.global_path = self.env['__global'] self.global_path = self.env['__global']
self.target_host = self.env['__target_host'] self.target_host = (
self.env['__target_host'],
self.env['__target_hostname'],
self.env['__target_fqdn']
)
# Internal variables # Internal variables
self.object_source = self.env['__cdist_manifest'] self.object_source = self.env['__cdist_manifest']
@ -101,7 +105,7 @@ class Emulator(object):
else: else:
logging.root.setLevel(logging.INFO) logging.root.setLevel(logging.INFO)
self.log = logging.getLogger(self.target_host) self.log = logging.getLogger(self.target_host[0])
def commandline(self): def commandline(self):
"""Parse command line""" """Parse command line"""

View file

@ -83,7 +83,7 @@ class Local(object):
return None return None
def _init_log(self): def _init_log(self):
self.log = logging.getLogger(self.target_host) self.log = logging.getLogger(self.target_host[0])
# logger is not pickable, so remove it when we pickle # logger is not pickable, so remove it when we pickle
def __getstate__(self): def __getstate__(self):
@ -196,8 +196,11 @@ class Local(object):
if env is None: if env is None:
env = os.environ.copy() env = os.environ.copy()
# Export __target_host for use in __remote_{copy,exec} scripts # Export __target_host, __target_hostname, __target_fqdn
env['__target_host'] = self.target_host # for use in __remote_{copy,exec} scripts
env['__target_host'] = self.target_host[0]
env['__target_hostname'] = self.target_host[1]
env['__target_fqdn'] = self.target_host[2]
# Export for emulator # Export for emulator
env['__cdist_object_marker'] = self.object_marker_name env['__cdist_object_marker'] = self.object_marker_name

View file

@ -72,7 +72,7 @@ class Remote(object):
self._init_env() self._init_env()
def _open_logger(self): def _open_logger(self):
self.log = logging.getLogger(self.target_host) self.log = logging.getLogger(self.target_host[0])
# logger is not pickable, so remove it when we pickle # logger is not pickable, so remove it when we pickle
def __getstate__(self): def __getstate__(self):
@ -118,12 +118,12 @@ class Remote(object):
command = self._copy.split() command = self._copy.split()
path = os.path.join(source, f) path = os.path.join(source, f)
command.extend([path, '{0}:{1}'.format( command.extend([path, '{0}:{1}'.format(
self.target_host, destination)]) self.target_host[0], destination)])
self._run_command(command) self._run_command(command)
else: else:
command = self._copy.split() command = self._copy.split()
command.extend([source, '{0}:{1}'.format( command.extend([source, '{0}:{1}'.format(
self.target_host, destination)]) self.target_host[0], destination)])
self._run_command(command) self._run_command(command)
def transfer_dir_parallel(self, source, destination, jobs): def transfer_dir_parallel(self, source, destination, jobs):
@ -145,7 +145,7 @@ class Remote(object):
command = self._copy.split() command = self._copy.split()
path = os.path.join(source, f) path = os.path.join(source, f)
command.extend([path, '{0}:{1}'.format( command.extend([path, '{0}:{1}'.format(
self.target_host, destination)]) self.target_host[0], destination)])
commands.append(command) commands.append(command)
results = [ results = [
pool.apply_async(self._run_command, (cmd,)) pool.apply_async(self._run_command, (cmd,))
@ -178,7 +178,7 @@ class Remote(object):
""" """
# prefix given command with remote_exec # prefix given command with remote_exec
cmd = self._exec.split() cmd = self._exec.split()
cmd.append(self.target_host) cmd.append(self.target_host[0])
# FIXME: replace this by -o SendEnv name -o SendEnv name ... to ssh? # FIXME: replace this by -o SendEnv name -o SendEnv name ... to ssh?
# can't pass environment to remote side, so prepend command with # can't pass environment to remote side, so prepend command with
@ -215,9 +215,12 @@ class Remote(object):
assert isinstance(command, (list, tuple)), ( assert isinstance(command, (list, tuple)), (
"list or tuple argument expected, got: %s" % command) "list or tuple argument expected, got: %s" % command)
# export target_host for use in __remote_{exec,copy} scripts # export target_host, target_hostname, target_fqdn
# for use in __remote_{exec,copy} scripts
os_environ = os.environ.copy() os_environ = os.environ.copy()
os_environ['__target_host'] = self.target_host os_environ['__target_host'] = self.target_host[0]
os_environ['__target_hostname'] = self.target_host[1]
os_environ['__target_fqdn'] = self.target_host[2]
self.log.debug("Remote run: %s", command) self.log.debug("Remote run: %s", command)
try: try:

View file

@ -22,6 +22,7 @@
import logging import logging
import os import os
import subprocess import subprocess
import tempfile
# initialise cdist # initialise cdist
import cdist.exec.local import cdist.exec.local
@ -38,9 +39,20 @@ class Shell(object):
self.shell = shell self.shell = shell
self.target_host = "cdist-shell-no-target-host" self.target_host = (
"cdist-shell-no-target-host",
"cdist-shell-no-target-host",
"cdist-shell-no-target-host",
)
host_dir_name = cdist.str_hash(self.target_host[0])
base_root_path = tempfile.mkdtemp()
host_base_path = os.path.join(base_root_path, host_dir_name)
self.local = cdist.exec.local.Local( self.local = cdist.exec.local.Local(
target_host=self.target_host) target_host=self.target_host,
base_root_path=host_base_path,
host_dir_name=host_dir_name)
def _init_shell(self): def _init_shell(self):
"""Select shell to execute, if not specified by user""" """Select shell to execute, if not specified by user"""
@ -59,7 +71,9 @@ class Shell(object):
'__cdist_type_base_path': self.local.type_path, '__cdist_type_base_path': self.local.type_path,
'__cdist_manifest': "cdist shell", '__cdist_manifest': "cdist shell",
'__global': self.local.base_path, '__global': self.local.base_path,
'__target_host': self.target_host, '__target_host': self.target_host[0],
'__target_hostname': self.target_host[1],
'__target_fqdn': self.target_host[2],
'__manifest': self.local.manifest_path, '__manifest': self.local.manifest_path,
'__explorer': self.local.global_explorer_path, '__explorer': self.local.global_explorer_path,
'__files': self.local.files_path, '__files': self.local.files_path,

View file

@ -37,7 +37,11 @@ class CdistTestCase(unittest.TestCase):
remote_exec = os.path.join(global_fixtures_dir, "remote", "exec") remote_exec = os.path.join(global_fixtures_dir, "remote", "exec")
remote_copy = os.path.join(global_fixtures_dir, "remote", "copy") remote_copy = os.path.join(global_fixtures_dir, "remote", "copy")
target_host = 'cdisttesthost' target_host = (
'cdisttesthost',
'cdisttesthost',
'cdisttesthost',
)
def mkdtemp(self, **kwargs): def mkdtemp(self, **kwargs):
return tempfile.mkdtemp(prefix='tmp.cdist.test.', **kwargs) return tempfile.mkdtemp(prefix='tmp.cdist.test.', **kwargs)

Some files were not shown because too many files have changed in this diff Show more