Commit Graph

227 Commits (f9526b2ab22e2658d0f6ce5bb93a51cba9685851)

Author SHA1 Message Date
Brian Coca 897e098b27 minor fixes to constants 2015-07-08 16:33:51 -04:00
Brian Coca 50efeb13ba made squashable with_ plugin list configurable
partially deals with #11383
2015-07-07 11:59:20 -04:00
Toshio Kuratomi 5b0b1f8da6 unquote strings in the ansible config file 2015-07-06 14:12:10 -07:00
Brian Coca 05be30168d return empty string when config file is not used 2015-07-05 12:51:05 -04:00
Brian Coca 5f791329ce now verbose mode shows config file used 2015-07-04 10:23:49 -04:00
Brian Coca 9e37402cb7 added ramfs to selinux ignored filesystems
as reported in #11442
2015-07-02 17:25:05 -04:00
James Cammarata b6c52ce115 Allow role variables to be optionally kept in a private scope 2015-07-01 11:33:14 -04:00
James Cammarata 21c14363fd Allow callback plugins to be whitelisted 2015-06-29 10:56:28 -04:00
Brian Coca b89071e485 now detects incorrect password with sudo and su (at least in english) 2015-06-15 01:30:03 -04:00
Brian Coca ff15f374ad fixed new become settings, rearranged constants to find PE related vars easier 2015-06-14 20:50:38 -04:00
Brian Coca eaddc0b309 removed duplicate retry config entries 2015-05-25 11:06:04 -04:00
Hugh Saunders 2e07567c16 Retry exec command via ssh_retry
This PR adds the option to retry failed ssh executions, if the failure
is caused by ssh itself, not the remote command. This can be helpful if
there are transient network issues. Retries are only implemented in the
openssh connection plugin and are disabled by default. Retries are
enabled by setting ssh_connection > retries to an integer greater
than 0.

Running a long series of playbooks, or a short playbook against a large
cluster may result in transient ssh failures, some examples logged
[here](https://trello.com/c/1yh6csEQ/13-ssh-errors).

Ansible should be able to retry an ssh connection in order to survive
transient failures.

Ansible marks a host as failed the first time it fails to contact it.
2015-05-18 14:22:52 -07:00
Brian Coca 0913b8263c made special treatment of certain filesystem for selinux configurable 2015-05-15 13:52:27 -04:00
Chen Zhidong 14719a6f08 Add judgment to to fix path0 if ANSIBLE_CONFIG is set to a dir 2015-05-14 22:02:30 +08:00
James Cammarata ce3ef7f4c1 Making the switch to v2 2015-05-03 21:47:26 -05:00
Devin Christensen 1bf5224f82 Enable writing plugins for jinja2 tests 2015-04-28 09:32:11 -06:00
Jesse Rusak 652cd6cd5e Fix --force-handlers, and allow it in plays and ansible.cfg
The --force-handlers command line argument was not correctly running
handlers on hosts which had tasks that later failed. This corrects that,
and also allows you to specify force_handlers in ansible.cfg or in a
play.
2015-04-10 19:38:59 -04:00
Brian Coca 5ec1f3bd6e removed folding sudo/su to become logic from constants as it is already present downstream in playbook/play/tasks 2015-03-27 08:45:04 -04:00
Brian Coca 587ab17f10 fixes password error detection for ssh connection plugin
removes sycnronize test that does not work with current sudo setup
Fixes #10434
2015-03-11 16:11:27 -04:00
Brian Coca 5f6db0e164 preliminary privlege escalation unification + pbrun
- become constants inherit existing sudo/su ones
- become command line options, marked sudo/su as deprecated and moved sudo/su passwords to runas group
- changed method signatures as privlege escalation is collapsed to become
- added tests for su and become, diabled su for lack of support in local.py
- updated playbook,play and task objects to become
- added become to runner
- added whoami test for become/sudo/su
- added home override dir for plugins
- removed useless method from ask pass
- forced become pass to always be string also uses to_bytes
- fixed fakerunner for tests
- corrected reference in synchronize action plugin
- added pfexec (needs testing)
- removed unused sudo/su in runner init
- removed deprecated info
- updated pe tests to allow to run under sudo and not need root
- normalized become options into a funciton to avoid duplication and inconsistencies
- pushed suppored list to connection classs property
- updated all connection plugins to latest 'become' pe

- includes fixes from feedback (including typos)
- added draft docs
- stub of become_exe, leaving for future v2 fixes
2015-03-10 18:42:36 -04:00
Brian Coca 13d788021f Merge pull request #4820 from mscherer/add_local_config
Add path for user defined plugin
2015-02-11 14:44:07 -05:00
Brian Coca 17666a1939 changed default for new retry path to be teh same as current
also added commented out entries in ansible.cfg to show other options
2015-01-30 15:18:58 -05:00
Brian Coca 540d13cf52 Merge pull request #9404 from mmoya/configure-retry-files
Configure retry file usage and location
2015-01-30 15:14:27 -05:00
Brian Coca c73254543a made env var also consistent 2015-01-29 13:32:00 -05:00
Brian Coca 4fd760467b made inventory consistent in config file, deprecated old config hostfile 2015-01-29 13:28:33 -05:00
Brian Coca 78e1a7ed93 Revert "Fix: Add support for SSL protocol version configuration option" 2015-01-19 08:36:17 -05:00
Jason Holland eedc51f213 Add support for SSL protocol version configuration option. Also fix 2 places where the SSL version was not being set properly. 2014-12-13 21:20:33 -06:00
Michael Scherer 7bffc1a29e add a default path in ~/.ansible to place plugins, so ansible is a bit
more usable out of the box as simple user
2014-12-11 23:33:51 +01:00
Maykel Moya c15b47fb7b Configure retry file usage and location
Adds new settings for managing retry files:
* retry_files_enabled, defaults to True
* retry_files_save_path, defaults to ~/.ansible-retry

This change was adapted from PR #5515.
2014-10-23 00:38:30 +02:00
Michael DeHaan e5116d2f9b changes for package loading of modules 2014-09-26 11:25:56 -04:00
Michael DeHaan 2064d26085 Add documentation about bin_ansible_callbacks setting. Standardization and cleanup. 2014-09-10 09:38:24 -04:00
Bruno BAILLUET 16108e4a99 Adding a new 'load_callback_plugins' config option, defaults to False
This option, when set to True, allows "ansible" command to load callback plugins
2014-09-06 16:41:16 +02:00
Dionysis Grigoropoulos f948b4f293 Handle exceptions during config file parsing
Handle uncaught exceptions during config file parsing
2014-08-29 17:55:42 +03:00
Michael DeHaan a419ffdf41 Make command warnings off by default to minimize surprises. 2014-08-22 16:12:48 -04:00
Will Thames ab8490d003 Added warnings to command module
Generate warnings when users are shelling out to commands
rather than using modules

Can be turned off on a per-action line with the documented
warn=False flag. Can be turned off globally using
command_warnings = False in ansible config file.

Print out warnings using the standard playbook callbacks.

Created some additional tests in TestRunner.test_command
and also a demonstration playbook.
2014-08-22 15:37:07 -04:00
Michael DeHaan 3035f2dcc8 Merge pull request #8367 from msabramo/make_pip_install_editable_work
Make `pip install -e` work
2014-08-15 07:46:54 -04:00
Michael DeHaan 02b0e102e6 Rename some INI keys for fact caching defaults 2014-08-11 15:16:51 -04:00
Michael DeHaan 542aaa6ffe Use JSON instead of pickles for compatibility. 2014-08-11 12:23:05 -04:00
Michael DeHaan 2629cd3fce Fix some copyrights, fix a misc test. 2014-08-11 12:23:05 -04:00
Josh Drake aa419044c4 WIP on the re-implementation of fact caching and various backends. 2014-08-11 12:23:05 -04:00
Marc Abramowitz 44b9f5e752 Make `pip install -e` work
This allows `pip install -e` and `python setup.py develop` to work
without having to do the stuff in
http://docs.ansible.com/intro_installation.html#running-from-source so
it's a tad nicer for Python programmers who are accustomed to installing
packages as editable/in development mode.

Fixes GH-8355 (https://github.com/ansible/ansible/issues/8355)
2014-07-30 13:35:11 -07:00
Veeti Paananen 5780f3a8b4 Expand variables in configuration files, take two
e.g. $HOME.
2014-07-29 15:20:59 +03:00
Veeti Paananen e6bd049892 Don't expand remote_tmp path locally 2014-07-29 15:19:54 +03:00
Michael DeHaan 106f4ccc01 Revert "Expand variables in configuration files" - I feel I've been here before.
Breaks some test runs.

This reverts commit a9eef029b6.
2014-07-28 17:10:42 -04:00
Veeti Paananen a9eef029b6 Expand variables in configuration files
e.g. $HOME. Fixes #6373.
2014-07-28 17:36:14 +03:00
James Cammarata 4fc8d4b6fe Merge pull request #7649 from sivel/vault-password-script
Allow --vault-password-file to work with a script as well as a flat file
2014-07-14 10:57:16 -05:00
James Cammarata 5429b85b9f Change safe_eval to a strict white list 2014-06-25 14:00:21 -05:00
Matt Martz 19f5ce2c9c Allow --vault-password-file to work with a script as well as a flat file 2014-06-24 15:02:24 -05:00
Chris Hoffman cf997beb07 Shell expand DEFAULT_ROLES_PATH fixes #4897 2014-06-20 19:23:46 -04:00
James Cammarata 6069ff6e9e Adding a new system_warnings config option to supress warnings 2014-04-30 14:44:10 -05:00
James Cammarata c115c34a1f Set the default LANG to en_US.UTF-8 and also set LC_CTYPE
Fixes #6737
2014-04-22 00:48:32 -05:00
James Cammarata 31628d86a1 Adding in a configurable option for the accelerate daemon timeout
This was apparently an oversite, as it has never been configurable
despite having a module parameter for the timeout.
2014-03-23 14:45:49 -05:00
James Cammarata 3ea5d573aa 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
Michael DeHaan e639b5382b Change default gathering policy, add to docs. 2014-03-19 18:03:03 -04:00
Brian Coca 4dfa40f18e added gathering control to ansible, defaults to 'smart' 2014-03-19 18:03:03 -04:00
Michael DeHaan fe696e4720 Merge commit. 2014-03-16 17:08:26 -04:00
James Cammarata 9730157525 Validate SSL certs accessed through urllib*
* Adds another module utility file which generalizes the
  access of urls via the urllib* libraries.
* Adds a new spec generator for common arguments.
* Makes the user-agent string configurable.

Fixes #6211
2014-03-10 16:06:52 -05:00
Michael DeHaan a4d01b0891 Also search .json filenames 2014-03-06 21:47:49 -05:00
Michael DeHaan 16d3be03af Remove a few extra legacy variable feature references. 2014-02-28 18:51:15 -05:00
Michael DeHaan 5443ddec75 Trim references to fireball as we want folks using accelerate or pipelining options. Fireball is pretty well deprecated at this point, but will still be part of the release. 2014-02-28 13:50:39 -05:00
James Tanner 427b8dc78d Ansible vault: a framework for encrypting any playbook or var file. 2014-02-18 15:35:12 -05:00
James Cammarata 92cbfff904 Merge branch 'sshdefault' of https://github.com/craigtracey/ansible into craigtracey-sshdefault 2014-02-18 09:44:19 -06:00
Richard C Isaacson 80ddd1ca75 Config resoution order correction and documentation. 2014-02-14 14:34:58 -06:00
xyrix 1de45bf687 made accelerate keys directory configurable, and permissions for the file and dir configurable, and gave them a safe default 2014-02-06 08:53:43 +00:00
Craig Tracey 8c6b3baf6f Make default ANSIBLE_REMOTE_PORT None
The ansible remote port should be None, not 22. Having a default value
of 22 means that '-o Port 22' will be appended to the ssh connection
all of the time. This is incorrect as when one would like to use
something like an ssh configuration file (-F) that sets the port to
something other than 22.

Part of this change requires that we check that, in get_config, the
value is not None before trying to cast it into an integer or float.
2014-01-23 12:49:07 -05:00
jeromew 3f23483022 Bug in constants.py, ANSIBLE_SSH_PIPELINING should be coerced to boolean 2014-01-22 13:54:28 +00:00
Paul Durivage f72f5a20df Revert "Revert "Merge pull request #5325 from angstwad/add-su-support""
This reverts commit c17d0e0357.

Conflicts:
	lib/ansible/runner/connection_plugins/paramiko_ssh.py
2014-01-20 19:19:03 -06:00
James Tanner c17d0e0357 Revert "Merge pull request #5325 from angstwad/add-su-support"
This reverts commit 6f4bfa2cff, reversing
changes made to c91ba3a7c7.
2014-01-20 16:10:11 -05:00
Paul Durivage 4088243deb Proposing fix for Issue #4324; adding support for su in connection plugins ssh, ssh_alt
Fixes for ssh_alt support, adding in references to in_data where appropriate
2014-01-20 11:25:10 -06:00
James Cammarata 02ce5af6df Added ANSIBLE_SSH_PIPELINING option to enable/disable pipelining support
Pipelining will be disabled by default, since it requires users remove
the 'requiretty' option from the servers sudoers configuration.
2014-01-16 12:41:33 -06:00
Michael DeHaan 10350d1639 Update various copyrights. Not complete, but sufficient. 2014-01-04 13:32:04 -05:00
Michael DeHaan 5b3c796641 Update constants.py
Lookup plugins for optional web services do not warrant advertising in ansible.cfg.
2013-12-21 08:46:11 -05:00
James Tanner 5d022182fe Fixes #5341 Use constants.py to set the roles directory 2013-12-18 22:40:58 -05:00
James Tanner f3a4705a9c Revert "Merge pull request #4874 from leth/editable_install"
This reverts commit 15b89b45e1, reversing
changes made to 3d836a1ab7.
2013-12-16 15:57:03 -05:00
jctanner 15b89b45e1 Merge pull request #4874 from leth/editable_install
Fix setup.py to work with 'pip install -e .'
2013-12-16 11:22:45 -08:00
Ferenc Grecu 56642f9b04 Remove unused parameter from _get_config 2013-12-12 18:48:02 +02:00
jctanner 0f0a89b34e Merge pull request #4758 from alanfairless/group-host-var-dirs
Support organizing group and host variables across multiple files in a directory
2013-11-14 11:57:11 -08:00
James Tanner f31cb7c6e8 Merge pull request #4664 from jpmens/ansible
Lookup plugin for etcd

with support for configurable etcd URL in ansible.cfg (and environment)
2013-11-12 15:29:05 -05:00
Marcus Cobden 8d98a55df1 Fix setup.py to work with 'pip install -e .' 2013-11-11 14:00:38 +00:00
Alan Fairless 0824f004d9 Revised patch for more password entropy 2013-11-01 09:51:35 -05:00
Alan Fairless babde9a84c refactor to catch edge cases, remove repeated code
- Move all the supported YAML file extensions into a constant
- Use helper functions to avoid duplicate code for group/host vars
- Catch and disallow some confusing situations, such as the presence of
  multiple group/host vars files for the same group/host, but with
  different extensions.  For example having both group_vars/all.yml and
  group_vars/all.yaml.
- Catch and report file system permission issues, symlink errors,
  unexpected file system objects
- Trivial performance improvement from making fewer stat system calls
- Restructuring that makes it easy for a following patch to support
  directory recursion
2013-10-31 12:18:17 -05:00
Jan-Piet Mens bd5cd8e652 Lookup plugin for etcd
with support for configurable etcd URL in ansible.cfg (and environment)
2013-10-24 21:28:48 +02:00
Thomas Omans 632232259a Adding config flag role_path for common/global roles
Using ANSIBLE_ROLE_PATH environment variable or role_path in ansible.cfg
can configure paths where roles will be searched for
extra paths will only be used as a backup once regular locations are exhausted
2013-10-12 10:15:30 -04:00
Michael DeHaan 9637f620d7 Deprecation warnings of several flavors, nice and purple and can be disabled
in ansible.cfg.
2013-10-11 18:37:39 -04:00
James Cammarata d73a5da9e5 Merge pull request #4453 from pschwartz/fix_cfg_load_order_to_match_docs
GH-4452 Corrected config load order to match docs
2013-10-11 07:25:05 -07:00
Philip Schwartz 65c8c691f7 GH-4452 Corrected config load order to match docs with
cwd > ~ > /etc

Signed-off-by: Philip Schwartz <philip.schwartz@rackspace.com>
2013-10-11 08:33:54 -05:00
Michael DeHaan 65178290e7 Merge branch 'devel' of git://github.com/nextus/ansible into devel
Conflicts:
	lib/ansible/constants.py
2013-10-07 08:39:23 -04:00
James Cammarata 912e3a7b0b Merge branch 'accelerate_improvements' into devel
Conflicts:
	library/utilities/accelerate
2013-10-01 21:22:17 -05:00
James Cammarata 8923a5b0d9 Drop default config value for accelerate timeout to 30 seconds 2013-10-01 16:10:48 -05:00
James Cammarata d317103371 Added in an accelerate connection timeout setting 2013-10-01 15:28:59 -05:00
James Cammarata 59a5ce23d9 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 6cd8aacc81 Merge branch 'hide_skipped_hosts' of https://github.com/jsmartin/ansible into jsmartin-hide_skipped_hosts 2013-09-30 20:22:53 -05:00
Brian Harring d0ad6c581b For defaults that are integers, enforce it for config supplied values.
If a user supplies a string in the config (rather than an int), the code
should fix that- or blow up immediately- rather than allowing that value to
work it's way down and break w/in the connection object; when that happens,
the actual error is opaque and requires pdb.set_trace() to run down.
2013-09-29 23:56:41 -04:00
James Martin d5f20e6b21 Optionally display Skipping [host] messages. 2013-09-26 10:03:23 -04:00
nextus ca96d74572 #4227 in upstream repo 2013-09-25 16:15:49 +04:00
James Cammarata 503f062521 Merge branch 'ferringb-fixes/configurable-ControlPath' into devel 2013-09-18 21:12:15 -05:00
Brian Harring 5b1b831cc7 Make ssh's ControlPath configurable via ansible.cfg
This shouldn't generally be needed unless you're working in an environment
that uses rediculously long FQDNs; if the name is too long, you wind up
hitting unix domain socket filepath limits enforced by ssh.
2013-09-18 15:07:07 -04:00
Skylar Saveland 50bd14faa9 use DEFAULT_MODULE_PATH in setup.py so that there is a chance to override with ANSIBLE_LIBRARY env variable 2013-09-16 19:08:22 -07:00
Skylar Saveland 8dc31f3093 ANSIBLE_DIST_MODULE_PATH environment variable 2013-09-16 13:43:20 -07:00
James Cammarata 959138d00d Added accelerate_port to plays, and made it configurable 2013-08-28 11:14:58 -05:00