I am writing an ansible playbook to provision a web server for me. Part of this process involves using the geerlingguy/ansible-role-security role (which I use to change the default ssh port). However, since the port changes, you cannot run the playbook over and over without changing the ansible_ssh_port variable. This seems to go against the whole point of idempotence, since you have to edit the playbook between runs. So I was wondering if there was a way to describe 2 ports for ansible to try. That way it would use port 22 the first time the script runs, but all other times it would use the other port.
I tried searching for ways to try different ports, but I couldn't find anything.