Thanks! - that clarifies it for me.
On Thursday, 14 August 2014 04:52:39 UTC-7, Michael DeHaan wrote:
>
> It's not possible to use inventory variables in the "host" spec ("-
> hosts:").
>
> Also, don't use debug with register, instead, if you need to set a
> variable:
>
> - set_fact:
> foo: "tag_Name_{{ aws.ec2.Name }}"
>
> "- hosts: {{ hostvars.localhost.aws_host_target.msg"
>
> This is also an error because the trailing "}}" is missing.
>
> You can pass in host spec parameters with "-e" on the command line.
>
>
>
>
> On Wed, Aug 13, 2014 at 7:48 PM, Shih Oon Liong <[email protected]
> <javascript:>> wrote:
>
>> I am trying to run two playbooks at the same time, with one taking a var
>> from the previous playbook.
>>
>> My code is as follows
>>
>> - name: Provision AWS
>>> hosts: localhost
>>> gather_facts: no
>>> vars_files:
>>> - configs/aws.yml
>>> tasks:
>>> - debug: msg='tag_Name_{{ aws.ec2.Name }}'
>>> register: aws_host_target
>>> - hosts: {{ hostvars.localhost.aws_host_target.msg
>>> remote_user: ubuntu
>>> sudo: Trues
>>> tasks:
>>> - debug: var=hostvars.localhost.aws_host_target.msg
>>
>>
>> Yet everytime it hits the second playbook, the variable
>> aws_host_target.msg is not readable specifically for the "hosts"
>>
>> Any help would be great!
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/db5c7342-c679-4edb-8c98-30dfdfb07dc0%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/db5c7342-c679-4edb-8c98-30dfdfb07dc0%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/60d4293c-2d36-4387-ac31-30a84e798607%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.