FAQ
Hi,

Is it possible to access ansible_ssh_host (and other inventory parameters)
in a playbook ?
The goal is to copy/backup files *from* a remote machine to the local
ansible station or a machine specified with delegate_to using rsync over
ssh. So i would need to expand the ssh connection info in the command.

Or is an action plugin the only way to make this kind of functionality
possible ?

Thanks,
Stefan

--
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 ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2db9cb28-a337-436c-9b78-e33020b9a144%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Amr Ali at Aug 8, 2014 at 1:42 pm
    yes you can use hostvars, hostvars[host]['ansible_ssh_host'] replacing host
    with the host you want to get in info on.

    also ansible_ssh_host is available as a variable for the current play host,
    you can simply do {{ ansible_ssh_host }}
    On Friday, August 8, 2014 9:14:39 AM UTC+2, Stefan Lapers wrote:

    Hi,

    Is it possible to access ansible_ssh_host (and other inventory
    parameters) in a playbook ?
    The goal is to copy/backup files *from* a remote machine to the local
    ansible station or a machine specified with delegate_to using rsync over
    ssh. So i would need to expand the ssh connection info in the command.

    Or is an action plugin the only way to make this kind of functionality
    possible ?

    Thanks,
    Stefan
    --
    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 ansible-project+unsubscribe@googlegroups.com.
    To post to this group, send email to ansible-project@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/06f7f62d-9103-462c-9219-06967832942b%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupansible-project @
postedAug 8, '14 at 1:32p
activeAug 8, '14 at 1:42p
posts2
users2

2 users in discussion

Stefan Lapers: 1 post Amr Ali: 1 post

People

Translate

site design / logo © 2022 Grokbase