Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Idempotency when changing sshd ports #299

@nununo

Description

@nununo

Is your feature request related to a problem? Please describe.
If I want to change the default sshd port from 22 to 12345, the server's ansible_port should be set to 12345so that Ansible can keep connecting to the server after the change. But, since when I run ssh-hardening for the first time the port is still 22, ssh-hardening will not be able to connect. So I am forced to edit the inventory after the first run.

Describe the solution you'd like
The ssh-hardening rule could try to connect to both port 22 and the desired final port 12345. Just like this article suggests.

This way the inventory could be configured with the final port 12345 and ssh-hardening would be idempotent, work both in the first and subsequent runs.

Describe alternatives you've considered
Add a custom role that runs before ssh-hardening implementing the solution proposed in the article linked above.

Additional context
NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions