Commit graph

48 commits

Author SHA1 Message Date
Jan-Piet Mens
60e0410298 Tweak DOCUMENTATION YAML as per latest 991 2012-09-19 16:09:26 +02:00
Aleksej Romanov
eefe66f1cc Squashed commit of the following:
commit 80a26a8175b779b707bc08e9d28c451c30ee4ada
Merge: b25b9fd 61e9b27
Author: Michael DeHaan <michael.dehaan@gmail.com>
Date:   Tue Sep 18 21:01:47 2012 -0400

    Merge branch 'devel' of git://github.com/alopropoz/ansible into file-force

commit 61e9b27df2
Merge: 3f6f329 16bf3e1
Author: Aleksej Romanov <alopropoz2@yandex.ru>
Date:   Thu Sep 13 20:48:02 2012 +0700

    Merge remote branch 'upstream/devel' into devel

commit 3f6f3291df
Author: Aleksej Romanov <alopropoz2@yandex.ru>
Date:   Thu Sep 13 20:41:31 2012 +0700

    'force' option for 'file' module.

commit 6223bba941
Author: Aleksej Romanov <alopropoz2@yandex.ru>
Date:   Thu Sep 13 20:40:19 2012 +0700

    changed = True when changing symlink referent, #1008. Needed for tests.
2012-09-18 21:04:42 -04:00
Dag Wieërs
9d4f70f0ad Handle special files just like normal files
As discussed in #923
2012-08-21 23:48:18 +02:00
Michael DeHaan
75bbd73173 Fix indentation 2012-08-11 18:39:09 -04:00
Michael DeHaan
477ca2ed1a Make pep8 tests run against the library directory as well, and associated tweaks (mostly to indentation) in the library
directory.
2012-08-11 12:35:58 -04:00
Michael DeHaan
36527ca9d5 Merge pull request #838 from sfromm/issue825
Update file module to not recurse when setting ownership
2012-08-10 17:02:23 -07:00
Stephen Fromm
94696fb88e Update file module to not recurse when setting ownership
This updates set_owner_if_different() and set_group_if_different()
to not implicitly recurse when setting ownership (whether user or
group).  It drops the os.system() call and replaces it with os.chown().
Resolves issue #825.

The recursion should be explicit.  A recurse=yes|no option should be
added to the file module.
2012-08-09 22:59:39 -07:00
Michael DeHaan
9e934acfca Relative symlinks don't really work (module bug) and would be confusing anyway, better to be explicit. 2012-08-09 21:46:03 -04:00
Michael DeHaan
faed4b5a33 whitespace + remove deprecated YAML parser (migration script lives in examples/scripts and warning was added
in 0.6 release)
2012-08-06 20:07:02 -04:00
Michael DeHaan
7e9e29011e Add encoding lines to python modules such that they can take unicode options if they are fed them, since the
AnsibleModule stuff no longer base64 encodes for simplicity and speed reasons.
2012-08-02 21:29:10 -04:00
Stephen Fromm
d0892c19ad Add setype to file's argument_spec and remove secontext
secontext is used internally and should not be in argument_spec
2012-08-01 22:24:09 -07:00
Stephen Fromm
52afacf475 Fix module_fail_json call when symlink src does not exist 2012-08-01 22:23:02 -07:00
Michael DeHaan
ed14312ad6 reinstate invalid argument checks where possible, daisy chainee/chained modules turn it off 2012-08-01 19:42:31 -04:00
Michael DeHaan
0a3ebdb6d5 Module consistency and make daisy chaining work with invalid arguments detection. 2012-08-01 00:22:02 -04:00
Michael DeHaan
ce5f3dd148 Port the file module over to the new common code infrastructure + cleanup some redundant imports since the module code already imports those things. 2012-07-30 21:50:32 -04:00
Jan-Piet Mens
628b289ab3 Fix file module to support = in args; remove superflous call in get_url 2012-07-24 06:40:34 +02:00
Jeremy Smitherman
e5a6627d10 Removed unused recurse option in file module. 2012-07-12 02:04:51 -04:00
Derek Carter
fc4ae3e270 remove UID/GID from output 2012-07-01 17:38:17 -04:00
Derek Carter
a548769792 removed print from debug code of file module 2012-06-29 21:38:31 -04:00
Derek Carter
82832021e8 file when UID or GID doesn't exist 2012-06-29 20:05:23 -04:00
Fred Alger
80f402aa9b Remove unused md5sum function from file module 2012-06-15 00:13:35 -04:00
Michael DeHaan
9ff59090c2 capture possible chown stderr output 2012-05-31 22:19:05 -04:00
Michael DeHaan
5a8e61a610 Fix parsing error in file module when returning errors. 2012-05-31 22:14:33 -04:00
Stephen Fromm
aea022b002 Apply logging of arguments to modules (issue #122)
The ohai and facter modules use /usr/bin/logger to log the fact that
they have been invoked.  I added 'import os' to the ping module
so that it could have the same syslog statements as the other modules.
I separated the condensed:
    shlex.split(open(argfile, 'r').read())
into two separate statements similar to the other modules.
2012-05-09 15:19:20 -07:00
Michael DeHaan
0669ce858a Refactored inventory to make it object oriented, need to make YAML format and executable script
format compatible with this still, and add some tests for INI-style groups of groups
and variables.
2012-05-05 16:31:03 -04:00
Rafal Lewczuk
3de61fb180 Fix: file module does not remove dangling symlinks 2012-05-01 22:56:37 -04:00
Stephen Fromm
f1b7149fcf Update how to set default selinux context for file
This removes the 'context' option and replaces it with checks for
'_default' value for seuser, serole, setype, or (maybe) selevel.
If '_default' is provided *and* there is a default context for the given
file, this will set the file context to the available default.
2012-05-02 11:38:44 -07:00
Daniel Néri
82d3fcfd53 File module fix for symlink from relative source path 2012-05-01 03:12:13 +02:00
Michael DeHaan
a0ac936a55 Merge pull request #249 from jhoekx/octal-file-mode
Return the octal mode of a file instead of decimal.
2012-04-26 16:25:39 -07:00
Stephen Fromm
5be20f8748 Update file module selinux-awareness
This adds selinux_mls_enabled() and selinux_enabled() to detect a)
whether selinux is MLS aware (ie supports selevel) and b) whether
selinux is enabled.  If selinux is not enabled, all selinux operations
are punted on -- same as if python's selinux module were not available.
In set_context_if_different(), I now iterate over the current context
instead of the context argument.  Even if the system supports MLS, it
may not return the selevel from selinux.lgetfilecon().  Lastly, this
drops selinux_has_selevel() in lieu of the current approach.
2012-04-26 07:31:25 -07:00
Jeroen Hoekx
3594d1ce80 Return the octal mode of a file instead of decimal. 2012-04-26 14:55:31 +02:00
Stephen Fromm
5c74a524b9 Fix for issue #227
Older versions of selinux, such as that deployed on rhel5, only return a
context of user:role:type instead of user:role:type:level.  This detects
whether the tuple has three elements (old-style) or four.  If the
old-style, it keeps the secontext list at three elements.
2012-04-25 09:39:11 -07:00
Michael DeHaan
80e6d83660 Fix bug in library/file 2012-04-24 08:10:50 -04:00
Stephen Fromm
be58995278 Add context=default option to file module
This adjusts behavior of file module such that removal of se* option
does not revert the file's selinux context to the default.  In order to
go back to the default context according to the policy, you can use the
context=default option.
2012-04-21 23:27:34 -07:00
Michael DeHaan
c0c691089d Fix bug in src. Should not code this early :) 2012-04-20 08:09:43 -04:00
Michael DeHaan
7794493952 Don't try to expand path for None values 2012-04-20 08:02:12 -04:00
Michael DeHaan
445e48b991 Call os.path.expanduser in modules so things work as expected even when using ./hacking/test-module script 2012-04-20 07:57:39 -04:00
Stephen Fromm
28895f6615 Rename serange to selevel to be consistent with selinux docs 2012-04-17 17:12:09 -07:00
Stephen Fromm
1e5d34ba35 Add selinux support to file module
This adds the options: seuser, serole, setype, and serange to the file
module.  If the python selinux module doesn't exist, this will set
HAVE_SELINUX to False and punt in the related modules.

This takes the options the user provides and applies those to the
default selinux context as provided from matchpathcon().  If there is no
default context, this uses the value from the current context.  This
implies that if you set the setype and later remove it, the file module
will rever the setype to the default if available.
2012-04-12 10:45:31 -07:00
Michael DeHaan
4792021f47 Fix syntax error in user patch 2012-04-02 20:08:40 -04:00
Matthew Williams
ae38ee0b3f protecting against replacing file or directory with link 2012-04-02 10:21:14 -07:00
Matthew Williams
24f61f1583 "link" state in file module 2012-04-01 16:10:23 -07:00
Michael DeHaan
60bf82d266 Remove comment about FIXME that is already resolved 2012-03-15 23:05:34 -04:00
Michael DeHaan
311b93995c Add some comments 2012-03-15 22:37:37 -04:00
Michael DeHaan
6874d853c9 Fix changed=True/False detection when specifying mode= 2012-03-15 22:35:59 -04:00
Michael DeHaan
4ad885111b Disable debug 2012-03-15 22:04:32 -04:00
Michael DeHaan
5004d21f10 Return file info about the file regardless of changes made 2012-03-15 22:04:04 -04:00
Michael DeHaan
be55145a1e Initial crack at the file module 2012-03-15 21:53:14 -04:00