% ansible --version
ansible [core 2.15.4]
% cat foo.yml
---
- name: play 1
hosts: all
become: no
gather_facts: no
tasks:
- set_fact:
my_fact: "this is a fact"
- name: play 2
hosts: all
become: no
gather_facts: no
tasks:
- debug: var=my_fact
% ansible-playbook -i localhost, foo.yml
PLAY [play 1] **********************************************************************************************************
TASK [set_fact] ********************************************************************************************************
ok: [localhost]
PLAY [play 2] **********************************************************************************************************
TASK [debug] ***********************************************************************************************************
ok: [localhost] => {
"my_fact": "this is a fact"
}
PLAY RECAP *************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e414a185-f743-4618-ab14-b4449dfecf6dn%40googlegroups.com.
On Sep 21, 2023, at 8:02 AM, Veera <svee...@gmail.com> wrote:
msg: "{{ hostvars['server1']['reg_name'] }}"You should look at and contrast the values of ansible_hostname, inventory_hostname, and ansible_fqdn.
--
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-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/e414a185-f743-4618-ab14-b4449dfecf6dn%40googlegroups.com.
-- Todd
--
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-proje...@googlegroups.com.