Commit graph

209 commits

Author SHA1 Message Date
Jake Guffey
005c94556e Fix to support FreeBSD's stat(1)
Added check for OS type
Added FreeBSD syntax in case of $os=freebsd
2013-02-19 15:23:52 -05:00
Nico Schottelius
177c350747 use self.context, not self.local
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2013-02-14 15:45:58 +01:00
Nico Schottelius
d1e06504a2 merge back the dependency resolver into pseudo master
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2013-02-14 15:28:40 +01:00
Steven Armstrong
06fb7491fa prevent requirements from leaking into autorequired objects and creating circular references
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>

Conflicts:
	cdist/test/autorequire/__init__.py
2013-02-14 15:23:04 +01:00
Nico Schottelius
cb829ec8d0 introduce MissingObjectIdError
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2013-02-05 22:50:22 +01:00
Nico Schottelius
3b430c0d76 Merge pull request #156 from contradict/__git_permissions
__git respects --owner and --group, add --mode
2013-01-31 13:06:09 -08:00
Nico Schottelius
c620c2fa29 Merge pull request #155 from statianzo/directory-owner
Set permissions on existing directory
2013-01-31 13:05:10 -08:00
b772e09d53 Exit with no error if directory absent
Explorers need to handle the case of no directory.
2013-01-30 00:48:08 -08:00
Jason Staten
919707d6f9 Initialize variables to empty string
Set mode, group, etc. to an empty string to ensure that no external
environment variables can leak in.
2013-01-28 10:06:04 -07:00
Eivind Uggedal
1b25ef33b9 Slackware os and os_version explorer support. 2013-01-28 08:30:54 -05:00
3ff7621984 __git respects --owner and --group, add --mode
After checkout, chown and chmod as specified. If already present, but
not possessing correct permissions, run chown and chmod as needed.
2013-01-27 19:53:22 -08:00
Jason Staten
fc1a9ed27b directory permission explorers
The group, mode, and owner are now pulled from a explorers. If the
desired value matches the existing value, then no code is executed.

If the recursive flag is set, the permissions are applied every run.
2013-01-24 22:37:52 -07:00
Nico Schottelius
1d933dd5d3 do not need to create directories - git will do this - thanks to Steven
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2013-01-20 22:02:10 +01:00
Jason Staten
f16ac1911d Set permissions on existing directory
Previously, an existing directory would not have its permissions
modified by the __directory type. This change removes exiting early when
$state_is matches $state_should
2013-01-16 20:46:23 -07:00
f41b029ade Eliminiate excess output from machine explorer
command -v emits a string to stdout, silence this since we are only
interested in the return code.
2013-01-12 19:35:09 -08:00
Nico Schottelius
e03f5d08dd move / correct tests in object and config_install
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 21:14:23 +01:00
Nico Schottelius
ef45cd5ce0 fix removal of context alias in config_install
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 21:14:07 +01:00
Nico Schottelius
2732a4ba5c finally finish the dynamic resolver
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 21:10:18 +01:00
Nico Schottelius
527ec0889b remove unneeded fixtures
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 20:53:38 +01:00
Nico Schottelius
4fd27e76a7 support dry_run in stage_run_iterate as well
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 19:37:43 +01:00
Nico Schottelius
c270538072 add dry_run option to object_run
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 19:36:00 +01:00
Nico Schottelius
eb93d1bebd begin tests for config_install
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 15:33:50 +01:00
Nico Schottelius
369305f376 remove circularreferenceerror, because it is not being used anymore
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-19 15:33:41 +01:00
Nico Schottelius
8031c77700 fix some tests, break some others :-)
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-18 18:21:51 +01:00
Nico Schottelius
4faec43493 cleanup: remove call to old resolver
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-18 17:37:07 +01:00
Nico Schottelius
958d2d336f various cleanups
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-18 17:16:26 +01:00
Nico Schottelius
442dc767dd merge resolver test into object test - because object requirement solving is implemented
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-16 12:55:36 +01:00
Nico Schottelius
cd8b3cf68d finish rewrite of dependency resolver
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-16 12:47:13 +01:00
Nico Schottelius
6a8778e595 remove most of the resolver boilerplate, keep the interesting functions
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-14 08:43:52 +01:00
Nico Schottelius
81c92e5cc4 merge all resolver code into cdist_object (to gain the requirement searching code
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-14 08:41:56 +01:00
Nico Schottelius
16340b7d34 report on broken requirements, begin to satisfy requirements
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-14 08:41:17 +01:00
Nico Schottelius
6b6037d9bb todos for a simple resolver
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-13 06:44:55 +01:00
Nico Schottelius
2e81379c18 add very simple solver for dependencies
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-13 06:41:33 +01:00
Jake Guffey
7d7ad2630c Fix issue #147
--state absent should imply --stopped.
2012-12-11 11:15:21 -05:00
Nico Schottelius
67c7351bec install the right package, not pyro...
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-09 11:49:26 -08:00
Nico Schottelius
3167ececc6 add owner/group support to __git
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-05 23:16:03 +01:00
Nico Schottelius
8b91e3116a create working version of __git
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-12-05 23:07:21 +01:00
Nico Schottelius
5a3dc38e60 Merge branch 'master' into type__git 2012-12-05 22:46:07 +01:00
Steven Armstrong
56b6c95ed4 implement conf-dir from CDIST_PATH environment variable
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-30 16:46:17 +01:00
Nico Schottelius
f37f3d201c __ssh_authorized_key has been superseeded by __ssh_authorized_keys
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-30 14:41:47 +01:00
Steven Armstrong
1ef5bcaa74 new type: __ssh_authorized_keys - manage ssh authorized_keys files
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-30 11:59:38 +01:00
Steven Armstrong
3a419ed58b make type explorers executable after transfering them
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-30 10:31:15 +01:00
Nico Schottelius
868421bf16 Update examples to match new parameters
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-30 10:01:37 +01:00
Nico Schottelius
1bd27fffae __jail: started -> stopped, correct help output
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-27 10:57:10 +01:00
Nico Schottelius
fd8fdf8b54 Merge branch 'master' into type__jail_boolean 2012-11-27 08:58:14 +01:00
Nico Schottelius
8bf196fdc0 add helpful log message when resolving dependencies
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-20 22:41:38 +01:00
Nico Schottelius
b996dcbae1 bugfix __qemu_img
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-19 17:42:39 +01:00
Nico Schottelius
8408f433e9 remove type from here - goes into cdist-nico repo
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-19 17:27:35 +01:00
Nico Schottelius
a6452cfabd rename type to reflect new environment
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-19 17:24:38 +01:00
Nico Schottelius
3dfad32d4c add new type: __localch_kvm_vm
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-19 17:24:01 +01:00
Nico Schottelius
2fe647a1f7 Revert "implement before/after to declare dependencies and deprecate require"
Comment from asteven:
    Some problems showed up while updating the docs and tests.
    You should revert the merge for now.

This reverts commit 84770b9ef2.
2012-11-19 15:17:46 +01:00
Nico Schottelius
d4fc49fa6b begin manpage
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-19 15:13:57 +01:00
Nico Schottelius
d419722a24 adapt documentation to use boolean parameter as well
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-19 13:43:45 +01:00
Nico Schottelius
bb19902581 Merge branch 'master' into type__jail_boolean 2012-11-19 13:40:59 +01:00
Nico Schottelius
4718b81a08 Documentation cleanup (old pre-boolean variant)
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-19 13:40:35 +01:00
Nico Schottelius
67545eda79 Merge remote-tracking branch 'steven/issue_140' 2012-11-19 13:35:21 +01:00
Nico Schottelius
4ab51df2c8 Merge pull request #139 from asteven/2.1_before-after
implement before/after to declare dependencies and deprecate require
2012-11-19 04:27:09 -08:00
Nico Schottelius
4e3bab81d5 Merge pull request #138 from asteven/issue_138
file from stdin is broken
2012-11-19 04:17:43 -08:00
Steven Armstrong
7f0ae7928a fix state explorer to properly detect already existing ppa
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-19 13:05:23 +01:00
Steven Armstrong
84770b9ef2 implement before/after to declare dependencies and deprecate require
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>

--whitespace

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-19 12:29:49 +01:00
Steven Armstrong
6d430524f1 binary all the way, fixes issue #138
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-19 12:04:07 +01:00
Nico Schottelius
13968d16f6 change __jail to boolean, fixes #128
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-19 10:36:52 +01:00
Nico Schottelius
327a0f2844 remove --groups from __user type
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-18 23:31:19 +01:00
Steven Armstrong
b0ac5fe78d update __jail type to match changed signature of __directory: fixes #135
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-16 21:18:08 +01:00
Nico Schottelius
9c5926f697 Merge branch '__user_groups' of https://github.com/asteven/cdist 2012-11-16 15:58:57 +01:00
Nico Schottelius
500c194328 Merge branch 'issue_126' of https://github.com/asteven/cdist 2012-11-16 15:34:58 +01:00
Steven Armstrong
28e8632097 new type: __user_group: manage user groups
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-16 15:31:33 +01:00
Steven Armstrong
6c685e61d5 fixes #126
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-16 15:27:32 +01:00
Steven Armstrong
e4910933b1 __apt_ppa: /enabled/present/ -e /disabled/absent/
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-16 14:56:20 +01:00
Nico Schottelius
e6bf226036 convert __rvm_gmeset to boolean parameter
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-15 17:47:06 +01:00
Nico Schottelius
18dd0ebd33 ensure global and type explorers are executable on the remote side
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-15 17:37:15 +01:00
Nico Schottelius
80c6592ec8 add hints to related manpages
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-15 09:49:37 +01:00
Nico Schottelius
2fca87eda8 ++comment
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-15 09:34:19 +01:00
Nico Schottelius
a498330bd3 remove _read_stdin and open stdin file in non-binary mode
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-15 09:32:44 +01:00
Nico Schottelius
482ec3c5d8 make --default boolean in type __rvm_ruby
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 19:27:17 +01:00
Nico Schottelius
3d4bb3837f documentation cleanups
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 19:22:02 +01:00
Nico Schottelius
0eda57986f remove parameter changing code in __key_value (fixes #114,#36)
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 18:28:58 +01:00
Nico Schottelius
344e08ddda Archive __autofs types (fixes #116)
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 18:22:25 +01:00
Nico Schottelius
47424bf200 update __package* manpages
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 18:15:15 +01:00
Nico Schottelius
13d6644966 do not report errors on missing gemset
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 18:10:15 +01:00
Nico Schottelius
347c620eed indent
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 18:08:03 +01:00
Nico Schottelius
aeff2bcb0f indention
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 18:06:11 +01:00
Nico Schottelius
82830f191d link __process to __start_on_boot and vice versa
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 18:04:49 +01:00
Nico Schottelius
7814ece7b7 remove parameter changing code
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 18:01:30 +01:00
Nico Schottelius
2cfa046cdd indentions, whitespace
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 17:57:47 +01:00
Nico Schottelius
8ab408f890 remove parameter change code
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 17:52:05 +01:00
Nico Schottelius
7a44f30574 simplify manifest
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 17:47:55 +01:00
Nico Schottelius
a0add17cf8 ++exit 1
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 17:44:54 +01:00
Nico Schottelius
265d1af56a rename vm to diskimage, ensure state is setup
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 17:40:39 +01:00
Nico Schottelius
ace897de25 simplify timezone manifest
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 17:28:27 +01:00
Steven Armstrong
6adb20b829 __ssh_authorized_key: /installed/present/
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-07 16:57:31 +01:00
Steven Armstrong
324a88c435 __timezone: set timezone in /etc/timezone on debuntu
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-07 16:57:31 +01:00
Steven Armstrong
f769b395c2 __file: implement --state exists
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-07 16:57:31 +01:00
Steven Armstrong
8f525fbc83 __apt_update_index: ignore top level directory
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-07 16:57:30 +01:00
Steven Armstrong
7e951fd4d1 __apt_ppa: /installed/present/
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-07 16:57:30 +01:00
Steven Armstrong
03cc2a63b1 types to handle autofs maps
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-07 16:57:30 +01:00
Steven Armstrong
7a1f81dc7b remove install types
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
2012-11-07 16:54:34 +01:00
Nico Schottelius
1bb3c82d72 cleanup some logging stuff
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 11:47:26 +01:00
Nico Schottelius
7d57d1df79 update emulator tests to work again
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 11:05:40 +01:00
Nico Schottelius
e2e1d0bb67 include %
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-11-07 11:05:29 +01:00