Commit Graph

237 Commits (69edd9e0bb99e2381c782f60d313ff6db8ef1266)

Author SHA1 Message Date
Toshio Kuratomi 0b96d61162 Convert playbook basedir into unicode at the borders 2016-11-21 09:24:37 -08:00
James Cammarata 733d017ad0 Save and restore the loader's basedir when loading playbooks
Fixes #15930
2016-05-23 15:04:44 -04:00
Brian Coca d3deb24ead output color is now configurable 2015-12-29 17:40:47 -05:00
Matt Martz 384b2e0234 Get v2_playbook_on_start working
* Move self._tqm.load_callbacks() earlier to ensure that v2_on_playbook_start can fire
* Pass the playbook instance to v2_on_playbook_start
* Add a _file_name instance attribute to the playbook
2015-12-02 11:29:51 -06:00
Toshio Kuratomi 4203850d1a Break apart a looped dependency to show a warning when parsing playbooks
Display a warning when a dict key is overwritten by pyyaml
Fixes #12888
2015-10-27 12:39:42 -07:00
Thomas Quinot 5d3cb636ad Minor comment fix 2015-08-05 11:30:26 +02:00
James Cammarata 61e76fd707 Allow conditionals on PlaybookInclude statements
Fixes #11852
2015-08-04 15:24:28 -04:00
James Cammarata 5266679964 Use templar all the way down
Fixes bugs related to creating Templar() objects on the fly, where
the shared loader objects (serialized to TaskExecutor) aren't used
so information loaded into plugin loaders after forking is lost.

Fixes #11815
2015-08-04 12:25:53 -04:00
James Cammarata ce3ef7f4c1 Making the switch to v2 2015-05-03 21:47:26 -05:00
Carlos E. Garcia cfbfd38723 just a few spelling error changes 2015-04-28 09:36:42 -04: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 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 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 540d13cf52 Merge pull request #9404 from mmoya/configure-retry-files
Configure retry file usage and location
2015-01-30 15:14:27 -05: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 c4f1785217 Use split_args instead of shlex to split include params
Fixes #8947
2014-09-23 16:12:01 -05:00
James Cammarata 14b8e2cf01 Make sure set_fact variables go into VARS_CACHE
Fixes #8758
2014-09-03 09:39:50 -05: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 ca6db40cb4 When serializing inventory, pop from the start of the hosts list
Fixes #8646
2014-08-19 09:04:47 -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
Josh Drake aa419044c4 WIP on the re-implementation of fact caching and various backends. 2014-08-11 12:23:05 -04: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 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
Chris Church 4e98e3785a Reset play attribute on callback plugins when a play fails. 2014-07-01 17:02:10 -04: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 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 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
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
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 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 78bdb078fe Fix for bug related to async jid polling change plus a new test 2014-03-26 15:49:15 -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