Running an Ansible playbook

ThinkAgile CP modules can be added into Ansible playbooks. You can then run the playbooks to perform the functions provided by the Lenovo modules.

The ThinkAgile CP user role determines which Lenovo modules can be run:

Module Infrastructure admin Infrastructure viewer VDC manager VCD viewer






  1. Access is limited to the resources accessible to the VDC user account.

For more information about ThinkAgile CP roles, see the following topic:

User roles

Complete the following steps to run an Ansible playbook.

  1. Install Ansible on a Ubuntu or Red Hat Enterprise Linux (RHEL) server.

    For details on how to install Ansible, see the following information:

    Ansible documentation

  2. Install all the required libraries to ensure the installation is successful.
  3. Check that you can access the Ansible playbook from any directory of the machine on which Ansible is installed. You can run the following command:

    $ ansible-playbook

    If Ansible returns the following message, then Ansible is not correctly installed.

    Command not found
  4. Download and install the Lenovo Ansible modules into your existing Ansible environment. Follow the instructions listed on the ThinkAgile CP GIT repository.

    Note: In addition to Ansible and the Lenovo modules, the following software must be installed:
  5. Execute the playbook by using the following command:

    $ ansible-playbook <myPlaybook.yml> -v

    -v is an optional verbose command that helps identify what is happening while the playbook is running.