From 1801f262c9c64ec10a96b561b4849ef84fc129db Mon Sep 17 00:00:00 2001 From: Alexey Khivin Date: Wed, 29 Jun 2016 02:45:36 +0300 Subject: [PATCH] [Puppet] Puppet-master demo Change-Id: I0becebfb46fd046f4d93ec14f1daf1aa26065023 --- murano-apps/PuppetMaster/README.rst | 50 +++++++ .../Classes/PuppetMasterApplication.yaml | 131 ++++++++++++++++++ murano-apps/PuppetMaster/package/UI/ui.yaml | 83 +++++++++++ murano-apps/PuppetMaster/package/logo.png | Bin 0 -> 4617 bytes .../PuppetMaster/package/manifest.yaml | 17 +++ 5 files changed, 281 insertions(+) create mode 100644 murano-apps/PuppetMaster/README.rst create mode 100644 murano-apps/PuppetMaster/package/Classes/PuppetMasterApplication.yaml create mode 100644 murano-apps/PuppetMaster/package/UI/ui.yaml create mode 100644 murano-apps/PuppetMaster/package/logo.png create mode 100644 murano-apps/PuppetMaster/package/manifest.yaml diff --git a/murano-apps/PuppetMaster/README.rst b/murano-apps/PuppetMaster/README.rst new file mode 100644 index 0000000..4ca3edf --- /dev/null +++ b/murano-apps/PuppetMaster/README.rst @@ -0,0 +1,50 @@ +Puppet Master Support for Murano +================================ + +Puppet is an open-source configuration management tool. It runs on many +Unix-like systems as well as on Microsoft Windows, and includes its own +declarative language to describe system configuration. + + +This application is a demonstration of Puppet Library capabilities. + + +Application creates a set of nodes and connects them to a puppet master. +Every name in the list of the nodes names is the cert name in the puppet +master. Dependencies can be installed by pointing Puppetfile which +will be used to install modules by librarian-puppet. All nodes +are included in the "production" environment and that is the only +environment. Cron runs puppet-agent twice in an hour. + +Tested under Ubuntu 14.04 Murano image. + + +Usage example +^^^^^^^^^^^^^ +As an example of input data you can use: + +Nodes list:: + + server + slave1 + slave2 + +Puppetfile link:: + + http://paste.openstack.org/raw/529624/ + +Main manifest:: + + modules/puppettest/manifests/ + + +The resulting environment contains GoCD server with a slaves connected. +GoCD server will run on "server" node on port :8153 + +Known issues +^^^^^^^^^^^^ + +Cron runs puppet-agent twice in an hour and agents do not run during deployment. +You can wait while cron will run puppet agents or run them manually by executing:: + + /usr/bin/puppet agent --config /etc/puppet/puppet.conf --onetime --no-daemonize --verbose --no-splay diff --git a/murano-apps/PuppetMaster/package/Classes/PuppetMasterApplication.yaml b/murano-apps/PuppetMaster/package/Classes/PuppetMasterApplication.yaml new file mode 100644 index 0000000..2cfe7af --- /dev/null +++ b/murano-apps/PuppetMaster/package/Classes/PuppetMasterApplication.yaml @@ -0,0 +1,131 @@ +Namespaces: + =: org.openstack.ci_cd_pipeline_murano_app.puppet + std: io.murano + res: io.murano.resources + sys: io.murano.system + ci_cd_pipeline_murano_app: org.openstack.ci_cd_pipeline_murano_app + puppet: org.openstack.ci_cd_pipeline_murano_app.puppet + net: org.openstack.ci_cd_pipeline_murano_app.utils.net + +Name: PuppetMasterApplication + +Extends: std:Application + +Properties: + server: + Contract: $.class(puppet:PuppetInstance) + Usage: InOut + clients: + Contract: + - $.class(puppet:PuppetClient) + Usage: InOut + + name: + Contract: $.string().notNull() + Default: 'PuppetMaster' + + puppetfileLink: + Contract: $.string().notNull() + + nodesStr: + Contract: $.string().notNull() + + manifest: + Contract: $.string().notNull() + + flavor: + Contract: $.string().notNull() + + osImage: + Contract: $.string().notNull() + + keyPair: + Contract: $.string().notNull() + + availabilityZone: + Contract: $.string().notNull() + + assignFloatingToMaster: + Contract: $.bool().notNull() + + assignFloatingToSlaves: + Contract: $.bool().notNull() + + +Methods: + initialize: + Body: + - $._environment: $.find(std:Environment).require() + + deploy: + Body: + - $._environment.reporter.report($this, 'Using Puppetfile to install={0}'.format($this.puppetfileLink)) + - $nodes: $this.nodesStr.split() + - $._environment.reporter.report($this, 'Nodes list={0}'.format($nodes)) + + - $rules: + - FromPort: 1 + ToPort: 65535 + IpProtocol: tcp + External: false + - FromPort: 1 + ToPort: 65535 + IpProtocol: tcp + External: true + # puppet master port + - FromPort: 8140 + ToPort: 8140 + IpProtocol: tcp + External: false + + - $this._environment.securityGroupManager.addGroupIngress(rules => $rules) + + - Parallel: + - If: $.server = null + Then: + - $this.server: new(puppet:PuppetInstance, $this._environment, + name => 'master', + flavor => $this.flavor, + image => $this.osImage, + keyname => $this.keyPair, + availabilityZone => $this.availabilityZone, + assignFloatingIp => $this.assignFloatingToMaster) + - $this.server.deploy() + + - If: len($this.clients) = 0 + Then: + - $this.clients: $nodes.select( + new( puppet:PuppetClient, $this._environment, + instance => new( puppet:PuppetInstance, $this._environment, + name => concat('puppet_', $), + flavor => $this.flavor, + image => $this.osImage, + keyname => $this.keyPair, + availabilityZone => $this.availabilityZone, + assignFloatingIp => $this.assignFloatingToSlaves), + role => $)) + + - $this.clients.pselect($.instance.deploy()) + + - $master: new( puppet:PuppetServer, + masterInstance => $this.server, + environment => $this._environment, + manifest => $this.manifest) + + # add every node with the role assigned to it + - $this.clients.select( + $master.addClient($)) + + - $master.configure() + - $master.installDependencies( + environment => 'production', + puppetfileLink => $this.puppetfileLink) + + + - $this._environment.reporter.report( + $this, + 'Puppet master can be accessed on {0}'.format($.server.floatingIpAddress)) + - $this.clients.select($this._environment.reporter.report($this, + '{0} can be accessed on {1}'.format( + $.role, + $.instance.floatingIpAddress))) \ No newline at end of file diff --git a/murano-apps/PuppetMaster/package/UI/ui.yaml b/murano-apps/PuppetMaster/package/UI/ui.yaml new file mode 100644 index 0000000..7ff22b5 --- /dev/null +++ b/murano-apps/PuppetMaster/package/UI/ui.yaml @@ -0,0 +1,83 @@ +Version: 2 + +Application: + ?: + type: org.openstack.ci_cd_pipeline_murano_app.puppet.PuppetMasterApplication + nodesStr: $.manifest.nodes + puppetfileLink: $.manifest.puppetfileLink + manifest: $.manifest.manifest + + flavor: $.instanceConfiguration.flavor + osImage: $.instanceConfiguration.osImage + keyPair: $.instanceConfiguration.keyPair + availabilityZone: $.instanceConfiguration.availabilityZone + assignFloatingToMaster: $.instanceConfiguration.assignFloatingToMaster + assignFloatingToSlaves: $.instanceConfiguration.assignFloatingToSlaves + +Forms: + - manifest: + fields: + - name: nodes + type: text + label: Nodes list + description: >- + List of the nodes name. Every line means separate node connected to puppet + master with the same certificate name + + - name: puppetfileLink + type: string + label: Puppetfile link + description: >- + Direct link to a Puppetfile + + - name: manifest + type: string + label: Main manifest + description: >- + The file or directory which contains main manifest for your environment + - instanceConfiguration: + fields: + - name: title + type: string + required: false + hidden: true + description: Specify some instance parameters on which the application would be created + - name: flavor + type: flavor + label: Instance flavor + description: >- + Select registered in Openstack flavor. Consider that application performance + depends on this parameter. + initial: m1.medium + required: false + - name: osImage + type: image + imageType: linux + label: Instance image + description: >- + Select a valid image for the application. Image should already be prepared and + registered in glance. + - name: keyPair + type: keypair + label: Key Pair + description: >- + Select a Key Pair to control access to instances. You can login to + instances using this KeyPair after the deployment of application. + required: false + - name: availabilityZone + type: azone + label: Availability zone + description: Select availability zone where the application would be installed. + required: false + - name: assignFloatingToMaster + type: boolean + label: Assign floating to master node + description: Assign floating to Puppet master node + initial: true + required: false + - name: assignFloatingToSlaves + type: boolean + label: Assign floating to slaves nodes + description: Assign floating to an every slave node + initial: true + required: false diff --git a/murano-apps/PuppetMaster/package/logo.png b/murano-apps/PuppetMaster/package/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..913d3c1733102b56d89a5a1f7ffa93a5c64443c9 GIT binary patch literal 4617 zcmV+k687zhP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUyz)(z7MGFfG5D*U;85kfSA0;IuHa0adFfU3RU6RYR)kW>c*<@<5R>@JWrEk5oT6w(A;+2Og{^d4FZ9N z@B3p$8{YnWOCuAQSuvFW%%9vme+D4C6&k&tVDOV)L_U`*F~CAlSm680O;-UmDF+Dn z6O0p15MEH0_%X*Zk<(p4k_0t5F_7h)jGp}X6bZ)xR2)Lw%c?9zgsTJ~8#?{$2OlK; zn5J+*>7v7a;f>b9RT#)F7*V|@obailEP1cjTOCcPny{eWK07H01gu6QZlMyfBBJGw z=Yn4l8Nvq5C5h_$jlF{}24qJSf{mZ53Vid2_u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ln|WWY@h+1-mLnAwEK34{9HPc`3qb0v+SlL+G&{$VYSjES zfV?dhi^#h969G9jl?Vj9(^~D)#3?vZ38Mc2MzR~Cn(A1C00000NkvXXu0mjf-R_PL literal 0 HcmV?d00001 diff --git a/murano-apps/PuppetMaster/package/manifest.yaml b/murano-apps/PuppetMaster/package/manifest.yaml new file mode 100644 index 0000000..3ef7c34 --- /dev/null +++ b/murano-apps/PuppetMaster/package/manifest.yaml @@ -0,0 +1,17 @@ +Format: 1.2 +Type: Application +FullName: org.openstack.ci_cd_pipeline_murano_app.PuppetMasterApplication +Name: PuppetMasterApplication +Description: | + Puppet is an open-source configuration management tool. It runs on many + Unix-like systems as well as on Microsoft Windows, and includes its own + declarative language to describe system configuration. +Author: 'Mirantis, Inc' +Tags: [Server, Puppet] +Classes: + org.openstack.ci_cd_pipeline_murano_app.puppet.PuppetMasterApplication: PuppetMasterApplication.yaml +UI: ui.yaml +Logo: logo.png +Require: + org.openstack.ci_cd_pipeline_murano_app.puppet.Puppet: + org.openstack.ci_cd_pipeline_murano_app.utils.CiCdUtils: