libcloud-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markos Gogoulos <mgogou...@mist.io>
Subject Re: startup script support for GCP?
Date Mon, 09 Oct 2017 10:58:13 GMT
Hi Pratik,

libcloud function that creates a VM on GCP (aka create_node() on
libcloud/libcloud/compute/drivers/gce.py) accepts an ex_metadata dictionary
that can contain the startup script. It expects something like this:

    metadata = {
        'startup-script': '#!/bin/bash\ntouch /tmp/hello',
    }

or if you also specify an ssh key to be deployed on the VM

    key = "ssh-rsa AAAAB3Nz.... (rest of a pub key)"
    metadata = {
        'startup-script': '#!/bin/bash\ntouch /tmp/hello',
        'sshKeys': 'user:%s' % key
    }


not sure though if this is supported by saltstack.

Cheers,
Markos


On Fri, Oct 6, 2017 at 8:27 PM, Pratik Bandarkar <pratik.bandarkar@gmail.com
> wrote:

> To be more specific, does it provide "--metadata-from-file" option to
> specify startup script file?
>
> Regards,
> Pratik.
>
>
>
> On Fri, Oct 6, 2017 at 5:36 PM, Pratik Bandarkar <
> pratik.bandarkar@gmail.com
> > wrote:
>
> > Hi,
> >
> > I am using saltstack for deployment of instances on top of GCE. I would
> > like to know if we can provide startup/cloud-init script while spawning
> an
> > instance? Does libcloud support this functionality for saltstack?
> >
> > Regards,
> > Pratik.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message