diff --git a/README.md b/README.md index 1eb8425..0cd7831 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ smart people at [Hashrocket](http://hashrocket.com/). ### devops +- [Aliasing An Ansible Host](devops/aliasing-an-ansible-host.md) - [Check The Status of All Services](devops/check-the-status-of-all-services.md) - [Check The Syntax Of nginx Files](devops/check-the-syntax-of-nginx-files.md) - [Path Of The Packets](devops/path-of-the-packets.md) diff --git a/devops/aliasing-an-ansible-host.md b/devops/aliasing-an-ansible-host.md new file mode 100644 index 0000000..989a09d --- /dev/null +++ b/devops/aliasing-an-ansible-host.md @@ -0,0 +1,22 @@ +# Aliasing An Ansible Host + +When specifying the hosts that Ansible can interact with in the +`/etc/ansible/hosts` file, you can put just the IP address of the host +server, like so: + +```yml +192.168.1.50 +``` + +IP addresses are not particularly meaningful for a person to look at though. +Giving it a name serves as better documentation and makes it easier to see +what host servers are in play during a task. + +Ansible makes it easy to alias host servers. For example, we can name our +host `staging` like so: + +```yml +staging ansible_host=192.168.1.50 +``` + +[source](http://docs.ansible.com/ansible/intro_inventory.html)