Commit Graph

337 Commits (17060f984977b59336a224858f7149d98350ad2c)

Author SHA1 Message Date
James Cammarata 5cf2781528 A little more cleanup regarding _compute_environment_string 2015-07-28 15:34:10 -04:00
James Cammarata 467432bef5 Fix incorrect module path for AnsibleError in action plugin base 2015-07-28 15:25:25 -04:00
Brian Coca f4a997db49 added back but stderr, which was the original itnention 2015-07-28 14:36:06 -04:00
Brian Coca 3b9282fb90 fixed dupe output in raw/command cases 2015-07-28 14:31:49 -04:00
Brian Coca 6cdee94c33 added missing skipped item function to base 2015-07-28 11:02:25 -04:00
Brian Coca 6f93d228f6 made item output closer to v1 2015-07-28 10:59:39 -04:00
Brian Coca 4f9d719b14 removed debug 2015-07-28 10:43:11 -04:00
Brian Coca d78c2fc212 now reports per task item 2015-07-28 10:41:40 -04:00
Brian Coca 787a0c4e04 fixed indent issues 2015-07-28 10:10:21 -04:00
Lukas Pirl d9aa14feea fixes remote code execution for su/sudo and strict remote umasks
* temporarily changes umask for creating temporary directories
    * otherwise parent directories may not get chmod'ed and end up
      unreadable
refs #9902
2015-07-28 19:24:23 +12:00
Brian Coca 5f8db9cd4b changed verbose_override to the new _ansible_verbose_override to keep in line with previous changes
output now defaults back to having indent=4
2015-07-27 22:15:44 -04:00
James Cammarata d6cafff2f9 Additional changes to fix fileglob relative path lookups 2015-07-27 16:35:57 -04:00
James Cammarata cb262449c7 Reworking internal result flags and making sure include_vars hides vault data
Fixes #10194
2015-07-27 14:04:31 -04:00
James Cammarata ee835ff7ad Add a base-level get_basedir method for lookup plugins and fix relative lookups
Fixes #11746
2015-07-27 10:41:28 -04:00
James Cammarata 3a4dd523d3 Fix bug where we calculated the relative path of recurisive copies wrong
Fixes #11470
2015-07-27 02:29:38 -04:00
Brian Coca a56ff7ae54 now it really is oneline 2015-07-26 23:14:07 -04:00
Brian Coca 5d1d9f1505 fixed diff output to be as it was in 1.x, copy and template now use the same
functions to do difs.
2015-07-26 22:29:56 -04:00
James Cammarata 034c766439 Fixing logic in template.py to not assume 'changed' is in the result 2015-07-26 13:57:25 -04:00
James Cammarata a78ed39f93 Merge pull request #11743 from renard/regex_escape-filter
Regex escape filter
2015-07-26 13:52:01 -04:00
James Cammarata db4b3544d7 Fix syntax error in action plugin template.py 2015-07-26 13:49:27 -04:00
Sébastien Gross 36534668f0 Change name from re_escape to regex_escape to fit existing function names. 2015-07-26 19:03:56 +02:00
Sébastien Gross c1e4085251 Add regular expression escaping filter. 2015-07-26 19:03:27 +02:00
Brian Coca 0b6fadaad7 started implementing diff
diff now works with template
also fixed check mode for template and copy
2015-07-26 12:22:22 -04:00
Abhijit Menon-Sen 8737061a8f lookupfile should lookup the given file=xxx
(Earlier it used to lookup the pre-split term.)
2015-07-25 15:38:26 +05:30
James Cammarata eca88d4253 Merge pull request #11732 from amenonsen/9212-rebase
Forbid copy: content="" with a directory destination
2015-07-25 02:47:19 -04:00
Mario de Frutos 4ed664f4d0 Forbid copy: content="" with a directory destination
Fixes #9107, closes PR #9212
2015-07-25 11:21:14 +05:30
Brian Coca b9710b4a34 wrapped new system ssh key lookup in case file does not exist 2015-07-24 23:54:13 -04:00
Patrick Michaud e4df8c3d36 Have paramiko use /etc/ssh_known_hosts
Fixes an issue with a confusing error: "paramiko: The authenticity of host '[host]' can't be established" when ssh on the command line doesn't complain

Closes PR #7730
2015-07-25 09:09:28 +05:30
James Cammarata eccfb7e0b5 Adding initial support for includes in handlers
Fixes #11694
2015-07-24 16:22:02 -04:00
James Cammarata 0fcd53e887 Make sure the command is sudoable before checking for the become password
Fixes #11714
2015-07-24 11:37:26 -04:00
Brian Coca 681eab1158 fix adhoc that broke with assuming step is always in options 2015-07-24 10:03:43 -04:00
Brian Coca 88e1ef8c9b implemented --step in v2 2015-07-23 20:47:40 -04:00
James Cammarata 7bc789ba64 Properly template task names
Also fixes in the correct way the bug in which the role name was
incorrectly showing up twice in the task name.

Fixes #10347
2015-07-23 15:45:36 -04:00
Toshio Kuratomi f8e4aff4c1 Cleanups:
* Don't reference __class__ when we can use the instance itself
* use isdisjoint() as it can stop once a match is found
* Remove a condtional that was taken care of in the conditonal just above
2015-07-23 12:13:45 -07:00
Brian Coca 4e3f5e3be6 Merge pull request #11708 from bcoca/display_me
adding display to plugins and start moving debug to display
2015-07-23 14:32:18 -04:00
Brian Coca a6ba149c49 implemented simplified output for adhoc adn command modules as in v1 2015-07-23 13:42:20 -04:00
Brian Coca 851ed45bbf adding display to plugins and start moving debug to display 2015-07-23 10:26:12 -04:00
Toshio Kuratomi b06353791c Don't pass mode from synchronize action plugin to the ansible module
Fixes https://github.com/ansible/ansible-modules-core/issues/1783
2015-07-23 00:42:27 -07:00
Brian Coca b678b9828c simplified and normalized lookup search path behaviour 2015-07-22 22:32:37 -04:00
James Cammarata dfcf6a2016 Skip hosts with no state while iterating tasks in the linear strategy
Fixes #11693
2015-07-22 15:55:11 -04:00
James Cammarata 206ef27268 Add flag to template() so data is not converted to a datastructure
Fixes #11641
2015-07-22 15:05:51 -04:00
James Cammarata 7a9916422a Fixing up error handling for fetch_file ops in connection plugins
* enable batch mode (configurable with a config option, on by default)
  for sftp transfers, so we can catch errors more easily
* general cleanup in the local connection plugin and fetch action plugin

Fixes #11612
2015-07-22 14:25:47 -04:00
James Cammarata 66a8864ae9 Fix environment setting and inheritence
Fixes #11401
2015-07-21 13:57:30 -04:00
James Cammarata e64989beb4 Moving ConnectionInformation -> PlayContext
Also making PlayContext a child class of the Playbook Base class,
which gives it access to all of the FieldAttribute code to ensure
field values are correctly typed after post_validation

Fixes #11381
2015-07-21 12:13:50 -04:00
James Cammarata 3de6f264dd Fix bug where spaces in the $HOME directory broke things
Fixes #11332
2015-07-20 15:40:49 -04:00
James Cammarata 91a4b866b0 Fix ssh pipelining 2015-07-20 15:40:49 -04:00
James Cammarata dca36c1d16 Reestablishing the use of tags/when for role duplication detection
Not figuring these in can cause problems with "diamond" pattern relationships,
even though this is still not quite optimal.
2015-07-20 14:37:20 -04:00
Pierre-Louis Bonicoli fda8fa77ab Fix pyflakes error: use 'msg' variable
Error was: local variable 'msg' is assigned to but never used
2015-07-20 12:41:39 +02:00
Brian Coca a09ce4bd87 added callback that skipts 'skipped' 2015-07-19 23:55:39 -04:00
Brian Coca f8905013cd now executes fact search when needed 2015-07-19 18:00:27 -04:00
James Cammarata 2c98b271c8 Make paramiko password detection logic match ssh connection 2015-07-19 02:23:53 -04:00
James Cammarata 3d77723e3d Cleaning up some stuff related to the connection info/become/executable change 2015-07-19 01:12:23 -04:00
James Cammarata 1c185b68be Rearranging some become stuff in relation to action/connection plugins
Moving the make_sudo_cmd() calls back up to the action level so that connection
plugins don't have to know about it at all, and moving some of the become data
(prompt and success_key) into the ConnectionInformation object so they don't
need to be passed around needlessly.
2015-07-19 01:12:23 -04:00
James Cammarata 7a9b5b6fe8 Remove unnecessary make_become_cmd from paramiko exec_command
Fixes #11611
2015-07-19 00:08:09 -04:00
Brian Coca 9dc5607730 Merge pull request #11519 from bcoca/human_readable
new human_readable filter to transform bits and bytes into cake
2015-07-18 23:10:53 -04:00
Brian Coca 115dce028d Merge pull request #11604 from bcoca/faf_deprecated_fixes
fixed first_available_found for template
2015-07-18 23:09:47 -04:00
James Cammarata 271a7f3281 Cleaning up some of the notify/facts logic added earlier to fix problems 2015-07-17 14:44:19 -04:00
Brian Coca 1aa4155266 generalized warning handling, added it to adhoc also 2015-07-17 14:14:15 -04:00
James Cammarata d4ac73a1bc Adding back capability to display warnings contained in results
Fixes #11255
2015-07-17 13:44:22 -04:00
James Cammarata 5abdd3b821 Handle notifications when coupled with a loop
Fixes #11606
2015-07-17 12:03:04 -04:00
Serge van Ginderachter 8d1549900c fix AnsibleError object name in subelements plugin
fixes #11624
2015-07-17 17:39:31 +02:00
Gerard Lynch a6c8d30f3e callbacks require a version constant or the v2 code doesn't pass the display param and it gives an error 2015-07-17 15:33:48 +01:00
Brian Coca a09f6236a5 adapated to v2 2015-07-17 08:55:22 -04:00
Brian Coca 10e5c2b46d fixed var scope 2015-07-17 08:54:28 -04:00
Tom Paine 097ed1f17b Add plugin that profiles playbook tasks
Resubmission of https://github.com/ansible/ansible/pull/11270 to
correct v2 file location.

[Description and console output
demonstration](https://github.com/aioue/ansible-plugin-profile/blob/mast
er/README.md#features).

Provides per-task timing, ongoing playbook elapsed time and ordered
list of top 20 longest running tasks at end.
2015-07-17 13:04:31 +01:00
Brian Coca 978390693b changed to default 'auto' as it better describes the use= option 2015-07-16 16:45:04 -04:00
James Cammarata 94fa741f96 Make sure files loaded by template action are decoded properly
Fixes #11247
2015-07-16 15:23:40 -04:00
Brian Coca 5a5b7ff561 fixed first_available_found for template, refactored into common function
added deprecation warning
fixed display.deprecated to make version optional (code already assumed this)
turned warning + 'deprecated' in plugin loader into actual call to deprecated()
2015-07-15 19:47:59 -04:00
Brian Coca b76cb8f655 now that invocation is only async again, no need to sanitize 2015-07-15 10:40:37 -04:00
James Cammarata 2d870b7112 Fix logic where invocation details are added to results 2015-07-15 10:20:55 -04:00
James Cammarata 0b035a4e35 Unicode in result debug statements caused a traceback 2015-07-15 01:56:28 -04:00
James Cammarata 7dd5600839 Allow empty include files again
Fixes #11582
2015-07-14 08:26:11 -04:00
James Cammarata 6971e92f39 Fixing up some output stuff 2015-07-14 00:23:17 -04:00
Brian Coca 2b723c6130 added missing re import 2015-07-13 20:42:09 -04:00
Brian Coca 3102469b94 fixing become success string 2015-07-13 20:40:40 -04:00
Brian Coca 24b830bbc8 fixed executable for raw module 2015-07-13 16:23:14 -04:00
Brian Coca c4b6d91275 added skipped to oneline 2015-07-13 15:54:12 -04:00
Brian Coca 8ad52c2e4f readded oneline output feature to adhoc
fixes #11573
2015-07-13 15:43:31 -04:00
Brian Coca 3a768b3b9f removed unused methods, these now live in base class 2015-07-13 15:43:31 -04:00
James Cammarata d977da5b41 Fixing up fact_cache use in VariableManager 2015-07-13 11:06:03 -04:00
James Cammarata 932d1e57f7 Removing stray debugging print 2015-07-13 10:56:09 -04:00
James Cammarata 91c9bb96e3 Moving jsonfile cache plugin over and fixing #10883
Fixes #10883
2015-07-13 10:42:10 -04:00
Brian Coca d8abae71a4 now assemble skips during checkmode
TODO: actually make it check with checkmode
fixes http://github.com/ansible/ansible-modules-core/issues/661
2015-07-13 10:34:44 -04:00
Alejandro Guirao 587a6cb44c Remove v1 code 2015-07-13 15:48:23 +02:00
Alejandro Guirao 6e99023c84 Changed to support Ansible v2 2015-07-13 15:37:27 +02:00
Alejandro Guirao 8efc42d993 Add shelvefile lookup plugin 2015-07-13 10:31:35 +02:00
James Cammarata f40b66d841 Make sure the basedir is unicode
Fixes #10773
2015-07-12 16:40:00 -04:00
Brian Coca ba92965670 fix for when invocation data is missing 2015-07-12 16:10:52 -04:00
Brian Coca 4203b699a8 removed dict comprehension as 2.6 does not like 2015-07-11 15:15:46 -04:00
Brian Coca d993e7000c added cyan back to ignoring message 2015-07-11 15:01:50 -04:00
Brian Coca 064a34689a now actually continues play on ignore errors 2015-07-11 14:53:23 -04:00
Brian Coca 1274ce565d added result sanitation to registered var and to callbacks
removed time display as it only is provided by command module
2015-07-11 01:05:29 -04:00
Brian Coca fdea00880b now default shows time taken when -vv or above 2015-07-11 00:02:40 -04:00
Brian Coca 7a1bce1b5d added verbose option to show callback loaded info
also made mail module print nicer without all those 'u'
2015-07-10 23:48:12 -04:00
teh 4r9h 705018a417 Misspell in mail.py callback.
Looks like little misspell.
2015-07-11 02:53:32 +02:00
Brian Coca aaad33ccb6 fixed a couple of bugs 2015-07-10 10:30:33 -04:00
Brian Coca d0c6d2ff1c poreted log_plays, syslog_json and osx_say callbacks to v2
renamed plugins to contrib (they are not really plugins)
rewrote README.md to reflect new usage
added new dir to setup.py so it gets copied with installation, in views
of making using inventory scripts easier in teh future
2015-07-10 10:30:33 -04:00
Brian Coca 50d54b1be7 ported hipchat callback to v2 (needs testing) 2015-07-10 10:30:33 -04:00
Brian Coca e92e15b5f6 moved unused functions to base object 2015-07-10 10:30:33 -04:00
Brian Coca b47d7babe5 removed warning i was using for debug 2015-07-10 10:30:33 -04:00
Brian Coca 834b7a2857 ported context_demo to v2 callbacks 2015-07-10 10:30:33 -04:00
Brian Coca ba0e5323d6 removed connection info to _verbosity, just needed callbacks to call correct display.verbosity
added v2 methods and made them call v1 when possible by tranforming the data
2015-07-10 10:30:33 -04:00
Brian Coca f9d817e636 now looks at correct verbosity and removes the need to set a copy of it in _verbosity 2015-07-10 10:30:33 -04:00
James Cammarata f8ddf2eb04 Move role cache into the play to avoid roles crossing play boundaries 2015-07-10 02:43:53 -04:00
James Cammarata b520d5bc60 Lots of fixes for integration test bugs 2015-07-10 01:53:59 -04:00
Brian Coca 3ba67dd2d0 added ignore_hidden to assemble 2015-07-09 00:27:29 -04:00
Brian Coca 55366bdc6d ported mail callback plugin to work with v2 2015-07-08 16:33:51 -04:00
James Cammarata 27fcf1a4b5 Fix bug in registered variables related to delegate_to changes 2015-07-08 12:38:24 -04:00
James Cammarata 64a1b1e043 Fix first_available_file: support for copy and template actions 2015-07-08 12:23:42 -04:00
James Cammarata 2e5dfd57cc Clear flag indicating role had run before each play is run
Fixes #11514
2015-07-07 21:47:48 -04:00
James Cammarata f67949e42c Readd logic for ansible_managed to template action plugin
Fixes #11317
2015-07-07 16:48:19 -04:00
James Cammarata da307c8bfd Fix bug in logic introduced in 614c626 2015-07-07 16:09:36 -04:00
James Cammarata 293dd38d05 Correctly handle assigning results to the delegated to host 2015-07-07 16:09:36 -04:00
Brian Coca 688088547b new human_readable filter to transform bits and bytes into cake (not really) 2015-07-07 15:58:18 -04:00
James Cammarata 614c626ed0 Fix no hosts remaining logic in linear strategy 2015-07-07 14:20:07 -04:00
James Cammarata 1d8ccfb99f Fixing includes where the included file is "{{item}}" 2015-07-06 14:30:56 -04:00
Brian Coca 4d35d8bd31 properly booleanify copy field 2015-07-03 18:59:49 -04:00
Brian Coca 5122455db8 ported missing sequence updates from 1.9 2015-07-03 13:54:51 -04:00
Brian Coca 1b74102ab3 Merge pull request #11435 from hfinucane/ipwrap-generator
Treat generators like lists and tuples
2015-07-01 18:34:44 -04:00
Toshio Kuratomi 71f72b655e Merge pull request #11432 from sivel/splitext-filter
Add splitext filter
2015-07-01 13:17:56 -07:00
James Cammarata 9341148f04 Throw an error if with_first_found finds no files by default
Fixes #9976
2015-07-01 16:09:34 -04:00
James Cammarata cf51d0a790 Fixing up some check-mode stuff 2015-07-01 15:10:25 -04:00
James Cammarata ad53b6f36a Merge pull request #11461 from pilou-/shell_removed
Fix "AttributeError: 'ActionModule' object has no attribute '_shell'"
2015-07-01 14:35:27 -04:00
James Cammarata 2e386deeae Make undefined variables in debug var=foo more obvious
Fixes #9935
2015-07-01 11:55:00 -04:00
Pierre-Louis Bonicoli 4d4512940d Fix "AttributeError: 'ActionModule' object has no attribute '_shell'"
'_shell' was removed with commit 2a5fbd8570
2015-07-01 17:22:09 +02:00
James Cammarata ec4d1b11df Fix some more handler issues
* Only notify handlers when the task is changed
* Don't run handlers on hosts which have failed
2015-06-30 14:44:41 -04:00
Brian Coca d149ea5222 ported timer.py callback to v2 2015-06-29 20:45:50 -04:00
James Cammarata 9785e5397e Fix typo in SharedObjectLoader field basedirs 2015-06-29 22:51:53 -04:00
James Cammarata 927072546b Fixing up some issues with plugin loading 2015-06-29 22:49:25 -04:00
James Cammarata 2a5fbd8570 Winrm fixes for devel
* Include fixes for winrm connection plugin from v1 code
* Fixing shell plugin use
2015-06-29 22:49:25 -04:00
Henry Finucane 2d1cb7f328 Treat generators like lists and tuples 2015-06-29 14:55:11 -07:00
Matt Martz 4059904a18 Add splitext filter 2015-06-29 15:39:57 -05:00
Dustin Lundquist cf7744f2f1 IPv6 SLAAC address computation filter
Jinja2 filter to compute SLAAC address.

Usage:
    {{ '2db8::/64' | slaac(ansible_eth0.macaddress) }}
2015-06-25 13:20:21 -07:00
Toshio Kuratomi 548a7288a9 Use BUFSIZE when putting file as well as fetching file. 2015-06-24 01:00:22 -07:00
Toshio Kuratomi 270be6a6f5 Fix exec_command to not use a shell 2015-06-23 22:27:45 -07:00
Toshio Kuratomi e461241d7b Fix fetch_file() method 2015-06-23 14:45:44 -07:00
James Cammarata d0d9be30d5 Correctly compile handler blocks for dependent roles 2015-06-23 15:48:48 -04:00
Hugh Saunders 4246777759 Re-implement the ssh connection retry, originally added in 2df690 2015-06-23 12:14:14 -04:00
James Cammarata 006391eb83 Add the improved exception reporting to the minimal callback plugin 2015-06-23 12:14:14 -04:00
Toshio Kuratomi 952166f48e Fix problem with chroot connection plugins and symlinks from within the chroot. 2015-06-22 20:08:08 -07:00
Toshio Kuratomi 61e367f549 Better error messages when the file to be transferred does not exist. 2015-06-22 20:08:08 -07:00
James Cammarata 7490044bbe Implement play_hosts magic variable (and ansible_current_hosts)
Fixes #8073
2015-06-22 21:03:55 -04:00
James Cammarata 97954ff658 Minor tweak to potentially speed the linear strategy up
* Don't fetch vars for the task unless we're going to use them
2015-06-22 00:53:34 -04:00
Brian Coca b34b606fcf fixed and/or grouping 2015-06-21 01:51:28 -04:00
Brian Coca 68325dbfe2 fixed remote tmp creation when becoem user is not root and '~/' instead of $HOME is the default 2015-06-21 01:43:35 -04:00
Brian Coca 102de96ebf avoid password handling when no password is supplied 2015-06-21 01:24:35 -04:00
Brian Coca 3bad03d57a cleaned up and optimized become handling paths 2015-06-21 01:13:22 -04:00
James Cammarata 0d92599d18 Make exception printing a bit smarter 2015-06-19 22:59:12 -04:00
Toshio Kuratomi a77b58e351 Bumpt the BUFSIZE to 64k for better performance 2015-06-19 11:52:06 -07:00
Toshio Kuratomi 0777d02505 Fix problem with jail and zone connection plugins and symlinks from within the jail/zone. 2015-06-19 11:09:48 -07:00