stealthly / minotaur

Open Source Cloud Formation
http://www.stealth.ly
Apache License 2.0
59 stars 14 forks source link

Issues Running Basic Minotaur Commands #8

Closed lcalisi closed 9 years ago

lcalisi commented 9 years ago

I'm having issues running some basic command once inside the supervisor docker instance.

What I've done so far in setup is:

  1. Checkout lastest code, I saw some patches already
  2. Install docker on my centos box.
  3. Setup my AWS credentials in ~/.aws/config
  4. Created the json file under minotaur/infrastructure/aws/bastion/chef/data_bags/users/lcalisi.json
  5. Setup my config directory in minotaur/supervisor/config (aws_config, ENVIRONMENT.key, private.key)
  6. Ran sudo ./up.sh
  7. the awsinfo command works
  8. minotaur infrastructure deploy iampolicies shows no errors
  9. minotaur infrastructure deploy iamusertogroupadditions also shows no errors.

However, these commands fail for me:

minotaur infrastructure list

root@supervisor:/deploy# minotaur infrastructure list Traceback (most recent call last): File "/usr/local/bin/minotaur", line 110, in Minotaur().deploy() File "/usr/local/bin/minotaur", line 69, in init if self.args.debug == True: AttributeError: 'Namespace' object has no attribute 'debug' root@supervisor:/deploy#

minotaur infrastructure deploy all -e bdoss-dev -r us-east-1 -z us-east-1a -i m1.small -c 10.0.8.0/21

root@supervisor:/deploy# minotaur infrastructure deploy all -e bdoss-dev -r us-east-1 -z us-east-1a -i m1.small -c 10.0.8.0/21 Traceback (most recent call last): File "/usr/local/bin/minotaur", line 110, in Minotaur().deploy() File "/usr/local/bin/minotaur", line 69, in init if self.args.debug == True: AttributeError: 'Namespace' object has no attribute 'debug' root@supervisor:/deploy#

okushchenko commented 9 years ago

It's a bug, thanks for spotting it. I've made a quick fix, it will be merged here soon.

You may just look at recent pull request(https://github.com/stealthly/minotaur/pull/9) in here and alter few lines of code in your local repo to get update right now.

lcalisi commented 9 years ago

Thanks. I just applied your patch and I can run the list command.

However when I continue the example I get the following error. I have no idea why the web service call fails:

Using --debug here is the URL: GET /?Action=ListTopics&ContentType=JSON&Version=2010-03-31

root@supervisor:/deploy# minotaur infrastructure deploy bastion -e bdoss-dev -r us-east-1 -z us-east-1a Template successfully validated. Traceback (most recent call last): File "/usr/local/bin/minotaur", line 111, in Minotaur().deploy() File "/usr/local/bin/minotaur", line 92, in deploy exec("{0}.main()".format(sys.argv[3])) File "", line 1, in File "/deploy/infrastructure/aws/bastion/bastion.py", line 56, in main infrastructure = Bastion(args.environment, args.region, args.availability_zone, args.instance_type, args.repo_url) File "/deploy/infrastructure/aws/bastion/bastion.py", line 30, in init vpc_id = self.get_vpc(environment).id AttributeError: 'NoneType' object has no attribute 'id' root@supervisor:/deploy#

okushchenko commented 9 years ago

Looks like script can't find a vpc named bdoss-dev in your aws account, so you need to deploy it first. To deploy bastion you need a vpc where it will be placed, as well as subnets, nat, sns topics. So please use following command to get everything up and running:

minotaur infrastructure deploy all -e bdoss-dev -r us-east-1 -z us-east-1a -i m1.small -c 10.0.8.0/21 -u https://github.com/stealthly/minotaur

To have ability to ssh into instances through bastion you also need to fork this repo and commit you data bag(minotaur/infrastructure/aws/bastion/chef/data_bags/users/lcalisi.json) to your repo. After that you must specify your repo(it must be public) using -u https://github.com/<user_name>/minotaur flag.

lcalisi commented 9 years ago

Wow, didn't realize I had to fork in order to get this to work. I'll try thanks for all your help.

joestein commented 9 years ago

You don't have to fork it, you could also git clone it. You should manage the code yourself as you are going to want to put your code into the infrastructure too. You can fetch upstream and merge local to keep current e.g. https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/