A Quick Look at Ansible

I was recently working on a project that used a software system called Ansible. Ansible is a system that can be used to manage computer resources (machines, network, code) during application development.

When I was a student learning computer science, I was fascinated by algorithms, data structures, and programming languages. When I started working at software companies, I quickly learned that managing a large project that’s being developed by a team of developers, is complicated. In general, a large set of support systems are needed to manage things like setting up machines (provisioning), and maintaining and adjusting existing machines (configuration management).


Left: The Ansible home page — mostly Marketing fluff. Right: Ansible documentation — quite good.


There are many systems that manage the management of a software development environment, including Puppet, Chef, and Ansible.

Here are some key ideas about the Ansible system:

* The Ansible core system runs on a Linux machine, but Ansible can manage Linux and Windows machines and networks.

* Ansible core is written in Python.

* Ansible has modules which are Python code. The Ansible core system pushes a module onto a host machine where it is executed locally.

You can write Ansible modules from scratch or use one of the thousands of modules that are built into Ansible or have been written by the Ansible community. Examples of modules include:

aws_acm_info – Retrieve certificate info from Azure Web Services.
azure_rm_aks_info – Get Azure Kubernetes Service facts.
docker_config – Manage docker configs.
mongodb_replicaset – Initializes a MongoDB replica set.
git_config – Read and write git configuration.
copy – Copy or create a file.

Modules can be executed individually, but two or more modules are often put together into script called a playbook which is then executed. Ansible playbooks are written using YAML syntax. An example of a playbook that calls the copy module to create a file is:

---
- name: Hello World Ansible playbook example
  hosts: some_machine_005
  tasks:
    - name: Create a file 'hello.txt' with content 'howdy'
    copy:
      content: 'howdy'
      dest: C:/tmp/hello.txt

Learning how to use Ansible, or any similar management system, is not trivial — it can take several weeks to get moderately proficient. But not using a management system isn’t really feasible in many scenarios.

I have a real passion for all things related to computer science. I’m mostly fascinated by algorithms and machine learning systems, but project management software has a certain kind of interest too.


Three more or less random images from the Internet that convey a sense of passion (to me anyway). Left: Two people in love, by artist Lorraine Christie. Center: A photograph that has a sense of joy. Right: A painting from a late 1940s magazine by artist Haddon Sundblom (1899-1976).

This entry was posted in Miscellaneous. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s