Closed flavianh closed 9 years ago
@traxair, so much of the underlying code has configurable ports, I guess I just assumed that it was exposed to the user too. If you look at salt.utils.cloud
, you'll see configurable ports everywhere.
The argument should be called port
(for consistency, and because it may be used for either *nix or Windows), and it should be configurable from provider/profile/maps (vm_
) or from the Cloud config (__opts__
).
I like the maps option. So basically if I call _vm.get("port", 22)
I should be automatically fine?
@traxair, technically that will work, but what you really want to do is look at the config.get_cloud_config_value()
examples scattered throughout Salt Cloud, since it looks through vm_
and __opts__
.
Yes I just found one for volumes config.get_cloud_config_value( 'volumes', vm_, __opts__, search_global=True )
Also, I see both port
and local_port
in msazure.py
. You should probably do both, using those names.
I'm not sure but if you change local_port to something other than 22 SSH won't like it
I want to make sure of something. cloud.profiles.d/azure.conf:
azure-ubuntu:
provider: azure
image: 'b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04_1-LTS-amd64-server-20141125-en-us-30GB'
size: Small
location: 'West Europe'
ssh_username: the_name
ssh_password: the_password
slot: production
media_link: 'http://portalvhds9f92yhq0vgyk2.blob.core.windows.net/vhds'
maps/azure.map:
azure-ubuntu:
- machine-1:
port: 22
- machine-2:
port: 23
- machine-3:
port: 24
This should work right?
I don't see any problems with that offhand.
Very well then. I'm working on Azure data disk at the moment I'll submit a pull request when I'm ready and I may have questions for you
Works now
How did you work around the fact that the bootstrap script tries to connect via SSH on port 22?
Looks like including ssh_port in the map allows it to work.
Since the SSH port is hard coded to be 22 and the VM is accessed through the cloud service's DNS, creating another VM will result in a port conflict. We can either:
However, how will the master react to a non-22 SSH port when assigning a key?