Information role

The final role we are creating is called info, and its only purpose is to output information on our newly launched and configured Windows Server 2016 EC2 instance. As you may have already guessed, we need to run the following command:

$ ansible-galaxy init roles/info

Once we have the files, add the following task to roles/info/tasks/main.yml:

- name: print out information on the host  debug:    msg: "You can connect to '{{ inventory_hostname }}' using the username of '{{ ansible.username }}' with a password of '{{ ansible.password }}'."

As you can see, this will provide us with the host to connect to, along with the username and password.

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.