Cloud computing makes it possible for an application to handle a large amount of computation and traffic through scaling. This can mean the creation of dozens or even hundreds of virtual machines. With cloud computing, any application can scale to meet a challenge without requiring the expense and time commitment to build out dozens of bare metal servers.

Unfortunately, virtual servers are still servers. They require deployment, configuration, maintenance, and updates. As with physical servers, things can still go wrong. That's why tools like Ansible and Puppet are so important. They automate the onerous task of manually configuring and managing your virtual servers.

Runner is CenturyLink Cloud's Hybrid IT management tool for quickly and easily automating any infrastructure, from on-site data centers to any cloud environment. At its core, Runner is Software-as-a-Service (SaaS) built on top of Ansible. It provides a web control panel, a massively parallel cloud platform for running tasks, and a pre-built library of configured jobs in the Runner Library.

In this tutorial, we will learn how to use Runner to deploy temporary virtual machines to boost a web application. This technique is useful for handling increased web traffic during busy online retail events, such as Black Friday and Cyber Monday.

Tools Used

In addition to Runner, we will use CenturyLink Cloud Compute. This service provides high-performance cloud servers. These enterprise-grade virtual machines are easy to deploy and manage from the CenturyLink Cloud Portal, with Runner, or via a powerful API.

Since the Runner setup involves looking at several JSON records, you might also find jsfmt useful. If you install that tool, you can pipe any JSON code through jsfmt -j to make it easier to read.

Before We Start

If you don’t have a CenturyLink Cloud account yet, head over to our website and sign up for a free trial. You’ll need it to access CenturyLink Cloud Compute servers and Runner. Because automatically deploying and configuring virtual servers can be a complicated topic, you might want to check out our comprehensive collection of knowledge base articles on virtual servers.

Runner accesses Ansible playbooks and other configuration files stored in GitHub repositories. If you don't have a GitHub account, create one before continuing.

Setting Up Runner

To execute and schedule Runner jobs, you will first need to retrieve your bearer token. This token is used to authorize Runner requests. Follow the steps below.

  1. In your shell, run the following command. Replace "your.username" with your CenturyLink username and "your.password" with your CenturyLink password.
    curl -s -H "Content-Type: application/json" \
        -XPOST \
        --data '{"username":"your.username","password":"your.password"}'
  2. Your results should look something like the following example. Look for the bearerToken value. You will use that token for authentication later on, so keep track of it. You will also want to keep track of the accountAlias value. That alias is used in many Runner endpoints.
      "userName": "your.username",
      "accountAlias": "ALIAS",
      "locationAlias": "VA1",
      "roles": ["AppFogAdmin", "AppFogUser", "DNSManager", "NetworkAdmin", "SecurityAdmin", "ServerAdmin", "ServerOperator"],
      "bearerToken": "ey...GPw"

Setting Up Your GitHub Playbook Repository

Next, we will initialize a GitHub repository to store Runner playbooks.

  1. In your web browser, go to and fill out the form. Creating a GitHub repository

  2. Click Create Repository.

  3. Follow the instructions for "Quick setup — if you’ve done this kind of thing before" or "…or create a new repository on the command line" to get a local copy of your new repository.

Creating Your Runner Playbook

Now we are ready to create a Runner playbook to launch your servers. The example below will launch two virtual private servers, each of which will have 1 CPU and 2GB of RAM.

  1. In the directory holding the local copy of your GitHub repository, create a file called thanksgiving.yml with a text editor.

  2. Edit the file to look like the following example.

       - name: Thanksgiving Servers
         hosts: localhost
         gather_facts: False
         connection: local
           - name: Deploy servers
               name: tday
               template: ubuntu-14-64
               count: 2
               cpu: 1
               memory: 2
               group: Runner
               state: present
               add_public_ip: true
                 - 22
                 - 80
               ttl: 345600
             register: clc
           - name: debug
             debug: var=clc.server_ids
  3. From the command line, add the new file to your GitHub repository with the following commands:

    $ git add thanksgiving.yml
    $ git commit -m 'Adding playbook to deploy Thanksgiving servers'
    $ git push origin master

For more information on what the various settings in thanksgiving.yml do, check out the complete documentation for the Ansible CLC server module. There are a large number of options available.

Testing Your Runner Playbook

At this point in the tutorial, you have successfully set up Runner and have your account alias and bearer token. You have also created your first Runner playbook and successfully stored it in GitHub. Our next step is to create a job payload and submit it to Runner for execution.

  1. In a new working directory, create a file called payload.json with a text editor.

  2. Edit payload.json to look like the following example. Replace "" with the URL of your GitHub repository.

      "description": "Deploy Thanksgiving servers",
      "repository": {
        "branch": "master",
        "defaultPlaybook": "thanksgiving.yml",
        "url": ""
      "useDynamicInventory" : true
  3. In your shell, run the following command. Replace "your-bearer-token" with your bearer token and "ACCOUNT-ALIAS" with your account alias. This command sends the contents of payload.json to Runner to tell it when and where to run your playbook.
    curl -X POST \
        -H "Content-Type: application/json" \
        -H "Authorization: Bearer your-bearer-token" \
        -d @payload.json \
  4. In your web browser, go to the Runner control portal to see your job status.

  5. When your job is complete, you will see a message in the left-hand column.

The Runner control panel

Re-using Your Playbooks

Once you've successfully built and used a playbook and payload, you can re-use them from the control panel in Runner quickly and easily.

  1. In your web browser, go to the Runner Manual Job page at

  2. Find the job that you wish to re-run in the list.

  3. Click the "play" icon to the left of the job name.

Runner control porta

Next Steps

Runner offers many options for controlling and running jobs. Check out the extensive list of sample playbooks in the CenturyLink Cloud Ansible module repository and the Runner Knowledge Base for ideas.

In addition to controlling CenturyLink Cloud resources, Runner can also be used to manage cloud resources on any service supported by Ansible. Take a look at the list of Ansible cloud modules for other services you can manage.

For more tutorials and resources on Runner, check out these tutorials and Ansible Q&A.