Commit Graph

283 Commits (346df537b4dbdd768b99a54971aaeacd49014ddf)

Author SHA1 Message Date
Michael DeHaan f2465e0571 Add support for specifying sudo passwords to both ansible & playbook. Nopasswd sudo is no longer required. 13 years ago
Jeroen Hoekx a975852f66 Module_arguments can be unicode. 13 years ago
Michael DeHaan 6b50078881 Add defaults to command help to avoid a certain class of user questions. 13 years ago
Michael DeHaan 6129574290 Include default value for connection in help. 13 years ago
Michael DeHaan 09a0b9bea8 If the module return is not parsed, always show stderr information even if -D (debug)
is not specified.  This will help for users that don't have prerequisites installed
(like python-simplejson on old RHEL) and do not know to run -D.
13 years ago
Stephen Fromm 0675f2511b Merge branch 'master' into localconnection
Merge the SortedOptParser bits and debug attribute commits into
localconnection.

Conflicts:
	bin/ansible
	lib/ansible/playbook.py
	lib/ansible/runner.py
	lib/ansible/utils.py
13 years ago
Michael DeHaan 08c593bee1 Warn if no hosts matched 13 years ago
Michael DeHaan f3489a53cd English error messages if src and dest are left off the copy, template, or fetch modules 13 years ago
Michael DeHaan a0480a1bc5 Block some paramiko warnings that are not relevant. 13 years ago
Michael DeHaan 95e045d153 Remove remote logging as we're going to move this logging to the modules for performance reasons. 13 years ago
Michael DeHaan 245aa9bf8e Some tweaks to the fetch module. 'err' return was for stderr, so that should be empty string.
Some minor code shortening.  Added a test to TestRunner.
13 years ago
Michael DeHaan 62224271e9 Merge pull request #131 from mgwilliams/feature-fetch-module
Fetch Module
13 years ago
Stephen Fromm 40fc9a3249 Update playbook to be transport aware
This adds transport variable to playbook.py.  It can be set with
'connection' in the playbook file.
13 years ago
Matthew Williams 31d3f52b28 fetch to host specific directory 13 years ago
Matthew Williams 611e3fec4c fetch 'module' -- working with paramiko and local connections 13 years ago
Michael DeHaan 4c75b7f3ad Merge commit '8ae71cc' into integration
Conflicts:
	bin/ansible
	bin/ansible-playbook
	lib/ansible/utils.py
13 years ago
Michael DeHaan 1d75a29ec9 Allow variables coming in from the playbook and the API to be expressed as dictionaries throughout their full life cycle
such that nested data can be made available in templates and playbooks.
13 years ago
Stephen Fromm b5061bb62e Verify that effective uid == remote_user when transport is local
Raise exception if effective uid of process is not the same as
remote_user.
13 years ago
Stephen Fromm 5d74fedeb9 Update Runner to default to C.DEFAULT_TRANSPORT
This also uses self.transport when instantiating Connection object.
13 years ago
Stephen Fromm 1391481523 Add support for -c, --connection argument to specify connection type
Adds support to specify connection type to use.  The option -c,
--connection is added when connect_opts is set to True.  connect_opts is
added to make_parser() and base_parser_options().
13 years ago
Stephen Fromm 896f8de446 Add DEFAULT_TRANSPORT and DEFAULT_TRANSPORT_OPTS constants
DEFAULT_TRANSPORT is set to paramiko.  DEFAULT_TRANSPORT_OPTS is a list
of possible transport options; it is set to local and paramiko.
13 years ago
Stephen Fromm 9213cf896e Change to transport is local *and* is localhost
Connection.connect() now requires that, in order to use LocalConnection,
you specify transport is local and that the hostname is localhost.
13 years ago
Seth Vidal 8ae71cc7b1 go back to using a normal optparser to add options instead of the dict
interface.

add very small subclass of OptionParser to sort the options so mdehaan is happy
13 years ago
Brad Olson f840c0d167 Wired in Michael's usage string optparse style. 13 years ago
Michael DeHaan 6749903e57 Allow explicit request of the local connection. 13 years ago
Michael DeHaan da9d4eb29a Merge pull request #123 from sfromm/localconnection
Add LocalConnection class to connection.py
13 years ago
Stephen Fromm 70a3fab79f Add LocalConnection class to connection.py
This creates a LocalConnection class for the case when operating on the
localhost.  If the host, argument to Connection.connect(), matches
127.0.0.1, localhost, or the name of the host as returned by
os.uname()[1], Connection.connect() will opt to use LocalConnection
instead of ParamikoConnection.  LocalConnection implements connect(),
exec_command(), put_file(), and close().
13 years ago
Michael DeHaan 7b9856bc0e Modification on top of skvidal's common options patch to keep options to command line tools sorted. 13 years ago
Seth Vidal 7e50d170a8 move the bulk of the opt parsing out of ansible/ansible-playbook and into utils
for other scripts to use.
13 years ago
Jeroen Hoekx ab86726a15 Introduce per task variables and push them to templates. 13 years ago
Jeroen Hoekx edd5baad8b Refactor _transfer_argsfile to generic string transfer function. 13 years ago
Michael DeHaan 09e690fd7c Indentation error causing forks to not be parallel. Ahem :) 13 years ago
Michael DeHaan 778fe8755f Merge pull request #110 from jhoekx/remote-vars
Always add vars to a play.
13 years ago
Michael DeHaan eae1fdd734 Merge pull request #109 from jeckersb/version-0.0.2
Bump release to 0.0.2
13 years ago
Jeroen Hoekx e38ae18627 Always add vars to a play.
A play without vars section would fail to use variables given in an include. They would be added to the dict returned by play.get, but the dict would not be added to the play.
13 years ago
John Eckersberg 82b781925c pep8 fix 13 years ago
John Eckersberg 5aad4bacc7 Bump release to 0.0.2 13 years ago
Michael DeHaan e5d5b072db Merge remote branch 'public/integration' 13 years ago
Michael DeHaan 59a1ff31db Merge pull request #103 from jeckersb/no-shebang-on-callbacks.py
Remove shebang from callbacks.py
13 years ago
Michael DeHaan 2f1f0d44b4 Merge pull request #106 from mgwilliams/honor-hostfile-returncode
raise error if executable host file execution fails
13 years ago
Matthew Williams 461a4e78c2 raise error if executable host file execution fails 13 years ago
Matthew Williams c742b8eb0b bugfix for extra-vars 13 years ago
Seth Vidal bcef25f7eb add vars_prompt to playbooks
- this allows some vars to be prompted for at the start of the playbook
  setup
- defaults to no output since this would mostly be used for passwords
13 years ago
John Eckersberg 2dad8cc27c Remove shebang from callbacks.py
It is not +x, and has no __main__.  It draws ire of rpmlint.
13 years ago
Seth Vidal 04aecdcf34 before we run the actual module/command - emit what that would be to the logs 13 years ago
Michael DeHaan 2511992659 Surface module debug (-D) to /usr/bin/ansible also 13 years ago
Michael DeHaan 4a8dc50249 Merge pull request #97 from jhoekx/stderr-logging
Stderr logging
13 years ago
Jeroen Hoekx 74ae4b29ad Add a debug attribute to Runner/Playbook.
This prints the stderr of the executed modules on local stderr.
Most methods on Runner now return a fourth "err" parameter.
13 years ago
Jeroen Hoekx fb1a313974 Correct default user and port in playbook.
They are set in the constructor.
13 years ago
Michael DeHaan 6275e57718 pyflakes: Unused import / unused var 13 years ago
Michael DeHaan 9569be8bdb Need for quoting/unquoting problems go away once module_args are all treated as strings throughout. 13 years ago
Michael DeHaan 3ded27fe35 Treat module args as strings everywhere to avoid unneccessary shlex and requoting 13 years ago
Michael DeHaan f11de2f5c9 --extra-vars option for ansible-playbook
Conflicts:

	lib/ansible/playbook.py

Removed unneccessary shlex and replaced with basic split, some repurcussions in runner
that can be eliminated once we consistently pass args as a string (soon).
13 years ago
Michael DeHaan 6db87a5018 Minor style fix, update test to match quote fix patch 13 years ago
Matthew Williams ec6f488d1f shell quoting fixes
(edited author's original commit comment -- MPD)
13 years ago
Matthew Williams 99d5796605 support for quotes strings in command module (via posix=False), related fixes to keep other things from breaking 13 years ago
Michael DeHaan 2372a3b734 Sudo support operational in both playbooks and main program. Implementation could use some cleanup. 13 years ago
Michael DeHaan 81e3496037 Added preliminary support for --sudo to ansible, playbook support and further testing pending. 13 years ago
Michael DeHaan 72cc99722d sudo tweaks 13 years ago
Michael DeHaan 7ae75eb14b Default sudo is false 13 years ago
Michael DeHaan c2a6e2f97b Work in progress on sudo, hitting some issues with paramiko saying the connection is closed. 13 years ago
Michael DeHaan 7133734d87 Remove debug statements (WIP on sudo) 13 years ago
Michael DeHaan 4971101f27 Handler doesn't take this param. 13 years ago
Michael DeHaan 706ba9fd9a Add paramiko/pycrypto atfork workaround (can back out later if not useful), tweak error
message text per skvidal's suggestion
13 years ago
Michael DeHaan b30ddc4520 Expose remote_port option in playbook 13 years ago
Christopher Johnston 68818ad1fe add support for remote ports in playbooks 13 years ago
Christopher Johnston 15e781eb51 add exception check for paramiko if older then 1.7 13 years ago
Christopher Johnston f06ec76fdb add support for using an alternate remote port 13 years ago
Michael DeHaan b1471bf857 Add more comments to the callbacks file 13 years ago
Michael DeHaan 95670ce6b5 remove unused function 13 years ago
Michael DeHaan f9da7cb180 remove functions that are no longer used 13 years ago
Michael DeHaan 35d77d0433 Make it an error to try to hit a change handler that doesn't exist 13 years ago
Michael DeHaan f693759252 Style fixes from pep8 makefile target 13 years ago
Michael DeHaan f074f1c4c4 Fixes from pyflakes 13 years ago
Michael DeHaan 35c8750bbb Fix tree view to work with callbacks 13 years ago
Michael DeHaan 45a455a805 Make /usr/bin/ansible output realtime and also delete some code! 13 years ago
Michael DeHaan eb67a91c57 Merge remote branch 'public/master' 13 years ago
Michael DeHaan aaafd12b59 rm FIXMEs 13 years ago
Jeroen Hoekx a370261dce Playbook: create one task per include instead of per argument. 13 years ago
Michael DeHaan 6dda6f12dc Applying callback model to runner, and using that in playbooks, so output can be more immediate in playbooks.
(Runner still does not use callbacks for default output)
13 years ago
Michael DeHaan ab55fa4266 Revert "Only override the pattern if it is ommitted"
This reverts commit bb0bf9eef4.
13 years ago
Michael DeHaan bb0bf9eef4 Only override the pattern if it is ommitted 13 years ago
Michael DeHaan 9df612f007 Add a "-o" override option so hosts not in a playbook can still be managed by a playbook. 13 years ago
Michael DeHaan 292ac4aad2 Make it such that the 'name' element of each playbook line is optional. 13 years ago
Michael DeHaan 44d4dede92 Split conditional imports in playbook into subfunction, fix small bug in event reporting on playbook
actions.
13 years ago
Michael DeHaan b43019f3a1 In playbooks, a return code (rc) of non-zero should fail the playbook. 13 years ago
Michael DeHaan 6ab615c724 Code cleanup for playbooks, also added 'on_skipped' callback 13 years ago
Seth Vidal 53446d6d45 make sure the setup step in a playbook has the sshpass included 13 years ago
Seth Vidal 89d4bc542c fix up minor type - AnsibleException should be AnsibleError 13 years ago
Michael DeHaan a8c921cbcc Allow groups to be passed to runner API to make parse_hosts optional, misc fixes as a result of refactoring in Runner.
Cleanup in Playbooks module is next.
13 years ago
Michael DeHaan 94605b811b Fixes from refactoring 13 years ago
Michael DeHaan 6a7aac38c5 misc cleanup in the runner module, splitting some things out into utils, breaking up functions into smaller functions. 13 years ago
Michael DeHaan 7ed734dfb2 move callbacks to seperate file, anticipating callbacks for Runner() as well 13 years ago
Michael DeHaan 7883f414ce unused module 13 years ago
Michael DeHaan e6406fa5a7 Allow variable expressions to be stored as variables themselves, do some things to allow setup strings
to more easily contain spaces without being mangled, which is neccessary because of the above.
13 years ago
Michael DeHaan a5f4ca50b8 Ratchet up logging a few notches prior to controlling w/ verbosity settings 13 years ago
Michael DeHaan b5c62ec068 Enhance logging, way to gate verbosity levels pending. 13 years ago
Michael DeHaan dfbe591cc0 Add "only_if" capability, which allows task steps to be skipped if they do not match a conditional. 13 years ago
Michael DeHaan 149cc57b0f remove unneeded code 13 years ago
Michael DeHaan c05e7fd83e Fix typing issue 13 years ago