"Fossies" - the Fresh Open Source Software Archive

Member "murano-8.0.0/meta/io.murano/Classes/Environment.yaml" (16 Oct 2019, 3929 Bytes) of package /linux/misc/openstack/murano-8.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "Environment.yaml": 5.0.0_vs_6.0.0.

    1 #  Licensed under the Apache License, Version 2.0 (the "License"); you may
    2 #  not use this file except in compliance with the License. You may obtain
    3 #  a copy of the License at
    4 #
    5 #       http://www.apache.org/licenses/LICENSE-2.0
    6 #
    7 #  Unless required by applicable law or agreed to in writing, software
    8 #  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
    9 #  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   10 #  License for the specific language governing permissions and limitations
   11 #  under the License.
   12 
   13 Namespaces:
   14     =: io.murano
   15     res: io.murano.resources
   16     sys: io.murano.system
   17 
   18 Name: Environment
   19 
   20 Properties:
   21   name:
   22     Contract: $.string().notNull()
   23 
   24   applications:
   25     Contract: [$.class(Application).owned().notNull()]
   26 
   27   agentListener:
   28     Contract: $.class(sys:AgentListener)
   29     Usage: Runtime
   30 
   31   stack:
   32     Contract: $.class(sys:HeatStack)
   33     Usage: Runtime
   34 
   35   instanceNotifier:
   36     Contract: $.class(sys:InstanceNotifier)
   37     Usage: Runtime
   38 
   39   defaultNetworks:
   40     Contract:
   41       environment: $.template(res:Network)
   42       flat: $.template(res:Network)
   43 
   44   securityGroupManager:
   45     Contract: $.class(sys:SecurityGroupManager)
   46     Usage: Runtime
   47 
   48   reporter:
   49     Contract: $.class(sys:StatusReporter)
   50     Usage: Runtime
   51 
   52   regionConfigs:
   53     Contract:
   54       $.string():
   55         agentRabbitMq:
   56           host: $.string().notNull()
   57           port: $.int() or 5672
   58           login: $.string().notNull()
   59           password: $.string().notNull()
   60           virtual_host: $.string() or '/'
   61           ssl: $.bool() or false
   62           insecure: $.bool() or false
   63     Usage: Config
   64 
   65   region:
   66     Contract: $.string()
   67     Usage: InOut
   68 
   69   homeRegionName:
   70     Contract: $.string()
   71     Usage: Runtime
   72 
   73   regions:
   74     Contract:
   75       $.string(): $.class(CloudRegion)
   76     Usage: InOut
   77 
   78 
   79 Methods:
   80   .init:
   81     Body:
   82       - $.homeRegionName: config(home_region) or ''
   83       - $._assignRegions()
   84       - $.instanceNotifier: new(sys:InstanceNotifier, environment => $this)
   85       - $.reporter: new(sys:StatusReporter, environment => $this)
   86       - $.regions: $.regions + $.regionConfigs.keys().
   87           where($ and not $this.regions.containsKey($)).
   88           select($this._createRegion($)).
   89           toDict($.name)
   90       - If: not $.regions.containsKey('')
   91         Then:
   92         - If: $.homeRegionName
   93           Then:
   94             $.regions['']: $.regions[$.homeRegionName]
   95           Else:
   96             $.regions['']: $._createRegion('')
   97 
   98       - $defaultRegion: $.regions['']
   99       - $.stack: $defaultRegion.stack
  100       - $.securityGroupManager: $defaultRegion.securityGroupManager
  101 
  102   _createRegion:
  103     Arguments:
  104       regionName:
  105         Contract: $.string()
  106     Body:
  107       - $envNet: $.defaultNetworks.environment?.set(regionName => $regionName)
  108       - $flatNet: $.defaultNetworks.flat?.set(regionName => $regionName)
  109       - Return: new(CloudRegion, $this,
  110             name => $regionName,
  111             defaultNetworks => {
  112                 environment => $envNet,
  113                 flat => $flatNet
  114               }
  115           )
  116 
  117   deploy:
  118     Scope: Public
  119     Body:
  120       - $.applications.pselect($.deploy())
  121 
  122   _assignRegions:
  123     Body:
  124       - If: $.region = null
  125         Then:
  126           $.region: $.homeRegionName
  127 
  128       - $defaultRegionConfig:
  129           agentRabbitMq:
  130             host: config(rabbitmq, host)
  131             port: config(rabbitmq, port)
  132             login: config(rabbitmq, login)
  133             password: config(rabbitmq, password)
  134             virtual_host: config(rabbitmq, virtual_host)
  135             ssl: config(rabbitmq, ssl)
  136 
  137       - If: not $.regionConfigs.containsKey('')
  138         Then:
  139         - $.regionConfigs: $.regionConfigs.set('' => $defaultRegionConfig)
  140 
  141       - If: $.homeRegionName and not $.regionConfigs.containsKey($.homeRegionName)
  142         Then:
  143         - $.regionConfigs: $.regionConfigs.set($.homeRegionName => $defaultRegionConfig)