Configset Structure

Here’s an example lono configset structure:

├── lib
│   ├── configset.yml
│   ├── meta.rb
│   └── variables.rb
└── httpd.gemspec
File Description Required?
configset.yml The configset code. The top-level key should be AWS::CloudFormation::Init. required
meta.rb Additional meta info about the configset. Supports depends_on, to specify other configsets as dependencies. optional
variables.rb Predefined variables shipped with the configset. Predefined variables can be overridden with Configset Variables. optional
httpd.gemspec A standard gemspec definition. Configure things like name and author. required

lono configset new

A quick way create a project configset is with the lono configset new command. It will generate a skeleton configset structure in app/configsets.

$ lono configset new httpd
=> Creating new configset called httpd.
      create  app/configsets/httpd
      create  app/configsets/httpd/httpd.gemspec
      create  app/configsets/httpd/.gitignore
      create  app/configsets/httpd/.rspec
      create  app/configsets/httpd/Gemfile
      create  app/configsets/httpd/README.md
      create  app/configsets/httpd/Rakefile
      create  app/configsets/httpd/lib/configset.yml
$

Configset Example

Here’s a simple configset example:

AWS::CloudFormation::Init:
  config:
    packages:
      yum:
        httpd: []
    files:
      "/var/www/html/index.html":
        content: "<h2>html test content</h2>"
    services:
      sysvinit:
       httpd:
        enabled: 'true'
        ensureRunning: 'true'

This configset will install, configure, and ensure that the httpd server is running, even if the server is rebooted.

meta.rb depends_on example

Configsets can depend on other configsets. The depends_on method allows you to reuse configsets by including them as separate dependencies, instead of copying and pasting the configset code. Example:

lib/meta.rb

depends_on "amazon-linux-extras"

Pro tip: Use the <- and -> arrow keys to move back and forward.

Edit this page

See a typo or an error? You can improve this page. This website is available on GitHub and contributions are encouraged and welcomed. We love pull requests from you!