aboutsummaryrefslogtreecommitdiffstats
path: root/roles/hostname
diff options
context:
space:
mode:
authorStonewall Jackson <stonewall@sacredheartsc.com>2023-02-13 20:05:25 -0500
committerStonewall Jackson <stonewall@sacredheartsc.com>2023-02-13 20:05:52 -0500
commit8c2dccad6652a535a6c549a2c4133afd9eb251ed (patch)
tree6760ba328fe606693601f9c1c51bfd7b010a974b /roles/hostname
parent3e94667b6b73c588ea8503138b5e201b45686978 (diff)
downloadselfhosted-8c2dccad6652a535a6c549a2c4133afd9eb251ed.tar.gz
selfhosted-8c2dccad6652a535a6c549a2c4133afd9eb251ed.zip
add docs
Diffstat (limited to 'roles/hostname')
-rw-r--r--roles/hostname/README.md30
-rw-r--r--roles/hostname/defaults/main.yml2
2 files changed, 31 insertions, 1 deletions
diff --git a/roles/hostname/README.md b/roles/hostname/README.md
new file mode 100644
index 0000000..057bce0
--- /dev/null
+++ b/roles/hostname/README.md
@@ -0,0 +1,30 @@
+Hostname
+========
+
+Description
+-----------
+
+The `hostname` role sets the local hostname and generates `/etc/hosts`.
+
+Variables
+---------
+
+This role **accepts** the following variables:
+
+Variable | Default | Description
+-----------------|-----------------------------------------|------------
+`hostname_fqdn` | `{{ inventory_hostname }}.{{ domain }}` | Fully qualified domain name
+`hostname_short` | `{{ inventory_hostname }}` | Short hostname
+`hostname_ip` | `{{ ip }}` | IPv4 address
+
+Usage
+-----
+
+Example playbook:
+
+````yaml
+- name: set hostname
+ hosts: all
+ roles:
+ - hostname
+````
diff --git a/roles/hostname/defaults/main.yml b/roles/hostname/defaults/main.yml
index c884565..8fc7757 100644
--- a/roles/hostname/defaults/main.yml
+++ b/roles/hostname/defaults/main.yml
@@ -1,3 +1,3 @@
-hostname_fqdn: '{{ fqdn }}'
+hostname_fqdn: '{{ inventory_hostname }}.{{ domain }}'
hostname_short: '{{ inventory_hostname }}'
hostname_ip: '{{ ip }}'