I'm expecting ansible_fqdn to have the same value as inventory_hostname ,
see my test playbook and output bellow :
"""
- name: show inventory_hostname
debug: msg="inventory_hostname is {{ inventory_hostname }}"
- name: show ansible_fqdn
debug: msg="ansible_fqdn is {{ ansible_fqdn }}"
- name: set ansible_fqdn fact
set_fact: ansible_fqdn={{ inventory_hostname }}
- name: show ansible_fqdn
debug: msg="ansible_fqdn is {{ ansible_fqdn }}"
#####
PLAY [all] ******************************************************
GATHERING FACTS
***************************************************************
ok: [server1.example.net]
TASK: [common | show inventory_hostname]
**************************************
ok: [server1.example.net] => {
"msg": "inventory_hostname is server1.example.net"
}
TASK: [common | show ansible_fqdn]
********************************************
ok: [server1.example.net] => {
"msg": "ansible_fqdn is ip-10-182-192-10.ec2.internal"
}
TASK: [common | set ansible_fqdn fact]
****************************************
ok: [server1.example.net] => {"ansible_facts": {}}
TASK: [common | show ansible_fqdn]
********************************************
ok: [server1.example.net] => {
"msg": "ansible_fqdn is ip-10-182-192-10.ec2.internal"
}
PLAY RECAP
********************************************************************
server1.example.net : ok=5 changed=0 unreachable=0 failed=0
Kind regards,
N.
On Thursday, November 20, 2014 7:55:48 PM UTC+2, Brian Coca wrote:
>
> task seems to be executed, what result were you expecting?
>
>
>
>
> --
> Brian Coca
>
--
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/e1c8b044-c8e7-46e0-95f9-5c75b36321c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.