From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Using delegation

Using delegation

In this video, we'll talk about delegation. Delegation is what you use to run tasks on another host. That is useful if you want to run tasks between two managed hosts. And in order to do so, you use delegateTo as a task property, and that will make sure that the task runs on a different managed host. This allows you to run an individual task somewhere else without any need to start a new play that addresses these hosts specifically. And also it allows you to define a specific order between hosts, like you want to copy over a file between two managed hosts, well delegate to is what you need to use. In order to do so, there is a couple of host requirements. And the host requirements basically are the same requirements as regular console hosts. So that means that you need to make sure that Python is installed, SSH access to the managed host is enabled, and SSH keys are copied over as well for passwordless logging. And also make sure that hostname to IP address resolving works. The…

Contents