Hello, and a big warm welcome to this Pluralsight presentation.
My name is Andrew Mallet, and in this module, we're going to take a journey
through implementing Ansible for configuration management.
So, of course, we're going to understand a little bit more
about Ansible, and we're able to use this module as a good
overview of what Ansible can do now.
Now it's a project that's owned by Red Hat,
it doesn't use any server, and doesn't need any clients. On Linux, it can
connect over SSH to manage the nodes. Using Windows nodes,
we can use WinRM. It's totally Python based.
Now that does mean then it can be installed either from our distribution
repositories, or if we want the latest and greatest version,
we can download it directly from our Python repositories. We need to
create a configuration and inventory out of the box.
It will work with a localhost, but obviously, we want to be
managing more than just a single machine.
The idea is with these configuration management systems is that we can
manage a range of machines. When configuring our nodes,
we can use ad hoc commands, just commands that we run from the command line.
These are great to get things up and running very quickly, but because of
the ad hoc nature, they are not repeatable. Playbooks give us the ability
to repeat the configuration any time that we need. Now when we're looking
at Ansible, we only need to install Ansible on a single node, and that node
would be our Ansible controller. Now it could be a server, but it's not a
service. Equally, we could be installing Ansible on our desktop or laptop
machines.
It uses SSH, as we mentioned,
to connect to Linux and WinRM if we're managing Windows nodes. We need
Python installed on our Linux managed nodes, and we would need PowerShell
installed on our Windows nodes. For our repeatable configuration, we use
playbooks, and those playbooks are created in YAML. Now as we said, there is
no server service and no client.
So one of the big advantages of Ansible is we have no
long‑running service in either our client or our server.
In fact, we don't have a server. Remember, it's just the Ansible controller.
And this then makes it very easy to get Ansible up and running in literally
minutes. When we take a look at installing Ansible, we'll be installing it
on our Ubuntu systems so we can update the package cache. We can install
ansible. Along with installing Ansible, we're adding the package sshpass,
which will then act as a mechanism to cache SSH passwords. We won't be using
key‑based authentication, although that would be a good way of managing your
systems. We can check the version, and out of the box we can manage our
localhost. A simple test is just to make sure that we are getting a
response. This is a response from the Python interpreter,
not a response from ICMP.
We also have great documentation. So docs.ansible.com is good
when we're looking through a browser, but we also have extensive
documentation on the command line.
So ansible‑doc ‑l will list all of the modules that we have.
If I want to list help on a particular module, just add in the module name.
If I want help on other elements,
we can specify the type we're looking for. Here I've put in keyword,
and we can list then the keywords that are available.
Now having introduced this to you,
the best way to really introduce you to Ansible is to run through this ourselves.