~canonical-ci-engineering/ubuntu-ci-services-itself/ansible

« back to all changes in this revision

Viewing changes to lib/ansible/playbook/__init__.py

  • Committer: Package Import Robot
  • Author(s): Harlan Lieberman-Berg
  • Date: 2014-04-01 22:00:24 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20140401220024-jkxyhf2ggcv7xmqa
Tags: 1.5.4+dfsg-1
* Pull missing manpages from upstream development branch.
* New upstream version 1.5.4, security update.
* Add patch to correct directory_mode functionality. (Closes: #743027)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
import StringIO
30
30
import pipes
31
31
 
 
32
# the setup cache stores all variables about a host
 
33
# gathered during the setup step, while the vars cache
 
34
# holds all other variables about a host
32
35
SETUP_CACHE = collections.defaultdict(dict)
 
36
VARS_CACHE  = collections.defaultdict(dict)
33
37
 
34
38
class PlayBook(object):
35
39
    '''
95
99
        """
96
100
 
97
101
        self.SETUP_CACHE = SETUP_CACHE
 
102
        self.VARS_CACHE  = VARS_CACHE
98
103
 
99
104
        arguments = []
100
105
        if playbook is None:
335
340
            default_vars=task.default_vars,
336
341
            private_key_file=self.private_key_file,
337
342
            setup_cache=self.SETUP_CACHE,
 
343
            vars_cache=self.VARS_CACHE,
338
344
            basedir=task.play.basedir,
339
345
            conditional=task.when,
340
346
            callbacks=self.runner_callbacks,
426
432
            else:
427
433
                facts = result.get('ansible_facts', {})
428
434
                self.SETUP_CACHE[host].update(facts)
429
 
            # extra vars need to always trump - so update  again following the facts
430
 
            self.SETUP_CACHE[host].update(self.extra_vars)
431
435
            if task.register:
432
436
                if 'stdout' in result and 'stdout_lines' not in result:
433
437
                    result['stdout_lines'] = result['stdout'].splitlines()
500
504
            remote_port=play.remote_port,
501
505
            private_key_file=self.private_key_file,
502
506
            setup_cache=self.SETUP_CACHE,
 
507
            vars_cache=self.VARS_CACHE,
503
508
            callbacks=self.runner_callbacks,
504
509
            sudo=play.sudo,
505
510
            sudo_user=play.sudo_user,