Running the Playbook
The site.yml
is missing some of the settings at the top because we are targeting a Windows host:
--- - name: "Install IIS, .NET, create user, install chocolatey and display info" hosts: "ansible_hosts" gather_facts: true vars_files: - "group_vars/common.yml" roles: - "iis" - "dotnet" - "user" - "choco" - "info"
As you can see, there is no need for the become
or become_method
keys to be set, as we do not need to change users once connected to the host.
Outside of that, the rest of the file is as expected, as is the way we run the playbook:
$ ansible-playbook -i hosts site.yml
It will take a little while to run as a lot is going on in the background, as you will see from the output when...