Forge Home

g_server

pdk
Bits and pieces to configure base of your servers in opinionated way with power of Puppet

6,847 downloads

3,874 latest version

5.0 quality score

Version information

  • 2.4.0 (latest)
  • 2.3.1
  • 2.3.0
  • 2.2.1
  • 2.2.0
  • 2.1.0
  • 2.0.0
released Sep 16th 2019
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • CentOS
    ,
    RedHat
    ,
    Debian
    ,
    Ubuntu

Start using this module

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

Add this module to your Puppetfile:

mod 'glorpen-g_server', '2.4.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add glorpen-g_server
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install glorpen-g_server --version 2.4.0

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

Documentation

glorpen/g_server — version 2.4.0 Sep 16th 2019

g-server

Bits and pieces to configure base of your servers in opinionated way with power of Puppet.

When submodule codebase size exceeds common sense it will be moved to its own puppet module.

Features

Interface Sides

You can specify which interfaces are external and which internal.

Other modules/classes can use this information to eg. listen on only some interfaces or create firewall rules.

Configurable as g_server parameters.

Usage:

g_server::get_interfaces($side).each | $iface | { }
g_server::get_side($iface) # => one of G_server::Side

Classes

Accounts

  • Handles root account password and its ssh keys
  • Marks admin users to allow sudo usage
  • Creates user accounts and sets ssh keys

Hiera usage

g_server::accounts::root_password_hash: "$6$9OBVSpVQDgHsldz8$BmiwDh3XGC4qgDL/Qdh5DQPhJ4haNqBvB1KV0BqZwA4w8ZEr3ljcE9YmcVvtkxXqb4uMtl4V3Gk7n0vI2T2NH0"

g_server::accounts::users:
  glorpen:
    ssh_authorized_keys:
      "example.glorpen": "<ssh pub key>"
    admin: true

Cron

Simple cron job wrapper.

  • Setting environment variables
  • Uses ::cron::job
  • Allows using templates with custom variables

Hiera usage

g_server::cron::jobs:
  "example-job":
    minute: "0"
    hour: "10" # "*/5", "1-5", ...
    template_source: "example/job-example.sh.epp"
    #template_content: "puppet://..."
    vars:
      var1: "example"

Firewall

Setups base rules for firewall.

See glorpen/g_firewall for more.

Network

  • Supports differnating between external and internal facing interfaces
  • Sets internal host names
  • Supports creating macvlan interfaces
  • Sets hostname
  • Allows setting routes, dns, dhcp, gateway, mac per interface
  • Supports IPv6

Hiera usage

g_server::network::interfaces:
  eth0:
    ipv4addr: "192.168.1.12"
    ipv4netmask: "255.255.255.0"
    ipv4gw: "192.168.1.1"
    nameservers:
      - "8.8.8.8"

Repos

Configures package manager and installs Puppet repository.

Base Services

Setups base services.

SSH

  • sets up to date ciphers
  • creates ssh users group
  • sets host keys
  • configures firewall (supports _[Interface Sides]{.title-ref})

Fail2Ban

Basic fail2ban configuration.

Volumes

Manages LVM volumes, mountpoints and filesystems.

Supports managing:

  • volume groups
  • logical volumes
  • thin pools
  • thin provisioned volumes
  • filesystems with options
  • mountpoints (with chmod/chown)
  • lvm raids

Hiera usage

g_server::volumes::groups:
  "example0":
    devices:
      - /dev/sda2
    volumes:
      root:
        mountpoint: /
        size: 10G
        mount_options: errors=remount-ro,noatime,nodiratime
        pass: 1
      other:
        mountpoint: /example
        size: 1G