Rename a Digital Ocean droplet ****************************** .. highlight:: bash Rename on digital ocean control panel ===================================== Login to the Digital Ocean Control Panel Click the droplet you want to rename Then, on the droplet detail window, click on the name of your droplet Change the name in the entry field and click the tick mark beside the field .. _rename_server: Rename on the server ==================== Log in to the server and edit the hosts file:: sudo vim /etc/hosts Find the host entry that reads:: 127.0.1.1 n.b. this line may say:: 127.0.1.1 Alter this host entry to read:: 127.0.1.1 This is transitional meaning that the host will respond to both names. After the host has been renamed and a reboot has been done you can remove from the entry rename the server using the hostname command:: sudo hostname .. tip:: To update the Salt minion, move onto the next section. .. _salt_change_minion_id: Update Salt configuration ========================= As well as changing the host name you also need to alter the minion id and update the master salt server. Amend the minion id ------------------- Stop the salt-minion service:: sudo service salt-minion stop Change minion id in /etc/salt/minion_id:: sudo vim /etc/salt/minion_id After you edit the file should contain the new droplet name. Start the salt-minion service:: sudo service salt-minion start Update master server --------------------- On the master server run check for the new minion name sudo salt-key -L Accept the new minion name using:: sudo salt-key -a Type Y to accept Delete the old minion name:: sudo salt-key -d .. note:: If you are changing the first part of the droplet name e.g from test-a to xy-a then ensure that the 'test-*' section has the same content as the 'xy-*' section Rename the configuration file as follows:: cd /srv/pillar/sites mv .sls .sls Edit top.sls to use the new name:: cd vim top.sls Find the section for the old droplet name:: : sites. Change this to:: : sites.