Skip to content

Instantly share code, notes, and snippets.

@ilyash
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyash/61308577188f7cf3c406 to your computer and use it in GitHub Desktop.
Save ilyash/61308577188f7cf3c406 to your computer and use it in GitHub Desktop.
# WARNING:
# /etc/sudoers must not have "Default requiretty" for Puppet plugin to work
imports:
- http://www.getcloudify.org/spec/cloudify/3.1/types.yaml
plugins:
puppet_plugin:
derived_from: cloudify.plugins.agent_plugin
properties:
url: https://github.com/Fewbytes/cloudify-puppet-plugin/archive/CFY-871-puppet-node-name.zip
node_types:
cloudify.types.puppet.middleware_server:
derived_from: cloudify.types.middleware_server
properties:
# All Puppet related configuration goes inside
# the "puppet_config" property.
puppet_config: {}
# server (required)
# ------
#
# Host name of the Puppet server
#
#
# environment: (required)
# -----------
#
# Environment name
# See: http://docs.puppetlabs.com/guides/environment.html
#
#
# version: (optional. default: latest)
# -------
#
# `version` is the Puppet version to install
#
#
# node_name_prefix: (optional. default: empty string)
# ----------------
#
#
# node_name_suffix: (optional. default: empty string)
# ----------------
#
# Puppet node name is constructed as follows:
# `node_name_prefix` + node_id + `node_name_suffix`
#
#
# facts: (optional)
# -----
#
# Map with facts to add to facter. Must not contain
# `cloudify` nor `cloudify_*` keys as these are
# generated automatically.
#
#
# repos: (optional)
# -----
# deb:
# VER_NAME: url://for-package-that-installs-repo.deb
#
# Custom packages that are used for adding Puppet repository.
#
#
# modules: (optional)
# -------
# List of Puppet modules to install before executing any
# Puppet DSL (passed using "manifest" or "execute")
#
# Example:
# ===8<===
# modules:
# - puppetlabs-apache
# - puppetlabs-concat
# - puppetlabs-stdlib
# - puppetlabs-vcsrepo
# ===8<===
#
#
# download: (optional)
# --------
#
# Link to a .tar.gz to download for using as manifests.
# It is downloaded before any Puppet code runs.
# The file should typically contain "manifests" and
# "modules" directories. Can be used in conjunction with
# "execute" or "manifest" properties.
#
# The value of the "download" property can be either
# URL or a path to a .tar.gz file inside the blueprint.
#
# Example A: (url)
# ===8<===
# download: http://puppet-statics.example.com/manifests.tar.gz
# ===8<===
#
# Example B: (resource in blueprint)
# ===8<===
# download: /puppet-resources/manifests.tar.gz
# ===8<===
#
#
# execute: (either "execute" or "manifest" must be present)
# -------
# hash of per operation Puppet DSL to run.
#
# Example:
# ===8<===
# execute:
# configure: |
# package{'git':}
# ->
# vcsrepo{$cloudify_local_repo:
# ensure => present,
# provider => git,
# source => 'https://github.com/Fewbytes/cosmo-tester-puppet-downloadable.git',
# }
# start: |
# class{'cloudify_hello_world':
# }
# ===8<===
#
#
# manifest: (either "execute" or "manifest" must be present)
# --------
# hash of per operation Puppet manifest to run.
#
# Example:
# ===8<===
# manifest:
# start: manifests/site.pp
# ===8<===
#
# tags: (optional)
# ----
# List of tags to use while running Puppet (standalone or agent)
# Used for all operations.
#
# operations_tags: (optional)
# ---------------
# hash of lists of per operation tags to use
# while running Puppet (standalone or agent)
#
# Example:
# ===8<===
# operations_tags:
# start: ['my_start']
# ===8<===
#
# add_operation_tag: (boolean, optional, default false)
# -----------------
#
# In addition to any other tags, passes cloudify_operation_X
# tag, where X is the operation name (such as "configure" or
# "start" for example).
#
interfaces:
# All operations mapped to same entry point in Puppet plugin
# The "operation" function decides what to run according
# to the operation being performed. The operation is taken
# from the passed context (CloudifyContext.operation)
cloudify.interfaces.lifecycle:
- create: puppet_plugin.operations.operation
- configure: puppet_plugin.operations.operation
- start: puppet_plugin.operations.operation
- stop: puppet_plugin.operations.operation
- delete: puppet_plugin.operations.operation
cloudify.types.puppet.app_server:
derived_from: cloudify.types.app_server
properties:
puppet_config: {}
interfaces:
cloudify.interfaces.lifecycle:
- create: puppet_plugin.operations.operation
- configure: puppet_plugin.operations.operation
- start: puppet_plugin.operations.operation
- stop: puppet_plugin.operations.operation
- delete: puppet_plugin.operations.operation
cloudify.types.puppet.db_server:
derived_from: cloudify.types.db_server
properties:
puppet_config: {}
interfaces:
cloudify.interfaces.lifecycle:
- create: puppet_plugin.operations.operation
- configure: puppet_plugin.operations.operation
- start: puppet_plugin.operations.operation
- stop: puppet_plugin.operations.operation
- delete: puppet_plugin.operations.operation
cloudify.types.puppet.web_server:
derived_from: cloudify.types.web_server
properties:
puppet_config: {}
interfaces:
cloudify.interfaces.lifecycle:
- create: puppet_plugin.operations.operation
- configure: puppet_plugin.operations.operation
- start: puppet_plugin.operations.operation
- stop: puppet_plugin.operations.operation
- delete: puppet_plugin.operations.operation
cloudify.types.puppet.app_module:
derived_from: cloudify.types.app_module
properties:
puppet_config: {}
interfaces:
cloudify.interfaces.lifecycle:
- create: puppet_plugin.operations.operation
- configure: puppet_plugin.operations.operation
- start: puppet_plugin.operations.operation
- stop: puppet_plugin.operations.operation
- delete: puppet_plugin.operations.operation
relationships:
cloudify.puppet.depends_on:
derived_from: cloudify.relationships.depends_on
source_interfaces:
# The comment under types.interfaces applies here too
cloudify.interfaces.relationship_lifecycle:
- preconfigure: puppet_plugin.operations.operation
- postconfigure: puppet_plugin.operations.operation
- establish: puppet_plugin.operations.operation
- unlink: puppet_plugin.operations.operation
cloudify.puppet.connected_to:
derived_from: cloudify.relationships.connected_to
source_interfaces:
# The comment under types.interfaces applies here too
cloudify.interfaces.relationship_lifecycle:
- preconfigure: puppet_plugin.operations.operation
- postconfigure: puppet_plugin.operations.operation
- establish: puppet_plugin.operations.operation
- unlink: puppet_plugin.operations.operation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment