Brian Coca
d501f50c7b
fixed try/except/finally to be 2.4 compatible
2015-05-13 15:52:37 -04:00
Toshio Kuratomi
60a66a544d
Several cleanups to many modules:
...
* Fix docs to specify when python2.6+ is required (due to a library
dep). This helps us know when it is okay to use python2.6+ syntax in
the file.
* remove BabyJson returns. See #1211 This commit fixes all but the
openstack modules.
* Use if __name__ == '__main__' to only run the main part of the module
if the module is run as a program. This allows for the potential to
unittest the code later.
2015-05-11 12:15:53 -07:00
Nathaniel
5aae7f3e51
Update set_fact.py
...
Context: I recently discovered that when setting a fact, key=value pairs and complex arguments differ in how the fact is stored. For example, when attempting to use complex arguments using key=values, the result can be stored as a unicode string as opposed to an object/list/etc.
I'm hoping the above example update will better demonstrate to and instruct people to use complex arguments instead of key=value pairs in certain situations.
2015-05-09 15:51:17 -05:00
Brian Coca
1d6d3fece7
added docs to show wait_for default timeout settings
...
Fixes #400
2015-04-06 20:41:57 -04:00
Brian Coca
cbc1655ba0
Merge pull request #784 from bcoca/wait_for_docs
...
added missing docs on connection_timeout for wait_for
2015-02-25 10:39:37 -05:00
Gerard Lynch
9967aa6681
wait_for: updated docs, must be resolvable hostname, updated example
2015-02-23 20:10:02 +00:00
Brian Coca
3100236628
added missing docs on connection_timeout for wait_for
2015-02-13 10:02:05 -05:00
Andrey Trubachev
10e48d18f7
Fix python-2.4 compatibility
2015-01-05 21:05:01 +03:00
Andrey Trubachev
659c6d3a7e
Fix 'wait_for' doesn't work with ipv6only host
2015-01-03 10:32:27 +03:00
Brian Coca
5af9928996
let implied type do the spliting
2014-11-11 15:34:55 -05:00
Brian Coca
d67ac4d33e
minor fixes to wait_for to avoid tracebacks as per ansible core issue #9244
2014-11-11 15:09:42 -05:00
Brian Coca
c6dcd38355
added missing init.py for utilities modules
2014-11-05 15:49:39 -05:00
Michael DeHaan
cec519f70e
Move internal category to utilities to remove one more category from the left hand menu, keeping it concise.
2014-11-04 17:47:07 -05:00
Michael DeHaan
0be8798858
Renames.
2014-11-04 17:29:56 -05:00
Ashish Ranjan
eae233efe4
fields in /proc/net/tcp* are not always delimited by single space
2014-10-24 14:48:26 +00:00
Michael DeHaan
385a037cd6
package files
2014-09-26 11:05:47 -04:00
Michael DeHaan
c8e1a2077e
file extensions!
2014-09-26 10:37:56 -04:00
Michael DeHaan
417309a626
Restructuring.
2014-09-26 10:13:26 -04:00
Michael DeHaan
73123b69fa
Move modules into subdirectory.
2014-09-26 09:23:50 -04:00
James Cammarata
ec64538833
Convert boolean strings from set_fact to proper boolean values
...
Also adds integration tests for booleanification of strings
Fixes #8629
2014-09-10 09:56:39 -05:00
James Cammarata
6e7773e9b8
Removing unused name param for wait_for tcp draining classes
...
Also updates the version_added and other references to the version
in which the connection draining functionality was added.
2014-08-26 20:36:11 -05:00
Greg Swift
7bc23ea007
Extend wait_for module to support draining of active tcp connections
2014-08-21 16:15:59 -05:00
Matt Martz
28939f49f7
Need to check e.errno instead of os.errno. Fixes #8548
2014-08-11 12:26:52 -05:00
James Cammarata
1cc9b6d90b
Break out of loop for sockets in wait_for when there's no data to read
2014-07-14 14:14:13 -05:00
James Cammarata
1abf10a4f6
Merge branch 'wait-for-port-search-regex' of https://github.com/sivel/ansible into sivel-wait-for-port-search-regex
2014-07-14 13:16:11 -05:00
James Cammarata
35960ea192
Merge pull request #7374 from hfinucane/wait_for_pipes
...
Allow wait_for to wait on non-traditional files
2014-06-20 15:55:10 -05:00
Matt Martz
7ec52c9001
Allow search_regex to be used in wait_for with port
2014-06-02 07:17:01 -05:00
Brian Coca
bd95479777
corrected doc example, non existing fact to the 2 it had 'merged'
2014-05-29 22:44:33 -04:00
Henry Finucane
898ebf7358
Fail fast in the presence of permissions issues
2014-05-13 09:43:47 -07:00
Henry Finucane
34bf59ac4c
Allow wait_for to wait on non-traditional files
...
Use os.path.exists to check for file existence, instead of "can we open
this file for reading".
Fixes #6710
2014-05-12 23:21:55 -07:00
James Cammarata
d9a09916d4
Close fds when running commands from the accelerate daemon
...
Fixes #7307
2014-05-07 08:47:38 -05:00
Dag Wieers
a19fbc7b24
Add an example to show all hostvars using debug
...
This is a useful example to help debug how facts and vars are being collated.
2014-04-21 11:40:53 +02:00
James Cammarata
6f38595ba2
Acclerate improvements
...
* Added capability to support multiple keys, so clients from different
machines can connect to a single daemon instance
* Any activity on the daemon will cause the timeout to extend, so that the
daemon must be idle for the full number of minutes before it will auto-
shutdown
* Various other small fixes to remove some redundancy
Fixes #5171
2014-03-23 14:45:49 -05:00
James Cammarata
f46760ef37
Execute commands through accelerate with shell when needed
...
This fixes an issue related to the new run_command changes, whereby
Popen fails to run a command when an executable is specified + shell=False
and there are multiple positional arguments (see Popen docs for details)
2014-03-18 12:24:13 -05:00
Michael DeHaan
9495dda0ab
Amend wait_for docs to reference version of feature addition.
2014-03-16 17:10:37 -04:00
Michael DeHaan
6bc94937ac
Merge branch 'devel' of git://github.com/AnderEnder/ansible into devel
2014-03-16 17:10:02 -04:00
James Cammarata
a2dfffeac9
Create the tempdir in the accelerate module if it doesn't exist
...
Fixes #6047
2014-03-05 22:08:09 -06:00
Michael DeHaan
6aadf11ff8
Fix up examples in the assert docs to match the way things work.
2014-03-01 09:34:21 -05:00
Michael DeHaan
58c445b8a6
Add the start of an integration test structure using Ansible playbooks, also added an assert action plugin to make writing those easier.
2014-02-13 18:28:29 -05:00
James Cammarata
0dff07b53e
Detect remote_user change in accelerate daemon and allow a restart
...
Fixes #5812
2014-01-30 14:40:41 -06:00
jctanner
c21e88e2df
Merge pull request #5784 from geerlingguy/patch-1
...
Update wait_for documentation - remove extra quote
2014-01-29 09:51:48 -08:00
Michael DeHaan
0d3a74d905
ansible -> ansibleworks
2014-01-28 20:29:41 -05:00
Jeff Geerling
e602d16158
Update wait_for documentation - remove extra quote
...
The timeout is in seconds (int), and the extra quote at the end could throw someone off if they're copying and pasting the example.
2014-01-27 12:09:54 -06:00
Jim Kleckner
2903c7b568
Fix documentation example for the fail module
...
The example for the fail module doesn't work:
http://www.ansibleworks.com/docs/modules.html#fail
The current text shows:
- fail: msg="The system may not be provisioned according to the CMDB status."
when: "{{ cmdb_status }} != 'to-be-staged'"
The "when" documentation indicates that the argument is already a Jinja2
expression:
http://www.ansibleworks.com/docs/playbooks_conditionals.html#the-when-statement
Thus, the following is
when: cmdb_status != "to-be-staged"
is preferred even though the following could work but generates a
deprecation warning:
when: {{cmdb_status != "to-be-staged"}}
2013-12-26 16:32:32 -08:00
Andrii Radyk
29c9922ac5
Adding absent condition for to the wait_for module
2013-12-12 10:28:01 +02:00
James Tanner
4f9aadcc07
Addresses #5023 Fix import comments
2013-12-02 15:13:49 -05:00
James Tanner
38edad70ac
Fixes #5023 Convert all modules to use new snippet import pattern
2013-12-02 15:11:23 -05:00
James Cammarata
a1f1f459d8
Fix accelerate module parameter for IPv6 activation
2013-11-27 09:32:07 -06:00
Junegunn Choi
2663513b5c
Remove Python 2.4-incompatible 'with' statement
2013-11-25 17:01:24 +09:00
jctanner
5ed73281b0
Merge pull request #4780 from mscherer/fix_accelerate_various
...
Fix various warning on accelerate module, found by pyflakes
2013-11-19 12:42:32 -08:00
James Tanner
d9147bc0e0
Fixes #4851 Set syslog debug mode for accelerate properly
2013-11-18 09:56:12 -05:00
John Jarvis
51b9be9bfd
Adding more wait conditions to the wait_for module
...
Adds a new option to wait_for to wait for a file to exist on the file
system before continuing, optionally takes a search_regex param to match
text in the file.
2013-11-12 19:04:38 -05:00
Michael Scherer
33e1a82fae
fix incorrect send_data call. there is no client variable, and send_data
...
is a class method. Pyflakes complained about it.
2013-11-07 08:11:56 +01:00
Michael Scherer
d000ef1844
remove unused variable (pyflakes)
2013-11-07 08:11:56 +01:00
Michael Scherer
c2851cd1e8
make pyflakes a bit more silent
...
- explictely import json, since this is used ( only to silence pyflakes)
- remove shutil as it is unused
2013-11-07 08:11:56 +01:00
jctanner
ac3baf2f93
Merge pull request #4772 from mscherer/fix_4763
...
Try/finally is a python 2.5 construct, so not working on EL5. Fix #4763
2013-11-04 15:36:02 -08:00
James Tanner
78f4f95e64
Fixes #4485 add an ipv6 parameter to accelerate so that the daemon will bind to an ipv6 port instead of ipv4
2013-11-04 17:20:03 -05:00
Michael DeHaan
1381f80e47
Make it slightly more clear what side of the connection is missing keyczar if using accelerate mode.
2013-11-03 12:46:21 -05:00
Michael DeHaan
e939a41bfb
Update module documentation.
2013-11-02 09:34:44 -04:00
Michael Scherer
8f5a0f9112
Try/finally is a python 2.5 construct, so not working
...
on EL5. Fix #4763
2013-11-02 11:24:29 +01:00
Michael DeHaan
dd6af369af
Some simplification of include_vars and renamed include_files to include_vars.
2013-10-31 19:24:35 -04:00
Michael DeHaan
684cbf8154
Merge branch 'include_files' of git://github.com/bennojoy/ansible into devel
2013-10-31 19:14:27 -04:00
Michael Scherer
a53972c3a7
Fix accelerate module on centos 5 by removing
...
unsupported string prefix in 2.4
http://docs.python.org/release/2.4/ref/strings.html
This is also ignored on later version of python 2
and is present only for python 3 conversion, as seen
on http://docs.python.org/2/reference/lexical_analysis.html#string-literals
Also see http://stackoverflow.com/questions/6269765/what-does-the-b-character-do-in-front-of-a-string-literal
Fix https://github.com/ansible/ansible/issues/4739
2013-10-31 21:04:34 +01:00
bennojoy
00b9aae26e
include files
2013-10-28 17:40:09 +05:30
Michael DeHaan
ce8b0944a9
Misc pep8 fixes
2013-10-19 13:03:15 -04:00
Michael DeHaan
4503cbebc0
Added "debug: var=variableName" capability.
2013-10-14 21:01:38 -04:00
James Cammarata
3cd459faf7
Fix for network byte order issues in accelerate
2013-10-02 15:37:15 -05:00
James Cammarata
88b9bc5de8
Merge branch 'accelerate_improvements' into devel
...
Conflicts:
library/utilities/accelerate
2013-10-01 21:22:17 -05:00
James Cammarata
3b87b2c56c
Make recv_data less greedy so it doesn't eat other packets
2013-10-01 16:50:32 -05:00
James Cammarata
13f28d31fa
Adding an accelerate_timeout parameter for plays
...
This setting makes the timeout for each play configurable, rather than
hard-coding it at 300 seconds (now the default if left unspecified)
Fixes #4162
2013-10-01 15:26:50 -05:00
James Cammarata
d3f1c89470
Added keepalive packets to accelerate mode
...
Commands will now be started up in a separate task from the main
handler thread, so that it can be monitored for completeness while
sending a keepalive packet back to the controller to avoid a socket
receive timeout.
2013-10-01 15:19:21 -05:00
James Cammarata
18379701f0
Use atomic_move to put the file, rather than shelling out
...
Fixes #4321
2013-10-01 14:47:50 -05:00
James Cammarata
42449a3901
Add more verbose debugging options for accelerate
2013-09-30 14:08:07 -05:00
Andrey Shorin
7e2755a542
Make --check mode work with fireball and accelerate connections
2013-09-23 13:51:43 +04:00
Erick Yellott
55e26fdfda
Typo fix from accelerated: true
to accelerate: true
2013-09-18 16:47:49 -05:00
James Cammarata
156ab85478
Check for an empty executable passed into the accelerate plugin
...
This was breaking at least the script module, so it would seem best
to check for it and set it to the default executable value
2013-09-05 15:11:26 -05:00
James Cammarata
a05eec87b2
When putting a file in accelerated mode, make sure it's chowned correctly
2013-09-05 12:04:08 -05:00
James Cammarata
0a27ded6f3
Adding the facility to the accelerate daemon syslog calls
2013-09-03 11:30:29 -05:00
James Cammarata
f8c77e3980
Renaming fireball2 as 'accelerate' and removing old references
2013-08-30 13:26:27 -05:00
James Cammarata
1066a1703f
Adding chunked file transfers to fireball2
2013-08-28 11:14:58 -05:00
James Cammarata
7ec763106d
Added accelerate_port to plays, and made it configurable
2013-08-28 11:14:58 -05:00
James Cammarata
b49f67ee7a
Initial support for sudoable commands over fireball2
...
Caveats:
* requiretty must be disabled in the sudoers config
* asking for a password doesn't work yet, so any sudoers users must
be configured with NOPASSWD
* if not starting the daemon as root, the user running the daemon
must have sudoers entries to allow them to run the command as the
target sudo_user
2013-08-28 11:14:58 -05:00
James Cammarata
e92df1dc76
Bail out correctly if socket.recv gets nothing (indicating a closed socket)
2013-08-28 11:14:58 -05:00
James Cammarata
3d3b318a86
Fireball2 mode working!
2013-08-28 11:14:58 -05:00
Brian Coca
e7e5db8e6c
updated debug module docs to remove outdated -v requirement (and
...
only_if reference)
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2013-07-26 10:06:57 -04:00
Michael DeHaan
7cf87d7a3c
Legacy variable usage removed
2013-07-19 09:40:00 -04:00
Jesse Keating
64fb4f4c93
Update fail docs for new syntax
...
Use when instead of only_if
Use new variable style
2013-07-08 14:22:05 -07:00
Jesse Keating
6a1d6ee25f
Elapsed time should account for the delay
2013-06-27 17:42:33 -07:00
Jan-Piet Mens
98c1423269
Docs: consistently format playbook EXAMPLES
2013-06-17 08:53:46 +02:00
Michael DeHaan
5cbbd2ee6d
Remove reference to non-existant module.
2013-06-16 23:33:49 -04:00
Jan-Piet Mens
3404a0fc16
DOCS: standardize on EXAMPLES (a.k.a. Docs-JumboPatch JetLag Edition)
...
Migrated all examples: in DOCUMENTATION=''' string to standalone EXAMPLES=''' string
Added deprecation warning to moduledev.rst and remove deprecated example from it
Fixed up a few typos and uppercased some acronyms.
add consistency to how EXAMPLES are formatted
2013-06-15 20:54:25 +02:00
Michael DeHaan
2bb25cac74
Doc standardization
2013-06-01 18:42:03 -04:00
Michael DeHaan
2438ef474a
Docs standardization
2013-06-01 18:40:04 -04:00
Michael DeHaan
79015895ba
Standardize docs
2013-06-01 18:38:16 -04:00
Stoned Elipot
e320616974
Fix empty requirements specifications in modules documentation
...
And also be liberal in what ansible-doc accepts as an empty
requirements specification.
While here fix a typo in template module documentation
wrt jinja2 overrides example.
2013-05-16 17:15:21 +02:00
Michael DeHaan
e0f0278ad8
Move mail into the notification bucket.
2013-05-05 12:42:09 -04:00
Michael DeHaan
a715a86cd1
Slight tweak to set_fact variable documentation to clarify scope info.
2013-04-29 19:15:29 -04:00
Michael DeHaan
cd97a4cb14
Allow modules to be categorized, and also sort them when generating the documentation.
2013-04-28 15:03:45 -04:00