Hello,
I'm trying to invoke the copy action plugin with a timestamp var. Here is 
the code:
```
    def copy(self, task_vars):
        new_task = self._task.copy()
        new_task.args.update(
            dict(
                src="/etc/systemd/network/",
                dest="/etc/systemd/network_backup_{{ timestamp }}",
                remote_src=True,
            ),
        )
        print(f"new_task={new_task}")
        copy_action = self._shared_loader_obj.action_loader.get('copy',
                                                                
task=new_task,
                                                                
connection=self._connection,
                                                                
play_context=self._play_context,
                                                                
loader=self._loader,
                                                                
templar=self._templar,
                                                                
shared_loader_obj=self._shared_loader_obj)
        ret = dict()
        task_vars.update(dict(timestamp="foo"))
        ret.update(copy_action.run(task_vars=task_vars))
        print(f"copy action ret = {ret}")
```

I would like the var `timestamp` to be replaced with foo. Is possible with 
ansible vars? Or do I need to perform the lookup/replace by hand?

Regards
Yves

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/a5d675ea-d981-4235-bfa2-ec562b995c02n%40googlegroups.com.

Reply via email to