Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 11 down vote accepted

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:

share|improve this answer

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.

share|improve this answer
    
Please ask this as a new question, there's lots of ways to do this. –  Jorge Castro Jul 19 at 4:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.