Hi,
I am doing a very straight forward testing of adding a new host dynamically.
---
- hosts: all
connection: local
gather_facts: no
tasks:
- name: add host
add_host:
name: 'testserver'
groups: all
- name: refresh
meta: refresh_inventory
- name: print
debug:
msg: "hello"
~
When i run this playbook
ansible-playbook hello.yml -i hosts
it doesnot run task for added host
ansible-playbook -i hosts hello.yml
PLAY [all]
************************************************************************************************************************
TASK [add host]
*******************************************************************************************************************
changed: [localhost]
TASK [print]
**********************************************************************************************************************
ok: [localhost] => {
"msg": "hello"
}
PLAY RECAP
************************************************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0
skipped=0 rescued=0 ignored=0
I dont see task for testserver.
Any idea what am i missing ?
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CAFXWBQK%2B-07crmp70GL7ssfRpir_p29kp4kacXj8PDYHPc1XsQ%40mail.gmail.com.