ployground / ploy

A tool to manage servers through a central configuration. Plugins allow provisioning, configuration and other management tasks.
http://ploy.readthedocs.org
BSD 3-Clause "New" or "Revised" License
78 stars 15 forks source link

Problem with fabfile #19

Closed kent37 closed 10 years ago

kent37 commented 13 years ago

The fabfile integration seems to be broken for EC2 instances, the fabfile is run with the name of the instance from aws.conf rather than the public_dns_name of the running server. I think this was broken in https://github.com/fschulze/mr.awsome/commit/d671f7f595db1380e2a9604cfd3c5df12ce45224.

fschulze commented 13 years ago

Are you using the fabfile directly? You should use ./bin/aws do [instance-name] [fabric options]

kent37 commented 13 years ago

I use the command aws do dynamic_canvas show_in_browser. show_in_browser just opens a webbrowser to the host. It is going to http://dynamic_canvas instead of the actual EC2 name. The code for do_cmd() sets hoststr = argv[0] which is the instance name from the config file. That is passed as the -H argument to fab.

Prior to the revision I cited, hoststr was set to the host result of calling init_ssh_key() which is the public_dns_name for the instance.

kent37 commented 13 years ago

OK, I get it. The translation from instance name to public DNS name happens in HostConnectionCache in fabric_integration.py. This means that the host name in the fabfile is the instance name and the public DNS name is not available to the fabfile.

fschulze commented 13 years ago

I guess the best fix then would be to expose the public and maybe private DNS name to the fabfile.

kent37 commented 13 years ago

Yes. Ideally the host name passed to the fabfile would be the correct hostname.

fschulze commented 10 years ago

The env contains server which is the instance object which has all one needs, like the config etc.