Skip to content

Using Audrey with Conductor

danmacpherson edited this page Feb 5, 2013 · 8 revisions

Using Audrey with Conductor

Audrey is used for passing configuration to instances after they are launched. It consists of two parts -- a “Config Server” that is launched in the cloud, and the Audrey agent built into instances which will register with the Config Server upon boot. Aeolus is able to pass variables into launched instances as well. This guide will walk you through a simple install.

At present, this guide is focused on the mechanics of doing this, but less so on real-world use cases or practical examples. Hopefully we can improve on that.

Overview

There are a few main steps here:

  1. Launch a Config Server instance on one or more cloud providers.
  2. Register it with Conductor.
  3. Build instances with the Audrey agent in them.
  4. Create Deployables referencing parameters.

Then you may launch instances and have them configured.

Building and Launching a Config Server instance

To aid instances in pulling down configuration after they boot, Audrey provides Config Server, which exports an HTTP API for configuration, secured by OAuth.

The Config Server is provided in Fedora by the aeolus-configserver package, so fundamentally this step is as simple as building a cloud image with that package running, and then performing some basic one-time configuration.

For the purposes of this example, we will use Conductor to build and push the Config Server instance, though this is not strictly required. (It’s possible and valid to launch a Config Server instance via an existing AMI on EC2, for example. It’s also reasonable to use an existing Config Server instance, though in that case this whole section would become irrelevant.)

You should simply follow the normal instructions for Launching Instances, but use something like the following image template:

<code class="xml">
<template>
  <name>Fedora 16 Config Server</name>
  <os>
    <name>Fedora</name>
    <version>16</version>
    <arch>x86_64</arch>
    <install type='url'>
      <url>http://download.fedoraproject.org/pub/fedora/linux/releases/16/Fedora/x86_64/os/</url>
    </install>
    <rootpw>CHANGE_ME</rootpw>
  </os>
  <repositories>
    <repository name="aeolus">
      <url>http://repos.fedorapeople.org/repos/aeolus/conductor/testing/fedora-16/x86_64/</url>
    </repository>
  </repositories>
  <packages>
    <package name="aeolus-configserver"/>
  </packages>
  <description>A Fedora 16 Template for Config Server</description>
</template>
</code>

That will build a Fedora 16 image (you are free to use other platforms, of course) and include the aeolus-configserver agent.

Then, proceed with the Launching Instances this image, and go ahead an launch it.

Configuring Config Server

(This section uses an instance on Amazon EC2 as an example, but any supported provider may be used.)

Once you have launched Config Server, you should note its public IP and download the key from Conductor. (Be sure to chmod 400 the key so that ssh doesn’t gripe about permissions being too open.) Then, SSH into it, using something like:

# ssh [email protected]  -i ~/Downloads/configserver-matt_configserver-matt_1340311058_key_70283806405200.pem

Pay attention to the public hostname or IP; we will need it below.

Once you are logged in, run the command aeolus-configserver-setup. In most cases, you should be able to accept the defaults, but do be mindful of what you’re doing. ;)

Once it runs, you should see some output like this:

App URL: http://localhost:4567
Conductor Auth Key: 924071446242011972363484
Conductor Auth Secret: eymGnRmRBV0hgj2KMUCBdCWBjLJZFfktH9B2fYSS13pCKf7x
**** You need to add this config server information to a ****
**** provider account in conductor.****

This contains the OAuth consumer key and secret key that you will need to pass into Conductor, so hold onto the information.

You may test that Config Server is running properly by hitting:

https://YOUR_FQDN.example.com/version

Be sure not to include a trailing slash on /version as some version of Config Server have a bug that returns a 404 for /version/ .

Registering your Config Server with Conductor

Now that your Config Server is running, you should register it with Conductor.

Config Servers belong to Provider Accounts, so find the provider account your Config Server should be associated with, under Administer / Cloud Providers. Click on the Account Name to pull up the details page.

Under the Properties section at the top, you should see a “Config Server” line. Press “Add.”

Fill in the information as follows:

  • Endpoint should be https://YOUR_FQDN.example.com
  • Key should be the “Auth Key” value from above
  • Secret should be the Auth Secret from above

When you save, Conductor will validate that the Config Server is reachable, and that your credentials are valid.

Now you have a working Config Server running and registered with Aeolus. Good job!

Building Image with the Audrey agent in them

Now that you have Config Server up and running, it’s time to build some instances that will register with Config Server and obtain their post-boot config!

Fundamentally, this is really pretty easy -- you just want to include the aeolus-audrey-agent package in your image.

Here’s a simple Fedora 16 template you could use, at least as an example of including our FedoraPeople repo and the package:

<template>
  <name>f16-agent</name>
  <os>
    <name>Fedora</name>
    <version>16</version>
    <arch>x86_64</arch>
    <install type='url'>
      <url>http://download.fedoraproject.org/pub/fedora/linux/releases/16/Fedora/x86_64/os/</url>
    </install>
    <rootpw>CHANGE_ME</rootpw>
  </os>
  <repositories>
    <repository name='aeolusrepo'>
      <url>http://repos.fedorapeople.org/repos/aeolus/conductor/latest-release/fedora-16/x86_64/</url>
      <signed>False</signed>
    </repository>
  </repositories>
  <packages>
    <package name='aeolus-audrey-agent'/>
  </packages>
  <description>Fedora 16 image with Audrey agent</description>
</template>

You can, of course, apply your other usual customizations here.

Go on to build and push this image as normal.

Create a Deployable with Service Parameters

Once you have pushed the image, you should go on to launch it.

Here is a sample Deployable XML file with some parameters:

<deployable name="audreyclient" version="1.0">
  <description/>
  <assemblies>
    <assembly name="audreyclient" hwp="small-x86_64">
      <image id="0c8608b6-bc9b-11e1-b976-70f395039857"/>
      <services>
        <service name="service3">
          <executable url="https://www.aeolusproject.org/redmine/attachments/download/169/start_simple"/>
          <parameters>
            <parameter name="service_3_param_1">
              <value type="scalar"><![CDATA[value 1]]></value>
            </parameter>
            <parameter name="service_3_param_2">
              <value type="scalar"><![CDATA[value 2]]></value>
            </parameter>
          </parameters>
        </service>
      </services>
    </assembly>
  </assemblies>
</deployable>

Note that it begins like a normal Deployable file, and you should of course use your own HWP and Image IDs, at the minimum. Only the <services> section is new here. It includes an <executable> script, referenced as a remote URL that will be accessed and run. Then there are a series of <parameter> tags defining parameters passed to the executable (script). Each <parameter> has a value that can be customized at launch-time.

Once that is saved, you can go to launch your Deployable. You should now be prompted for the parameters you just defined.

See also

Clone this wiki locally