Forge Home

ec2hostname

A module to register EC2 nodes in an internal Route53 zone

10,967 downloads

9,968 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.2.2 (latest)
  • 0.2.1
  • 0.2.0
  • 0.1.1
  • 0.1.0
released Jan 28th 2015
This version is compatible with:
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'evenup-ec2hostname', '0.2.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add evenup-ec2hostname
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install evenup-ec2hostname --version 0.2.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: dns, ec2

Documentation

evenup/ec2hostname — version 0.2.2 Jan 28th 2015

#ec2hostname

####Table of Contents

  1. Overview
  2. Module Description
  3. Setup
  4. Usage - Configuration options and additional functionality
  5. Limitations
  6. Development
  7. Release Notes
  8. License
  9. Acknowledgements

##Overview

Adds hostname registration for AWS VPC nodes to a private Route53 zone.

##Module Description

This module installs an init script that handles start, restart, stop, and status. Starting (or restarting) the init script will ensure the node exists in the private zone specified. Stopping the module will remove it from the zone.

##Setup

###What ec2hostname affects

  • Adds an init script for name registration

###Setup Requirements

  • aws-sdk ruby gem (can be installed by the module with the install_gem parameter)
  • stdlib puppet module
  • nodes using this module must be in an EC2 VPC
  • IAM policy allowing Route53 updates (see Usage) ###Beginning with ec2hostname

To install the module: puppet module install evenup-java

Required parameters are: aws_key, aws_secret, and zone. See Usage for descriptions.

##Usage

###Parameters #####aws_key The AWS key used to make Route53 updates

#####aws_secret The AWS secret for aws_key

#####zone The Hosted Zone ID for the private zone to update

#####install_gem' Whether or not the aws-sdk ruby gem should be installed. Valid values are true and false. The default value is false

#####hostname The hostname that should be used for this node. The default value is 'hostname' from facter.

#####domain The domain name that should be appended to the hostname. The default value is 'domain' from facter.

#####ttl The TTL (in seconds) that should be associated with this record. Valid values are integers. The default value is 60.

#####type The type of record that should be added for this node. Valid values are A and CNAME. The default value is CNAME.

#####target The answer portion of the record entry. Typically this would be an IP address for an A record or an A record for a CNAME. If this is set to 'local-hostname' (the default), the AWS meta-data service will be queried for the local-hostname parameter. If this is set to 'local-ipv4, the AWS meta-data service will be queried for the local-ipv4 parameter.

#####service Whether or not the ec2hostname service should be running. Valid values are true or false. The default is true.

#####enable Whether or not the ec2hostname service should be enabled at boot. Valid values are true or false. The default is true.

###IAM Config It is HIGHLY recommeded to use an IAM user with limited to access for this service. The permissions needed for this user are:

  {
    "Version": "2012-10-17",
    "Statement": [
      {
        "Sid": "Stmt1415820843000",
        "Effect": "Allow",
        "Action": [
          "route53:ChangeResourceRecordSets",
          "route53:GetHostedZone",
          "route53:ListResourceRecordSets"
        ],
        "Resource": [
          "arn:aws:route53:::hostedzone/<your hosted zone id>"
        ]
      }
    ]
  }

##Limitations

CentOS/RHEL 6 tested

##Development

Pull requests are greatly appreciated!

  • Fork it
  • Create a topic branch
  • Improve/fix (with spec tests)
  • Push new topic branch
  • Submit a PR

Release Notes

See the CHANGELOG

License

Released under the Apache 2.0 license

Acknowledgements

The init script used here is based heavily on a gist by @kixorz.