Commit Graph

678 Commits (b757798f3edd139f9bde9774e4f6e41a24295a42)

Author SHA1 Message Date
Brian Coca fd2d7fe447 Merge pull request #10290 from bcoca/remove_bare_warning
removed bare variable detection as this confuses people
2015-03-18 20:43:56 -04:00
Brian Coca bbdcba53da fixed bug on using su on play level not setting become method correctly 2015-03-16 19:37:03 -04:00
Brian Coca a675b10b3b Merge pull request #10329 from bcoca/var_merge_combined
changed from hash_merge to combine vars which resets default to
2015-03-12 10:58:12 -04:00
Brian Coca de5eae2007 fixed traceback when x_user implicitly sets the become method
Fixes #10430

Also removed redundant resolution of sudo/su for backwards compatibility which
confused the conflict detection code.
2015-03-11 12:18:53 -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
Toshio Kuratomi 89159951dc Fix name of a task containing a template causing traceback
Workaround for #10321 Need to fix better in v2
2015-02-26 14:05:33 -08:00
Brian Coca c81d981164 Merge pull request #10183 from bcoca/tag_control
adds complex tag management
2015-02-25 10:36:11 -05:00
Brian Coca 4fa51652b4 fixed typoe in combined_Vars 2015-02-24 05:26:41 -05:00
Brian Coca ce764063f1 corrected merge vs combined in all pertinent sections 2015-02-24 05:14:22 -05:00
Toshio Kuratomi 920b71984e lists => frozenset as we're only using them in membership checks 2015-02-23 07:09:33 -08:00
Brian Coca 7044b5a8d1 removed bare variable detection as this confuses people and forced us to allow for bare expressions 2015-02-19 08:29:53 -05:00
Brian Coca f6a6df2169 removed unused method 2015-02-13 08:27:35 -05:00
Brian Coca 65c08d1364 added tests
refactored task selection into method
list-tasks now uses common method of task selection
always is now skippable if specified in --skip-tags
2015-02-13 08:27:07 -05:00
Brian Coca 6fbbf9c118 simplified if conditions 2015-02-13 08:27:07 -05:00
Brian Coca 6579c5ddf5 fixed skipped tags 2015-02-13 08:27:07 -05:00
Brian Coca 95fa770ba0 adds complex tag management
Adds a special tag:
 - always: always runs no matter what --tags, --skip-tags say

Adds 4 special keywords for --tags/skip-tags
 - all: all tagged + untagged tasks
 - tagged: only tagged tasks
 - untagged: only untagged tasks
 - always: only run tasks tagged 'always'
2015-02-13 08:27:07 -05:00
Brian Coca cbbe2f4e26 more resilient errors for bad host declarations in play
should fix #10148
2015-02-03 10:26:48 -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 1698b17b14 Merge pull request #8651 from ks888/enable-env-kw-at-play-level
Enable environment keyword at play level
2015-01-02 11:07:35 -05:00
James Cammarata f1386bb114 Use more variable sources when templating the play ds
Fixes #9699
2014-12-03 12:44:32 -06:00
James Cammarata 6570a6c6de Use additional vars when templating included file names
Fixes #9669
2014-12-01 15:00:14 -06:00
Hagai Kariti bc505050b0 Don't template play vars by themselves, it's too early 2014-11-26 15:45:38 +02:00
James Cammarata 968c56d765 Expand playbook_dir in time for loading tasks
Fixes #9618
2014-11-25 13:01:08 -08:00
Kishin Yagami ac4dc1f739 enable environment keyword at play level 2014-11-22 10:41:13 +09:00
James Cammarata 4b6b58ab11 Fix role parameter precedence after 9a0f8f0
Fixes #9497
2014-11-20 12:53:48 -06:00
James Cammarata 9a0f8f0158 Split out various vars-related things to avoid merging too early
Fixes #9498
2014-11-17 15:31:55 -06: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
James Cammarata 12d5b75a43 Template play vars after reading them
Fixes #9242
2014-10-06 10:50:55 -05:00
James Cammarata 0c40c6c23c Fix order of resolving dependent role variables from vars files
Also adds a new class to the test_var_precedence test to check for
this type of error in the future.

Fixes #9178
2014-10-03 13:30:47 -05:00
James Cammarata 313f26f866 Fix issue with vars precedence from roles
Fixes #9219
2014-09-30 15:50:46 -05:00
Toshio Kuratomi cf548baeab Fix missing strip() in a1809a371a 2014-09-29 18:07:55 -04:00
Toshio Kuratomi a1809a371a Target unnecessary templating warning at lines consisting of a single variable
Fixes #6407
2014-09-29 17:56:44 -04:00
James Cammarata c4f1785217 Use split_args instead of shlex to split include params
Fixes #8947
2014-09-23 16:12:01 -05:00
James Cammarata 8cc3543918 Re-allow templating of complex_args, but count params to prevent injection
Fixes #8810
2014-09-05 14:24:05 -05:00
James Cammarata 14b8e2cf01 Make sure set_fact variables go into VARS_CACHE
Fixes #8758
2014-09-03 09:39:50 -05:00
Will Thames ada9074276 Allow installation of roles from yaml roles file
Added docs
Added more tests
Improved how roles are returned from the parsers
2014-08-21 17:15:23 -04:00
Will Thames 46b59b02ed Friendly Role Names and roles from URLs
* Roles can now be given a friendly name as third field in role spec csv
* Roles can be installed from URL (not just from archived SCMs)
* Integration tests to demonstrate this
* Unit tests to ensure that role spec parsing works as expected
2014-08-21 17:15:23 -04:00
Will Thames 1803976a40 Ensured that role version can be specified in role dependencies 2014-08-21 17:15:23 -04:00
Will Thames c2fe33f9f4 Tidied up a little, added tests
Moved repo_url_to_role_name to common method in ansible.utils
Added unit test for repo_url_to_role_name
Added integration tests for galaxy
2014-08-21 17:15:23 -04:00
Will Thames b550cb9bc3 Need to take URLs into account when running playbooks too
Ensure that if meta/main.yml has dependencies containing URLs
these are correctly resolved at playbook runtime.

Update role_name during run time so that output of e.g. task names
look sensible
2014-08-21 17:15:23 -04:00
Serge van Ginderachter 7051cdeb57 roles: make role_path (path of current role) available as variable to the task 2014-08-21 11:56:27 +02:00
James Cammarata 8a1fbed5d6 Correct variable blending from vars_files with hostvars in them
Fixes #8638
2014-08-20 15:49:01 -05:00
James Cammarata 8a5675ca9f Fixing no_log for the playbook level use
Fixes #8647
2014-08-19 10:35:01 -05:00
James Cammarata ca6db40cb4 When serializing inventory, pop from the start of the hosts list
Fixes #8646
2014-08-19 09:04:47 -05:00
James Cammarata 542f07128e Correct check for role library/ existence
Fixes #8633
2014-08-18 13:33:23 -05:00
James Cammarata a01d97f12b Fixing variable name bug introduced in ac8950f
Fixes #8617
2014-08-14 10:55:26 -05:00
James Cammarata fc7859f445 Make sure playbook_dir variable is an absolute path
Fixes #8317
2014-08-12 09:51:44 -05:00
James Cammarata ac8950fd36 Set special vars in play.vars rather than load_vars
Also refactors playbook loading code relating to vars in playbooks
to a sub-function.

Fixes #8534
2014-08-11 19:23:54 -05:00
James Cammarata 783a1e3dfc Fixing broken patch 20957a1
Also adds integration tests for nested includes with conditionals
2014-08-11 14:58:48 -05:00
James Cammarata 20957a1b85 Remove duplicate compiling of task when: statements
Fixes #8538
2014-08-11 13:23:07 -05:00
Josh Drake aa419044c4 WIP on the re-implementation of fact caching and various backends. 2014-08-11 12:23:05 -04:00
James Cammarata a650421e39 Catch task parameter splitting errors nicely
Fixes #8481
2014-08-11 10:16:58 -05:00
hoettle 4243ce61b3 Correct placement of right parenthesis.
(serial_pct)/100.0 is a typo - the parentheses should be around the entire percentage calculation, which makes much more sense when multiplying by the number of hosts (luckily BODMAS prevailed).
2014-08-08 13:46:57 -04:00
Howard Oettle cbf0bd6baf playbook: permit the serial attribute to be a pecentage string as well as well as a straight integer 2014-08-08 13:46:57 -04:00
Michael DeHaan 8c4161d4a1 Merge branch 'retf_py' of git://github.com/berendt/ansible into devel
Conflicts:
	lib/ansible/inventory/vars_plugins/group_vars.py
	plugins/callbacks/mail.py
2014-08-08 12:17:37 -04:00
Michael DeHaan 48a0236ec6 Merge pull request #6619 from sergevanginderachter/ansible_version_var
Introduce an ansible_version dict as runner variable
2014-08-08 11:20:17 -04:00
James Cammarata e19ed3424d Make sure default vars are used in template calls for tasks
Fixes #8499
2014-08-07 13:28:09 -05:00
James Cammarata 80df2135e9 Fix parsing of tasks with variable module names
Also adding an integration test for same.
2014-07-30 14:18:06 -05:00
James Cammarata e6fa50a306 Move splitter to module_utils so modules can use it and fix command arg splitting
Fixes #8338
2014-07-29 14:55:16 -05:00
James Cammarata 6e814566de Unquote params passed to an include statement
Fixes #8315
2014-07-28 16:35:52 -05:00
James Cammarata 6eac47e519 Use split_args instead of shlex.split for included params
Fixes #8296
2014-07-26 00:30:42 -05:00
James Cammarata b21875d5a9 Make sure 'item' variable is set when using first_available_file
Fixes #8220
2014-07-24 00:05:26 -05:00
Michael DeHaan 0fad9575e9 Refine error message about invalid ops since people forget to indent tasks fairly often. 2014-07-17 10:13:10 -04:00
James Cammarata e74853300a Merge branch 'task-host-loop-bypass' of https://github.com/sivel/ansible into sivel-task-host-loop-bypass 2014-07-14 14:21:25 -05:00
James Cammarata fe892fccb1 Merge remote-tracking branch 'svg/varsplugins_refactor' into svg_and_inventory_refactor 2014-07-07 14:16:37 -05:00
James Cammarata ff04b2b532 Allow empty yaml vars files
Fixes #7843
2014-07-04 23:10:32 -05:00
Chris Church 4e98e3785a Reset play attribute on callback plugins when a play fails. 2014-07-01 17:02:10 -04:00
James Cammarata 6d9cc64e0f Add role_names to valid keys entry for plays
Prevents a "not a legal parameter" error for play ds structures that
may be passed into the Play() constructor, which really is mainly a
concern during tests.
2014-06-16 10:00:43 -05:00
James Cammarata 82a784931e Fix error passing play vars to an included playbook with empty vars
Fixes #7658
2014-06-04 13:22:50 -05:00
James Cammarata 74f20ebf79 Removing cruft leftover from the deprecation of include+with_items
Also cleaning up integration tests that had checks for the empty item
attribute in certain results.

Fixes #7535
2014-06-03 13:33:26 -05:00
James Cammarata cfd8c685d1 Correct issue of handlers running on all hosts incorrectly
Also adds an integration test to catch this bug in the future.

Fixes #7559
2014-05-27 12:03:08 -05:00
James Cammarata e36a8d466e Don't re-query inventory when trimming failed/dark hosts
Since the filter list contains hosts, passing that back to list_hosts()
in the inventoy causes issues when the hostname is an IPv6 address
(with :'s interpreted as group unions). Since we already have the list
of hosts, we should not need to pass that back through inventory a
second time.

Fixes #7446
2014-05-20 14:58:37 -05:00
Matt Martz 0e953c2863 Add run_once task key
This caused the task to act like  bypass host loop plugin and
execute only on a single host. Can be used with delegate_to
2014-05-19 12:33:47 -05:00
James Cammarata 7faecd54b0 Merge pull request #7388 from jimi-c/issue_7384_vars_files_include
Pass vars_files on to included playbooks too
2014-05-14 14:52:33 -05:00
James Cammarata 525e7339ed Merge branch 'pass-basedir-to-runner-on-setup' of https://github.com/ByteInternet/ansible into ByteInternet-pass-basedir-to-runner-on-setup 2014-05-14 09:46:47 -05:00
James Cammarata 85bd6810bb Pass vars_files on to included playbooks too
Fixes #7384
2014-05-14 08:37:47 -05:00
Allard Hoeve c5833f9869 Add missing basedir to Runner in _do_setup_step 2014-05-14 15:22:02 +02:00
James Cammarata 360ffc4dfd Properly merge role conditionals in with pre-existing conditionals
Fixes #7387
2014-05-14 01:45:35 -05:00
James Cammarata 187619c7fe Use utils.combine_vars on vars_files data
Fixes #7345
2014-05-13 11:24:41 -05:00
James Cammarata 2e2e5d5321 Use the existing module_vars during the templating of module_vars
Since some of the vars contained in there may be used in the templating
of other variables. This also reverts e83a494 which originally fixed
issue #6979 but broke some other variable related things.

Fixes #6979
Fixes #7321
Fixes #7332
2014-05-08 13:09:36 -05:00
Christian Berendt 6676720ce5 fixed typos found by RETF rules in PY files
rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos
2014-05-03 18:40:05 +02:00
Michael Scherer 0f0f5ff1ce Give more information when a task is empty
I made a typo in a playbook and was great by:

    ERROR: expecting dict; got: None

The issue was a single - on the last line of a playbook.
With the name of the file, I was able to see right away where the
error was.
2014-04-23 13:13:46 +02:00
James Cammarata e83a494e41 Make sure VARS_CACHE for hosts are updated with the play vars too
Fixes #6979
2014-04-22 14:42:43 -05:00
Michael Scherer 1e34e95ba0 Improve error message when multiple action are given
This can be illustrated using this playbook:

    - command: id
      delegate_to: "{{ remote_server }}"
      user: "{{ remote_user }}"

The error is to use 'user' instead of 'remote_user', but the error message
do not really mention it, so it can be a bit hard to spot.
2014-04-20 20:32:33 +02:00
James Tanner 4eb626825b Refactor play._update_vars_files_for_host to make common functions and easier debugging
Fixes #4883
2014-04-10 13:43:59 -04:00
Serge van Ginderachter d240e2b9fb Introduce an ansible_version dict as runner variable
Given the version:
    "1.6 (ansible_version_var 14499e8bf3) last updated 2014/03/21 17:07:50 (GMT +200)"

  We get the special variable:
    "ansible_version": {
        "full": "1.6",
        "major": 1,
        "minor": 6,
        "revision": 0,
        "string": "1.6 (ansible_version_var 14499e8bf3) last updated 2014/03/21 17:07:50 (GMT +200)"
       }

	modified:   lib/ansible/playbook/__init__.py
	modified:   lib/ansible/runner/__init__.py
	modified:   lib/ansible/utils/__init__.py
2014-04-08 17:14:42 +02:00
Michael DeHaan 0a574af270 Merge pull request #5555 from sivel/expose-playbook-to-callback
Expose the playbook to callback plugins
2014-04-03 17:01:28 -04:00
James Cammarata 317c2f4bc0 Fixes to variable issues introduced by recent changes
Fixes #6801
Fixes #6832
2014-04-02 19:49:38 -05:00
James Cammarata a6a4680e5c Fix variable naming issue in _load_tasks()
Fixes #6800
2014-04-02 16:13:22 -05:00
James Cammarata e2d86e4f43 Splitting SETUP_CACHE into two caches, one for host vars and one for setup facts 2014-04-01 16:23:33 -05:00
James Cammarata 612a1a64f0 Apply extra vars after all other vars have been merged in a play
Fixes #6677
2014-03-31 15:31:10 -05:00
James Cammarata 78bdb078fe Fix for bug related to async jid polling change plus a new test 2014-03-26 15:49:15 -05:00
James Tanner 38de8cc87e Addresses #6705 Only set the role_uuid inside the role vars 2014-03-26 14:43:07 -04:00
James Tanner 8991e403e8 Fixes #6705 Give each role a unique uuid and apply tags only to tasks matching the uuid 2014-03-26 13:29:41 -04:00
James Cammarata 9ede6f7f49 Convert gather_facts to a boolean value if it is not None
Fixes #5618
2014-03-26 12:04:06 -05:00
Serge van Ginderachter f8ea93c732 Move inventory.set_playbook_basedir from ansible-playbook to playbook constructor 2014-03-25 22:12:01 +01:00
James Tanner f9018a6f1d Ensure handlers run when meta tasks are defined and add handler integration tests
Fixes #6678
Fixes #6670
2014-03-25 13:33:52 -04:00
James Tanner ebd1f70c5d Typo in setting task_errors variable 2014-03-25 10:35:05 -04:00
James Tanner 605156c904 Fixes premature handler execution after adding force-handlers 2014-03-25 00:20:11 -04:00
James Tanner 9169a11088 Fixes #4777 add --force-handlers option to run handlers even if tasks fail 2014-03-24 10:28:48 -04:00
James Tanner 5b3b9ba267 Addresses #4407 Caculate failed percentage based on serial and number of hosts in play 2014-03-21 13:31:47 -04:00
James Tanner 14499e8bf3 Fixes #4325 allow async and poll parameters to be templated vars 2014-03-20 16:09:58 -04:00
James Tanner 95c79ad483 Fixes #4239 merge injects with new vars loaded from files 2014-03-20 13:12:33 -04:00
James Tanner d327e3d11a Fixes #5622 included tasks in roles now inherit tags from the role 2014-03-20 11:56:13 -04:00
Brian Coca 18adf07fc6 changed setting values and updated 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
James Cammarata eb7717aa02 Make sure all tags are in a list before merging for role deps
Fixes #6557
2014-03-18 12:32:22 -05:00
James Cammarata 84908a57fc Don't filter role deps on tags
Also, fixed a bug where the tags were being merged into the wrong
data structure (passed_vars) in _build_role_dependencies()

Fixes #6439
Fixes #5709
2014-03-17 23:03:16 -05:00
James Cammarata 7edee91aba Fixing a bug in role tag handling where only the first tag was used
Fixes #6517
2014-03-17 11:28:54 -05:00
Michael DeHaan b8f1e4f765 Merge pull request #6134 from veeti/include_with_items_path
Show the offending file name with the include + with_items error
2014-03-16 15:10:31 -05:00
Michael DeHaan 9cdbc53741 Merge pull request #6420 from bcoca/role_names
added new role_names variable that exposes current roles list
2014-03-16 14:42:40 -05:00
Michael DeHaan 26efc7ace8 Revert "Populate module_setup from the setup module rather than special code elsewhere"
This reverts commit 58eec2e4c2.
2014-03-16 14:11:43 -04:00
Michael DeHaan a9896afc66 Merge pull request #6418 from bcoca/template_itnore_errors
templates ignore_errors
2014-03-16 12:44:51 -05:00
Dag Wieers 58eec2e4c2 Populate module_setup from the setup module rather than special code elsewhere
This small change allows for individual setup actions to populate the SETUP_CACHE and not cause a subsequent facts-gathering when not needed. This follows the standard of other facts modules as laid out in #1206 and implemented in fedfd18774. It allows to test of the setup module has already been run even when gather_facts was explicitely disabled.
2014-03-16 13:37:07 -04:00
Cristian Ciupitu 0749112286 Micro-optimization: replace s.find(x)!=-1 with x in s
timeit shows a speedup of ~3x on Python 2.7.5 x86_64.
It also makes the code a bit shorter.
2014-03-16 13:10:28 -04:00
James Cammarata 86d2ee4b97 Don't append tags from roles to the plays tags list
Fixes #6393
2014-03-12 10:41:18 -05:00
Brian Coca 906e59d8a8 added new role_names variable that exposes current roles list 2014-03-11 22:13:29 -04:00
Brian Coca 7778aca966 templates ignore_errors 2014-03-11 21:30:58 -04:00
James Cammarata 6577ff5f85 Add tags from handlers to tag availability calculation 2014-03-10 16:06:13 -05:00
Seth Woodworth 1d5db30067 Updates loop warning, removes unnecessary c 2014-03-09 00:19:28 -05:00
James Cammarata 04a6dc6d12 Check for skipped tags in passed role variables before adding to them
Fixes #6330
2014-03-08 18:55:42 -06:00
James Cammarata b6056044b7 Partial revert of 73c883c due to issues with handlers in roles
Fixes #6322
2014-03-06 21:13:40 -06:00
Michael DeHaan a4d01b0891 Also search .json filenames 2014-03-06 21:47:49 -05:00
Brian Coca 79809b67dc fixed another line with same issues
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2014-03-06 08:43:24 -05:00
Brian Coca d3d5680d8f tags lists are properly uniqued and joined now, also avoids type issues when passed as list/set or strings
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
2014-03-06 08:28:36 -05:00
James Cammarata 73c883c122 Keep track of role dependencies across plays
Also fixes a bug in which tags specified on top-level roles were
not being passed down to dependent roles.

Fixes #4656
2014-03-05 14:37:37 -06:00
Hagai 0e4b38ed5a Fix incorrect use of copy on list 2014-03-03 14:47:57 +02:00
James Cammarata b758ed9417 Merge pull request #6150 from hkariti/fix_join_bug
Fix incorrect use of .join on list causing a traceback
2014-02-26 12:50:07 -06:00
Hagai ae9c0d87a9 Fix incorrect use of .join on list 2014-02-24 19:48:55 +02:00
Veeti Paananen dd6f2e6bfa Show the offending file name with the include + with_items error 2014-02-23 20:51:57 +02:00
James Cammarata fa1ab231c9 Fixing bug in which playbook vars were not merged properly
This occurred when a hash would be passed in via extra args and the
hash variable behavior was set to 'merge', which resulted in the
variable from extra args replacing the playbook variable.
2014-02-20 15:25:52 -05:00
James Tanner 3fc87e011b Fix all other calls to yaml 2014-02-19 11:01:21 -05:00
James Tanner 427b8dc78d Ansible vault: a framework for encrypting any playbook or var file. 2014-02-18 15:35:12 -05:00
jctanner 28933de84d Merge pull request #5771 from bcoca/play_hosts2
added new play_hosts var
2014-02-05 23:52:20 -05:00
jctanner 253fe7be50 Merge pull request #5662 from RSpiertz/update_playbook_error
PlayBook: better error message
2014-02-04 11:16:44 -08:00
James Cammarata ae9843fccd Fix issue with handler notifications being sent out incorrectly
This is a partial revert of e8ad36c, which introduced the bug.

Fixes #5848
2014-02-03 10:10:45 -06:00
James Cammarata 75e3b59bbd Adding no_log: capability for tasks
Fixes #4088
2014-01-31 16:58:46 -06:00
James Cammarata 5cc354696d Build variable dictionary on included plays without using dict()
Using dict(k=v) means the key was always named 'k', as the variable
is not interpreted there.

Fixes #5801
2014-01-29 12:31:12 -06:00
Michael DeHaan d07a3b5e9b AnsibleWorks -> Ansible 2014-01-28 20:29:42 -05:00
James Cammarata 88e2595a90 Fixing bug relating to su without an su_pass 2014-01-27 16:27:02 -06:00
Brian Coca 59d5892fa3 added new play_hosts var
this variable has the 'current host list' to be executed over in the
play. Useful when using --limit to not iterate over hosts not included
in play in templates or with_items.

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
2014-01-25 18:43:15 -05:00
jctanner b2d594d24e Merge pull request #5724 from angstwad/su-tasks-fix
Fix bug where playbook tasks do not escalate privs with 'su'
2014-01-23 14:05:14 -08:00
jctanner 19e8742005 Merge pull request #5713 from angstwad/su-fix
Disallow su and sudo params in same play/task
2014-01-23 13:55:43 -08:00
Paul Durivage e875089eba Fix bug where self.su was being set by the sudo param in play tasks 2014-01-22 11:04:19 -06:00
Paul Durivage 01d1bd61e7 Disallow su and sudo params in same play/task 2014-01-22 10:55:45 -06:00
James Tanner 61d283e2ad Fix merge conflicts from #5519 2014-01-21 13:35:06 -05: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
Jesse Keating 6013f0738e Store the list of hosts to run on in runner object
This reduces the number of times inventory.list_hosts is called, which
can be costly. When coming from a playbook that data is already known.
2014-01-20 16:22:28 -08:00
Jesse Keating e8ad36c8d4 Store hosts for a play as a play attribute
Operate on that play attribute to make things faster for larger
inventories. Instead of making a round trip through inventory.list_hosts
and working through some lengthy list comprehensions over and over
again, calculate the potenital hosts for a play once, then reduce from
it the unavailable hosts when necessary.

Also moves how the %fail is done. The host count is a play level count
of available hosts, which then is compared after each task to the
current number of available hosts for the play. This used to get a new
count every task which was also time expensive.
2014-01-20 16:22:28 -08: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 dec9131735 Ensure playbook support for su params 2014-01-20 11:46:56 -06:00
Paul Durivage d21281ff43 Resolve rebase conflicts 2014-01-20 11:46:05 -06: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
Rutger Spiertz dec6345fe6 PlayBook: better error message
When a PlayBook has missing arguments the error message now shows which ones are missing.
2014-01-17 10:30:57 +01:00
Matt Martz f99500d65c Expose the playbook to callback plugins 2014-01-08 14:40:37 -06:00
Michael DeHaan c039e276a2 Fact gathering on a second play against the same hosts should not be implicitly off since this is an undocumented beheavior and potentially
rather unwanted when a play could change a fact.

gather_facts: True/False can still be explicitly used per play.

Reverts 564a212b3c
2014-01-04 14:03:58 -05:00
Michael DeHaan 87258f6d42 Resolve merge commit 2014-01-04 14:03:42 -05:00
Michael DeHaan a3d90e8a87 Merge pull request #5498 from j2sol/exit_setup_early
Return early from setup step when possible
2014-01-04 10:47:35 -08:00
Michael DeHaan 10350d1639 Update various copyrights. Not complete, but sufficient. 2014-01-04 13:32:04 -05:00
Jesse Keating 35328ed503 Return early from setup step when possible
The _list_available_hosts call can be lengthy, and in the case where
gather_facts is disabled the call is pointless. So re-arrange the logic
to return early from _do_setup_step when gather_facts is false.
2014-01-03 16:39:13 -08:00
Michael DeHaan 8e5b7d3095 Remove code underlying when_* and only_if, which are deprecated features slated for removal in the 1.5 release. 2014-01-03 19:13:21 -05:00
Michael DeHaan 28b9fd4e30 We have had only_if, when_foo, etc, deprecated for a while and said they would be removed in 1.5. Now they are, with friendly error messages still.
Users of these features should use "when:" as documented at docs.ansible.com.

Similarly, include + with_items has been removed.  The solution is to loop
inside the task files, see with_nested / with_together, etc.
2014-01-03 13:47:54 -05:00
James Tanner 993e0f057e Allow for no role dependencies in role metadata 2013-12-19 14:19:14 -05:00
James Tanner 1ef9930b80 Addresses #5341 Expand home directories when searching for roles in ansible-playbook 2013-12-18 23:31:03 -05:00
Michael Vogt bef5ee2c3b improve error on invalid vars file (if its a list instead of a dict) 2013-12-12 09:56:30 +01:00
James Tanner dc41bb8085 Merge pull request #4207 from ashorin/ansible
Fail playbook when serial is set and hadlers fail on set.
2013-11-12 14:37:07 -05:00
Alan Descoins bb6f02d0e8 Support running handler parametrized by name. 2013-11-07 16:54:06 -02:00
James Tanner d93780bc8a Addresses #4635 add list instead of join 2013-11-05 14:44:27 -05:00
James Tanner 2b5005687a Fixes #4635 pass role conditionals to dependent roles 2013-11-05 14:38:21 -05:00
James Tanner 91aa7b51df Remove invalid ipv6 parameter from setup execution 2013-11-04 17:23:32 -05:00
James Tanner c1ed47933b 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
James Tanner d154bf8781 Revert templating enhancements from 73dbab70 e6c28658 d409352c 9858b1f2 4587528b 9b1fe455 214b0b05 8d3db803 7f9504d1 5031104c 35cb9dc2 2bd8cb57 1e85c754 2013-10-30 10:50:16 -04:00
James Tanner 9b1fe455c6 Fixes #4549 Do not call lookup plugins when templating a task's name 2013-10-25 10:27:38 -04:00
Serge van Ginderachter 6277e770a1 include basedir as 'playbook_dir' variable
closes #4246
2013-10-25 07:53:52 +02:00
James Tanner 4f13967386 Fixes #4536 Get the remote_user from multiple sources in a preferred order 2013-10-21 12:07:51 -04:00
Michael DeHaan 60944b81f0 Provide warning about "with_items: '{{ loop }}'" being redundant only when {{ starts the expression value. Fixes #4582. 2013-10-19 14:24:12 -04:00
Michael DeHaan 4125b05bf3 Allow a defaults file to solely define a role. Some typo fixes. 2013-10-19 14:01:20 -04:00
Michael DeHaan 21d4400c96 Misc pep8 fixes 2013-10-19 13:03:15 -04:00
James Tanner 8478e82647 Fixes #4583 enforce that vars_files is a list 2013-10-18 11:19:16 -04:00
jctanner 69fa5954fd Merge pull request #3932 from jocelynj/devel
Add option remote_user to task level, to specify the ssh login user
2013-10-15 06:34:57 -07:00
Michael DeHaan 9ea54fcaaf Fixes a dev branch glitch where a conditional could be applied to multiple tasks. Also improves the errors on parsing bad conditionals to make them less confusing to users. 2013-10-12 17:39:28 -04: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 d168c709d5 Fix an issue where the ordering of an include statement is processed ahead of the conditional in the included statement,
which required a redundant check to see if a variable was defined rather than short circuiting.

Fixes #4469
2013-10-11 20:43:58 -04:00
Michael DeHaan 709ffda3d1 Tweak only_if deprecation detector. 2013-10-11 19:12:25 -04:00
Michael DeHaan a45494a896 Add warnings feature. 2013-10-11 19:04:26 -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
Michael DeHaan 6febc97104 Add a warning about include + with_items so nobody uses it. 2013-10-08 18:12:18 -04:00
James Cammarata 98f6bc1f63 Apply tags to dependent roles correctly
Fixes #4339
2013-10-08 15:13:02 -05:00
Michael DeHaan f081c68a65 Prevent duplicately loaded handlers from running more than once.
Fixes #3863
2013-10-07 17:15:19 -04:00
Michael DeHaan 5e30cd999c Make it possible to say:
tags: 42

And have the tag be a string, not an int, so --tags matches.

Fixes #4110
2013-10-07 15:19:30 -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 8c17711247 Removing accelerate_timeout as a playbook option
This will remain in ansible.cfg only.
2013-10-01 15:33:18 -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 8a3f8b757b Make sure yaml data loaded for role is valid before using it
Fixes #4322
2013-10-01 10:52:39 -05:00
James Cammarata 7aad576f5f Minor change to add a space around role name/task delimiter 2013-09-30 21:51:39 -05:00
bennojoy 482cb72128 role report fix 2013-09-26 19:20:14 +05:30
bennojoy 53e48b63a9 dountil feature commit 1 2013-09-24 13:59:38 +05:30
James Cammarata 47b9cc6311 Merge branch 'meta-roles' of https://github.com/eggsby/ansible into eggsby-meta-roles
Conflicts:
	lib/ansible/playbook/play.py
2013-09-20 16:17:40 -05:00
James Cammarata 27e8675277 Make the role_name in the task its own field for use in the callback 2013-09-20 15:46:34 -05:00
James Cammarata 98cfcec5e2 Correct role name detection 2013-09-20 12:10:24 -05:00