Thank you, Todd! That works. I thought I had tried that previously, and it
failed. I must have done it wrong.
On Wednesday, February 14, 2024 at 10:21:38 AM UTC-5 Todd Lewis wrote:
> - { src: "{{ var_containing_package1 }}" }
>
>
> On 2/14/24 9:00 AM, Dimitri Yioulos wrote:
>
> I have plays in a playbook to copy files to a remote host, then delete
> them at the end of the task list. This is the copy play:
>
>
>
>
>
>
>
>
>
>
> * - name: Copy files to host copy: src: "{{ item.src }}"
> dest: /tmp mode: u=rwx,g=rw,o=rw with_items:
> - { src: package1 } - { src: file1 } - { src: file2 }
> tags: copy_files*
>
> package1 is changeable, from time-to-time. I'd like to add the name as a
> variable, then call the variable in both the copy and delete plays, so that
> I only have to change the package name once. How can I accomplish that? All
> of my attempts have failed.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/52e9d6e8-cbb1-4a5d-9b96-87360303b12bn%40googlegroups.com
>
> <https://groups.google.com/d/msgid/ansible-project/52e9d6e8-cbb1-4a5d-9b96-87360303b12bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/2806b779-f3ad-4c8a-96b9-1be440920ee3n%40googlegroups.com.