From b670afa361a72d4f4846dc72fdf65897eced1fd3 Mon Sep 17 00:00:00 2001 From: Nathan Valentine Date: Mon, 27 Jun 2016 09:42:29 -0700 Subject: [PATCH] add a Cattle Catalog for Puppet (#198) --- .gitignore | 1 + templates/puppet-standalone/0/README.md | 54 ++ .../puppet-standalone/0/docker-compose.yml | 32 ++ .../puppet-standalone/0/rancher-compose.yml | 40 ++ .../puppet-standalone/catalogIcon-puppet.svg | 529 ++++++++++++++++++ templates/puppet-standalone/config.yml | 8 + 6 files changed, 664 insertions(+) create mode 100644 templates/puppet-standalone/0/README.md create mode 100644 templates/puppet-standalone/0/docker-compose.yml create mode 100644 templates/puppet-standalone/0/rancher-compose.yml create mode 100644 templates/puppet-standalone/catalogIcon-puppet.svg create mode 100644 templates/puppet-standalone/config.yml diff --git a/.gitignore b/.gitignore index a01ee28..596cff8 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .*.swp +*~ diff --git a/templates/puppet-standalone/0/README.md b/templates/puppet-standalone/0/README.md new file mode 100644 index 0000000..71e2de8 --- /dev/null +++ b/templates/puppet-standalone/0/README.md @@ -0,0 +1,54 @@ +# Puppet 4 .x (standalone) + +### Info + +A Rancher Cattle Catalog entry for deploying a Puppet 4.x Open Source-only master. The Catalog entry is suitable for development +and testing of Puppet codebases. + +### Usage + +Launch the Catalog entry. If no Puppet control repo is specified in the Rancher console no attempt will be made to sync +a Puppet control repo. Catalog compiles will be against a default Puppet code base in the 'production' environment. + +If a Puppet control repo is specified during launch of the Catalog entry r10k will run a full branch sync of the control +repo during Puppet container provisioning. A manual resync post-launch can be performed by restarting the Puppet container +however the full cycle of container restart, r10k sync, and load-balancer registration + availability is on the order of seconds +to minutes so this is of limited use for rapid iteration of Puppte codebases. This is a known issue (see TODO). + +The puppetserver process in the Puppet container is configured for autosigning of Puppet agent certificates('*'). + +### Notes + +The Puppet master configuration in this Catalog entry is, by design, minimal in functionality: + +* currently no management consoles +* currently not PuppetDB integrated +* lacking in any other community add-ons/bells-and-whistles + +See the TODO. + +### Development / Bug Reports / Feedback + +The Puppet 4.x (standalone) Catalog entry resides in a repo alongside other Rancher community Catalog entries at: + +* [https://github.com/rancher/community-catalog](https://github.com/rancher/community-catalog) + +however development happens via the following repo: + +* [https://github.com/nrvale0/rancher-cattle-puppet](https://github.com/nrvale0/rancher-cattle-puppet) + +For direct access to the author / maintainer it probably makes to file bug reports and file pull requests at the latter repo. + +### TODO + * add ability to configure r10k to authenticate to private control repos using an SSH key + * provide a method for manual resyncing of control repos using r10k which does not involve restarting the Puppet container + * provide user a way to specify periodicity of automatic r10k syncs of the control repo + * integrate one of the Open Source consoles for viewing Puppet Reports, Facts, and other misc node information + * allow the user to pass custom autosinging globs + +### Author + +Nathan Valentine - <[nathan@rancher.com](mailto:nathan@rancher.com) | [nrvale0@gmail.com](mailto:nrvale0@gmail.com)> +[https://www.rancher.com](https://www.rancher.com) +[https://nrvale0.github.io](https://nrvale0.github.io) +twitter: [@nrvale0](https://twitter.com/nrvale0) diff --git a/templates/puppet-standalone/0/docker-compose.yml b/templates/puppet-standalone/0/docker-compose.yml new file mode 100644 index 0000000..ae57838 --- /dev/null +++ b/templates/puppet-standalone/0/docker-compose.yml @@ -0,0 +1,32 @@ +puppet-lb: + ports: + - ${PUPPET_PORT}:8140/tcp + labels: + io.rancher.loadbalancer.target.puppet: 8140=${PUPPET_PORT} + tty: true + image: rancher/load-balancer-service + links: + - puppet:puppet + stdin_open: true + +puppet: + hostname: puppet + domainname: puppet.rancher.internal + labels: + io.rancher.sidekicks: puppet-config-volumes + image: nrvale0/puppetserver-standalone + environment: + - CONTROL_REPO_GIT_URI=${CONTROL_REPO_GIT_URI} + volumes_from: + - puppet-config-volumes + +puppet-config-volumes: + labels: + io.rancher.container.hostname_override: container_name + io.rancher.container.start_once: "true" + volumes: + - /etc/puppetlabs/ssl + - /opt/puppetlabs/r10k/cache + - /etc/puppetlabs/code + entrypoint: /bin/true + image: alpine diff --git a/templates/puppet-standalone/0/rancher-compose.yml b/templates/puppet-standalone/0/rancher-compose.yml new file mode 100644 index 0000000..bc74d1c --- /dev/null +++ b/templates/puppet-standalone/0/rancher-compose.yml @@ -0,0 +1,40 @@ +.catalog: + name: Puppet Server 4.x (standalone) + version: 1.0.0-rancher1 + description: > + A very basic Open Source-only Puppet 4.x master for development and testing. + questions: + + - variable: "CONTROL_REPO_GIT_URI" + type: "string" + description: "The git URI for the Puppet control repo." + label: "Puppet control repo URI" + required: false + + - variable: "PUPPET_PORT" + type: "int" + description: "TCP port for Puppet agent's to connect to Puppet master. Default(tcp/8140)" + label: "Puppet agent port" + required: false + default: 8140 + +puppet-lb: + scale: 1 + load_balancer_config: + haproxy_config: {} + health_check: + port: 42 + interval: 2000 + unhealthy_threshold: 3 + healthy_threshold: 2 + response_timeout: 2000 + +puppet: + scale: 1 + health_check: + port: 8140 + interval: 3000 + unhealthy_threshold: 2 + strategy: recreate + response_timeout: 2000 + healthy_threshold: 2 diff --git a/templates/puppet-standalone/catalogIcon-puppet.svg b/templates/puppet-standalone/catalogIcon-puppet.svg new file mode 100644 index 0000000..422889e --- /dev/null +++ b/templates/puppet-standalone/catalogIcon-puppet.svg @@ -0,0 +1,529 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/templates/puppet-standalone/config.yml b/templates/puppet-standalone/config.yml new file mode 100644 index 0000000..295609e --- /dev/null +++ b/templates/puppet-standalone/config.yml @@ -0,0 +1,8 @@ +name: Puppet Server 4.x (standalone) +description: > + A very basic Open Source-only Puppet 4.x master for development and testing. +version: 1.0.0-rancher1 +category: Configuration Management +maintainer: Nathan Valentine +license: Apache 2 +projectURL: https://github.com/rancher/community-catalog/templates/puppet-standalone