Skip to content

The ssh_user and ssh_port parameters #52

Open
@lod

Description

The ssh_user and ssh_port parameters are complex and undocumented.

Old (released) system. The template create.yml hard coded ssh_user and ssh_port to ubuntu and 22. This was passed in to the instance config. driver.py read these from the instance config and used them to set the ansible_user and ansible_port portions of the connection options. To override them required setting ansible_user and ansible_port in the connection_options portion of the platform definition.

New system. The template create.yml reads ssh_user and ssh_port from the platform, the defaults are ubuntu and 22. This is used during the creation process, the user is set via cloud-init unless the key_inject_method is overridden and the port is used when polling until the instance starts. These are then passed via the instance config to driver.py and used to populate ansible_user and ansible_port for downstream inventory use.

I detailed both to highlight the backwards compatibility issue. My prior practice was to specify the ansible_user in connection_options, for example setting it to admin for a Debian distribution. This configured the inventory for the subsequent ansible stages, commands such as molecule login also worked. Using current master that breaks badly, cloud-init is used during create to set the user to ubuntu. The inventory is then configured to use admin, which breaks everything. The cause is not obvious.

I feel there are also issues with the name. Ansible is moving away from ansible_ssh_user to ansible_user. Setting ssh_port to 5986 for winrm looks weird.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ec2Amazon EC2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions