sunrisemovement / devops

This repo is obsolete. A maintained version of this code lives at https://github.com/maximum-ethics/linode-caddy
GNU Affero General Public License v3.0
2 stars 1 forks source link

consider storing hostname with SSH aliases rather than /etc/hosts #4

Open skyfaller opened 4 years ago

skyfaller commented 4 years ago

Currently linode_create.yml ties hostnames to their IP addresses in /etc/hosts so that you can simply refer to them by their hostname when SSHing, using Ansible plays etc. rather than trying to remember and type out their IP addresses.

One problem with this approach is that it requires sudo powers on your local machine, which is a security issue and another password that you have to type out or store.

An approach that would not require sudo powers is to use SSH aliases instead. SSH aliases would also allow us to configure connection settings in other ways besides names for IP addresses, such as choosing among multiple usernames or SSH keys.

One disadvantage to using SSH aliases is that they would not function when e.g. using the ping command, or other utilities that do not interact with SSH. We must consider such pros and cons.

In other words, which is more important, avoiding running playbooks with local sudo powers, or being able to use non-SSH utilities like ping with a hostname? Is there some third way that avoids these specific drawbacks?