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 0000000..913d3c1 Binary files /dev/null and b/murano-apps/PuppetMaster/package/logo.png differ 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: