(context)
return {'resources': resources}
Generate configuration.
Generate configuration.
Generate configuration .
def GenerateConfig(context):
  """Generate configuration."""

  master = context.env['name']
  project = context.env['project']
  zone = context.properties['zone']

  resources = [{
      'name': master + '-firewall',
      'type': 'compute.v1.firewall',
      'properties': {
          'network': GlobalComputeUrl(project, 'networks', 'default'),
          'sourceRanges': ['0.0.0.0/0'],
          'allowed': [{
              'IPProtocol': 'tcp',
              'ports': ['4505', '4506']
          }]
      }
  }, {
      'name': master,
      'type': 'compute.v1.instance',
      'properties': {
          'zone': zone,
          'machineType': ZonalComputeUrl(project, zone, 'machineTypes',
                                         'f1-micro'),
          'disks': [{
              'deviceName': 'boot',
              'type': 'PERSISTENT',
              'boot': True,
              'autoDelete': True,
              'initializeParams': {
                  'sourceImage': GlobalComputeUrl('debian-cloud', 'images',
                                                  'family/debian-9'),
              }
          }],
          'networkInterfaces': [{
              'network': GlobalComputeUrl(project, 'networks', 'default'),
              'accessConfigs': [{
                  'name': 'External NAT',
                  'type': 'ONE_TO_ONE_NAT'
              }]
          }],
          'metadata': {
              'items': [{
                  'key': 'startup-script',
                  'value': ('#! /bin/bash\n'
                            'sudo echo \'deb http://debian.saltstack.com/'
                            'debian wheezy-saltstack main\' >> '
                            '/etc/apt/sources.list\n'
                            'sudo wget -q -O- http://debian.saltstack.com/'
                            'debian-salt-team-joehealy.gpg.key | '
                            'sudo apt-key add -\n'
                            'sudo apt-get update\n'
                            'sudo apt-get -y install salt-master\n'
                            'sudo salt-master -l debug')
              }]
          }
      }
  }]

  return {'resources': resources}
def GenerateConfig ( context ) : master = context . env [ 'name' ] project = context . env [ 'project' ] zone = context . properties [ 'zone' ] resources = [ { 'name' : master + '-firewall' , 'type' : 'compute.v1.firewall' , 'properties' : { 'network' : GlobalComputeUrl ( project , 'networks' , 'default' ) , 'sourceRanges' : [ '0.0.0.0/0' ] , 'allowed' : [ { 'IPProtocol' : 'tcp' , 'ports' : [ '4505' , '4506' ] } ] } } , { 'name' : master , 'type' : 'compute.v1.instance' , 'properties' : { 'zone' : zone , 'machineType' : ZonalComputeUrl ( project , zone , 'machineTypes' , 'f1-micro' ) , 'disks' : [ { 'deviceName' : 'boot' , 'type' : 'PERSISTENT' , 'boot' : True , 'autoDelete' : True , 'initializeParams' : { 'sourceImage' : GlobalComputeUrl ( 'debian-cloud' , 'images' , 'family/debian-9' ) , } } ] , 'networkInterfaces' : [ { 'network' : GlobalComputeUrl ( project , 'networks' , 'default' ) , 'accessConfigs' : [ { 'name' : 'External NAT' , 'type' : 'ONE_TO_ONE_NAT' } ] } ] , 'metadata' : { 'items' : [ { 'key' : 'startup-script' , 'value' : ( '#! /bin/bash\n' 'sudo echo \'deb http://debian.saltstack.com/' 'debian wheezy-saltstack main\' >> ' '/etc/apt/sources.list\n' 'sudo wget -q -O- http://debian.saltstack.com/' 'debian-salt-team-joehealy.gpg.key | ' 'sudo apt-key add -\n' 'sudo apt-get update\n' 'sudo apt-get -y install salt-master\n' 'sudo salt-master -l debug' ) } ] } } } ] return { 'resources' : resources }