On 21. april 2017 07:35, Tony Xynidakis wrote:
  ...
- set_fact:
target_host: "tag_Name_RHEL-base-{{ instance_date }}-01"
- debug: var=target_host


- name: Build RHEL Base AMI image
hosts: "{{ target_host }}"
#hosts: tag_Name_RHEL-base*
connection: local
gather_facts: False
tasks:
- debug: msg="Hostname is {{ target_host }}"


The error is
TASK [set_fact]
****************************************************************
ok: [localhost]

TASK [debug]
*******************************************************************
ok: [localhost] => {
    "target_host": "tag_Name_RHEL-base-20170421-01"
}

You need to specify from which you are fetching the variable from.

{{ hostvars.localhost.target_host }}

--
Kai Stian Olstad

--
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/a08333ff-1889-aeb6-2fe6-468e452edc72%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to