(context, replica)
return instance
Generate configuration for every minion instance.
Generate configuration for every minion instance.
Generate configuration for every minion instance .
def GenerateInstanceConfig(context, replica):
  """Generate configuration for every minion instance."""

  name = (context.env['deployment'] + '-' + context.env['name'] + '-'
          + str(replica))

  machine_type = ('https://www.googleapis.com/compute/v1/projects/'
                  + context.env['project'] + '/zones/'
                  + context.properties['zone'] + '/machineTypes/f1-micro')
  instance = {
      'type': 'compute.v1.instance',
      'name': name,
      'properties': {
          'zone': context.properties['zone'],
          'machineType': machine_type,
          'disks': [{
              'deviceName': 'boot',
              'type': 'PERSISTENT',
              'boot': True,
              'autoDelete': True,
              'initializeParams': {
                  'sourceImage': IMAGE
              }
          }],
          'networkInterfaces': [{
              'network': ('https://www.googleapis.com/compute/v1/projects/'
                          + context.env['project']
                          + '/global/networks/default'),

              'accessConfigs': [{
                  'name': 'External NAT',
                  'type': 'ONE_TO_ONE_NAT'
              }]
          }],
          'tags': {
              'items': ['http-server']
          },
          'metadata': {
              'items': [{
                  'key': 'startup-script',
                  'value': ('#! /bin/bash\n'
                            'sudo echo \'deb http://debian.saltstack.com'
                            '/debian jessie-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-minion\n'
                            'sudo sed -i \'s/#master: salt/master: ' +
                            context.properties['master'] +
                            '/\' /etc/salt/minion\n'
                            'sudo salt-minion -l debug')
              }]
          }
      }
  }
  return instance
def GenerateInstanceConfig ( context , replica ) : name = ( context . env [ 'deployment' ] + '-' + context . env [ 'name' ] + '-' + str ( replica ) ) machine_type = ( 'https://www.googleapis.com/compute/v1/projects/' + context . env [ 'project' ] + '/zones/' + context . properties [ 'zone' ] + '/machineTypes/f1-micro' ) instance = { 'type' : 'compute.v1.instance' , 'name' : name , 'properties' : { 'zone' : context . properties [ 'zone' ] , 'machineType' : machine_type , 'disks' : [ { 'deviceName' : 'boot' , 'type' : 'PERSISTENT' , 'boot' : True , 'autoDelete' : True , 'initializeParams' : { 'sourceImage' : IMAGE } } ] , 'networkInterfaces' : [ { 'network' : ( 'https://www.googleapis.com/compute/v1/projects/' + context . env [ 'project' ] + '/global/networks/default' ) , 'accessConfigs' : [ { 'name' : 'External NAT' , 'type' : 'ONE_TO_ONE_NAT' } ] } ] , 'tags' : { 'items' : [ 'http-server' ] } , 'metadata' : { 'items' : [ { 'key' : 'startup-script' , 'value' : ( '#! /bin/bash\n' 'sudo echo \'deb http://debian.saltstack.com' '/debian jessie-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-minion\n' 'sudo sed -i \'s/#master: salt/master: ' + context . properties [ 'master' ] + '/\' /etc/salt/minion\n' 'sudo salt-minion -l debug' ) } ] } } } return instance