March 2019
Intermediate to advanced
412 pages
9h 49m
English
Booting a server isn't all that useful by itself. The server exists to be used, and will likely need some configuration to become useful. While it's possible to have one playbook to create resources and a completely different playbook to manage configuration, we can also do it all from the same playbook. Ansible provides a facility to add hosts to the inventory as a part of a play, which will allow for the use of those hosts in subsequent plays.
Working from the previous example, we have enough information to add the new host to the runtime inventory, by way of the add_host module:
- name: add new server add_host: name: "mastery1" ansible_ssh_host: "{{ newserver.openstack.accessIPv4 }}" ansible_ssh_user: "fedora" ...Read now
Unlock full access