From the course: Ansible for Windows Administration
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Solution: Deploying software and maintaining service consistency
From the course: Ansible for Windows Administration
Solution: Deploying software and maintaining service consistency
(upbeat music) - [Presenter] So now, let me show you my way of solving each task within this challenge. Keep in mind mine is not the only way, and there are multiple ways of achieving the same outcome. So, for our first task, we need to ensure OpenSSH service is running. Let's see how that can be done. I am now on my Ansible control node, and we can see we have the inventory file here, as well as the Ansible configuration file. Now, I will use vim to create a document called challenge.yaml, which will serve as my playbook. I'll start with the standard three dashes. The name of my first play will be challenge, and it'll apply to all hosts within my inventory. Now, I'll start my task section. Within my task section I will add my first task, which is called ensure ssh is running. Here, I will use the win_service module to ensure that sshd has a start mode of auto and the state is set to started. I will save and exit, and now I will use Ansible in order to run the playbook. And it worked…