10

I want to be able to deploy charms both locally and to EC2. What's an example environments.yaml that has both entries?

And how can I switch between them so I can just deploy to EC2 and/or LXC?

Jorge Castro
  • 71,754

2 Answers2

11

You can have as many environments as you want in .juju/environments.yaml , and then set one as the default. Here is my sanitised environments.yaml with ec2, a private openstack cloud, and my local machine:

default: sample
environments:
  sample:
    type: ec2
    control-bucket: juju-XXXXXXXXXXXXXXXXXXXXXXXXXXXX
    admin-secret: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    secret-key: ZZZZZZZZZZZZZZZZZZZZZZZZZZ/2222222222
    access-key: 0123456789ABCDEF
    default-series: precise
  openstack:
    type: ec2
    default-instance-type: m1.small
    control-bucket: juju-XXXXXXXXXXXXXXXXXXXXXXXXXXXX
    admin-secret: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    ec2-uri: http://my.private.cloud:8773/services/Cloud
    s3-uri: http://my.private.s3:3333
    default-image-id: ami-000000ab
    access-key: random-uuid-follows-1fc1f05e-1c37-4594-8e5e:me_project
    secret-key: 4a75192b-2478-4acf-a6e8-aa60bbaf1e28
    default-series: precise
  local:
    type: local
    default-series: precise
    data-dir: /home/clint/.juju/data
    admin-secret: 3d909951d4984b92963f1186c4b6cb16
    control-bucket: foo
  customer-one:
    type: ec2
    control-bucket: juju-XXXXXXXXXXXXXXXXXXXXXXXXXXXX
    admin-secret: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    secret-key: ZZZZZZZZZZZZZZZZZZZZZZZZZZ/2222222222
    access-key: 0123456789ABCDEF
    default-series: precise
  customer-two:
    type: ec2
    control-bucket: juju-XXXXXXXXXXXXXXXXXXXXXXXXXXXX
    admin-secret: YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    secret-key: ZZZZZZZZZZZZZZZZZZZZZZZZZZ/2222222222
    access-key: 0123456789ABCDEF
    default-series: precise

I can select the environment by appending the '--environment' or '-e' argument to any juju command, so

juju status -e customer-one

Returns different things than just

juju status

Also each environment has different configuration options depending on the provider, see the following sections of the juju documentation:

Jorge Castro
  • 71,754
SpamapS
  • 19,820
0

after we've created more environments as ec1 'n ec2, how can we assign some nodes to ec1 and others nodes to ec2? And the bootstraps of nodes assigned on that environments how is work?

It's just to have a better way to manage the services deployed on them,Thanks.

Riccardo Magrini
  • 1,213
  • 4
  • 21
  • 39