Commit Graph

726 Commits (c271c0eb04f540bce8a4d6544cbcbc36dd2835a3)

Author SHA1 Message Date
Brian Coca c271c0eb04 added setting of ansible_ssh_user to current user as backwards compatibilty issue 9 years ago
James Cammarata 677a2f95e5 Make sure Base attributes are copied cleanly
Fixes #12882
9 years ago
Lars Kellogg-Stedman 914f68f9af allow include: directive to work during exception processing
prior to this commit, an attempt to use the `include:` directive would
fail in a `rescue:` or `always:` block if there were failures in the
main block task list.

Resolves #12876.
9 years ago
James Cammarata 86de1429e5 Cleaning up FIXMEs 9 years ago
Brian Coca 54e821ca94 added deprecation warning to comma separated role spec 9 years ago
Will Thames 002972c6cf Allow meta/main.yml to include roles through spec file
ansible-playbook now works when run with a playbook
that includes a role that includes another role
specified using csv format

Updated one of the roles used in the tests to fix
broken tests - `make test_galaxy` now works

Fixes #11486. Also addresses the problem alluded to in #10620.
9 years ago
James Cammarata 2b3c5aa41e Support cmd param in Tasks by assigning it to _raw_params
Fixes #12856
9 years ago
Brian Coca 1ecad5aed2 now galaxy correctly detects empty requirements file
also allow for 'scm' and 'src' not to be populated in requirements entries
9 years ago
James Cammarata b46ce47a84 Don't use local transport for delegated hosts if the inventory_hostname isn't local
For some situations like Vagrant, the remote_addr may be a localhost addr, but ssh
is still desired. This corrects the assumption that any localhost remote_addr should
be using the local connection by checking the inventory_hostname value as well.

Fixes #12817
9 years ago
James Cammarata 3c87c44af5 Fixing bug in includes caused by 892d9b8
Fixes #12837
9 years ago
James Cammarata e5b6d802bf Removing some cruft related to _local_action value on Task, which was removed
Fixes #12819
9 years ago
Brian Coca 1280e2296c changed warning to debug and expanded info on what is really happening, it was a bit misleading 9 years ago
Toshio Kuratomi baa309309d Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version. 9 years ago
Marius Gedminas f03da5be42 Python 3: there's no iteritems() 9 years ago
James Cammarata 82e76e42e5 Tweak to the way serial percentages are handled 9 years ago
James Cammarata 63e288354e Fix bug in way omitted values were set 9 years ago
James Cammarata 4c85ae0712 Merge branch 'serial_should_be_string' of https://github.com/klshxsh/ansible into klshxsh-serial_should_be_string 9 years ago
klshxsh ac00c9ced7 changed 'string' to 'percent' for _serial
Note that this allows both integers (e.g. 3) and percentages (e.g. "30%")
Also changed default back to 0 rather than '0'
9 years ago
Brian Coca d24532757c remove fix for local_action/connection local that is now not needed 9 years ago
klshxsh 4a5e52b2d2 The serial keyword can be specified as a percentage, e.g '30%' or a number e.g. '3'; therefore it needs to be a string to allow both types 9 years ago
Brian Coca abf2e13955 Revert "Track local_action internally to prevent it from being overridden"
This reverts commit 49ca0eb797.
9 years ago
Brian Coca 101c8785ec removed changes to make local action equate connection=local and brought it back to equate delegate_to=localhost 9 years ago
Juraci 254d6be520 Adding get_path method to Task class 9 years ago
James Cammarata 7a815b7296 Force connection to local when localhost is delegated to 9 years ago
Toshio Kuratomi 4f6f2c21e8 range vs xrange doesn't matter here and six.moves.range isn't available in six-1.3.0 (rhel7) 9 years ago
James Cammarata d9b79b1bbc Also template the role name when loading roles
Fixes #12602
9 years ago
James Cammarata 9c9897805f More ansible-galaxy fixes for the old spec file format 9 years ago
James Cammarata 3b8eaf6128 Cleaning up some ansible-galaxy stuff 9 years ago
James Cammarata 284bd118a0 Properly switch to the default transport when delegating from localhost 9 years ago
Brian Coca f73329401b galaxy updates
better error reporting on fetching errors
use scm if it exists over src
unified functions in requirements
simplified logic
added verbose to tests
cleanup code refs, unused options and dead code
moved get_opt to base class
fixes #11920
fixes #12612
fixes #10454
9 years ago
James Cammarata 323012be2e Pop tags out of playbook include params
Fixes #12605
9 years ago
Abhijit Menon-Sen 1981bf2b95 Aggregate ssh arguments in PlayContext instead of the connection plugin
Using set_host_overrides() in the connection plugin to access the ssh
argument variables from the inventory didn't see group_vars/host_vars
settings, as noted earlier. Instead, we can set the correct values in
the PlayContext, which has access to all command-line options, task
settings, and variables.

The only downside of doing so is that the source of the settings is no
longer available in ssh.py, and therefore can't be logged. But the code
is simpler, and it actually works.

This change was suggested by @jimi-c in response to the FIXME in the
earlier commit.
9 years ago
Abhijit Menon-Sen 3ad9b4cba6 Rework additional ssh argument handling
Now we have the following ways to set additional arguments:

1. [ssh_connection]ssh_args in ansible.cfg: global setting, prepended to
   every command line for ssh/scp/sftp. Overrides default ControlPersist
   settings.
2. ansible_ssh_common_args inventory variable. Appended to every command
   line for ssh/scp/sftp. Used in addition to ssh_args, if set above, or
   the default settings.
3. ansible_{sftp,scp,ssh}_extra_args inventory variables. Appended to
   every command line for the relevant binary only. Used in addition to
   #1 and #2, if set above, or the default settings.
3. Using the --ssh-common-args or --{sftp,scp,ssh}-extra-args command
   line options (which are overriden by #2 and #3 above).

This preserves backwards compatibility (for ssh_args in ansible.cfg),
but also permits global settings (e.g. ProxyCommand via _common_args) or
ssh-specific options (e.g. -R via ssh_extra_args).

Fixes #12576
9 years ago
Brian Coca c27bd4fab0 {sudo,su}_user does not imply become 9 years ago
James Cammarata 8ef78b1cf8 Fixing accelerated connection plugin 9 years ago
Brian Coca ddafed4403 Merge pull request #12528 from bcoca/task_logging
task logging revamp
9 years ago
James Cammarata 3bd71d0619 Use delegated_to field for play context remote_addr, if none other exists
Fixes #12527
9 years ago
James Cammarata dfa33d0f23 Tweak variable manager use in role includes to avoid test failures 9 years ago
James Cammarata 7173f587ed Allow delegate_to on a role again
Fixes #12560
9 years ago
James Cammarata a3e913da62 Don't assume handlers exist in the same role (if any)
Fixes #12536
9 years ago
James Cammarata 79e364d98b Properly template role dependency names
Fixes #12505
9 years ago
Marius Gedminas 5edd6d9be4 Python 3: there's no basestring
Fixes another failing test.

(I don't want to do a global search/replace for 'basestring' because I
want to have unit tests covering each occurrence.  When I run out of
existing failing tests, I'll try to write new ones.)
9 years ago
James Cammarata ffdba96668 Save the included directory for playbook includes for use as the basedir
Fixes #12524
9 years ago
Abhijit Menon-Sen 565c6f1ae7 Make ansible_pipelining a connection variable
SSH pipelining can be a significant performance improvement, but it will
not work if sudoers is configured to requiretty. With this change, one
could have pipelining enabled in ansible.cfg, but use sudo to turn off
requiretty in a separate play (or task) where pipelining is disabled:

    - hosts: foo
      vars:
          ansible_pipelining: no
      tasks:
        - lineinfile: dest=/etc/sudoers line='Defaults requiretty' state=absent
          sudo_user: root

(Note that sudoers has a complicated syntax, so the above lineinfile
invocation may be too simplistic for production use; but the point is
that a separate play can do something to disable requiretty.)
9 years ago
James Cammarata 6dd38c2a10 Fix parent attribute lookup to be default
Fixes #12526
9 years ago
James Cammarata a1c38a3fda Adding delegate_to to Blocks 9 years ago
Abhijit Menon-Sen 6ff4d40d74 Update outdated comment
We now use "sudo -n" instead of "sudo -k && sudo …"
9 years ago
Brian Coca 37a918438b task logging revamp
* allow global no_log setting, no need to set at play or task level, but can be overriden by them
 * allow turning off syslog only on task execution from target host (manage_syslog), overlaps with no_log functionality
 * created log function for task modules to use, now we can remove all syslog references, will use systemd journal if present
 * added debug flag to modules, so they can make it call new log function conditionally
 * added debug logging in module's run_command
9 years ago
Toshio Kuratomi fa9ea32a86 Fix test of whether a result has a failed host 9 years ago
James Cammarata 31d5f88a1d Use the task loop to calculate multiple delegated hosts
Due to the way we're now calculating delegate_to, if that value is based
on a loop variable ('item') we need to calculate all of the possible
delegated_to variables for that loop.

Fixes #12499
9 years ago