Example #1
0
    def v2_runner_on_ok(self, result):
        templar = Templar(loader=self.playbook.get_loader(),
                          shared_loader_obj=SharedPluginLoaderObj(),
                          variables=self._all_vars(host=result._host,
                                                   task=result._task))

        result._task.squash()
        foo = templar.template(result._task._attributes['environment'])
Example #2
0
 def setUp(self):
     fake_loader = DictDataLoader({
       "/path/to/my_file.txt": "foo\n",
     })
     shared_loader = SharedPluginLoaderObj()
     variables = dict(
         foo="bar",
         bam="{{foo}}",
         num=1,
         var_true=True,
         var_false=False,
         var_dict=dict(a="b"),
         bad_dict="{a='b'",
         var_list=[1],
         recursive="{{recursive}}",
     )
     self.templar = Templar(loader=fake_loader, variables=variables)
Example #3
0
 def setUp(self):
     self.loader = DictDataLoader({})
     self.cond = conditional.Conditional(loader=self.loader)
     self.shared_loader = SharedPluginLoaderObj()
     self.templar = Templar(loader=self.loader, variables={})