Coder Social home page Coder Social logo

mysociety / puppet-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 73 KB

Puppet module to complete initial instance bootstrap

Home Page: https://www.mysociety.org/

Ruby 54.78% Shell 6.34% Puppet 33.43% HTML 0.31% Perl 5.14%
puppet provisioning

puppet-bootstrap's Introduction

mySociety Server Bootstrap

Run PDK tests

This Puppet module is used to bootstrap a server ready for integration into mySociety's infrastructure. It is not intended for use beyond mySociety but may contain examples, patterns, etc that are of interest.

Usage

The primary point of interaction is the main bootstrap class. The only other public class currently provided is bootstrap::ec2.

As this module configures sensitive things, it does not contain all the necessary data to be used directly. Specifically:

  • SSH keys for the maint user (via maint_public_ssh_key and maint_private_ssh_key)
  • Server SSH keys to globally trust (via ssh_keys)
  • SSH keys to add to the root user's authorized_keys file (via root_auth_keys)

This data can be provided directly from Hiera or via a profile class.

EC2

The ec2 class

The bootstrap::ec2 class sets up a simple systemd service that registers the instance in our dynamic ec2.mysociety.org zone. To do this, it needs the details of the TSIG key for authenticating the update, provided to the ddns_key parameter:

class { '::bootstrap::ec2':
  ddns_key => {
    'algorithm' => 'hmac-sha512',
    'secret'    => '5up3r53c43t',
  },
}

This should be applied before attempting to apply the core module to any new EC2 instance.

Provisioning an EC2 instance

This module also includes an example plan, bootstrap::ec2, for use with Puppet Bolt. This is intended to be applied to EC2 instances based on the official Debian FAI AMIs and get them ready for full integration with our platform.

The plan will return the public SSH key generated for the root user, the public IP and fully-qualified domain name of the instance.

You could run this from a control repository containing the required secrets with a command something like this:

bolt plan run bootstrap::ec2 \
  --user admin \
  --run-as root \
  --private-key ~/.ssh/my-aws-key.pem \
  --nodes 52.1.2.3

puppet-bootstrap's People

Contributors

sagepe avatar

Watchers

 avatar  avatar  avatar

Forkers

phil-friderici

puppet-bootstrap's Issues

Initialise contents of server state repository

We should ensure that the core contents of /var/lib/server-state are initialised at this stage - so lists of initial packages and the state of the user and group database files at least. This module could seed the cron jobs (moved from the internal repo) and execs fire if the state files themselves don't exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.