This is a blog with random OpenStack and Linux related notes so I don't forget things. If you find something inaccurate or that could be fixed, please file a bug report here.

View on GitHub

Running an ansible playbook on TripleO nodes is fairly simple thanks to the work done by the folks working on tripleo-validations. There’s no need to manually maintain an inventory file with all the nodes as there is already a dynamic inventory script set up for us.

So, using an ansible playbook would look as the following:

$ source ~/stackrc
$ ansible-playbook -i /usr/bin/tripleo-ansible-inventory path/to/playbook.yaml

This will use localhost for the undercloud node and fetch the nodes from nova to get the overcloud nodes. There are also roles already available such as controllers and computes, which can be accessed in your playbooks with the keys “controller” and “compute” respectively. And support is coming for dynamic roles as well.

So, for a simple example, lets say we want to install the Libreswan package in all the overcloud nodes. It would be done with a playbook that looks as the following:

- hosts: overcloud
  become: true
  - name: Install libreswan
      name: libreswan
      state: latest