diff --git a/README.md b/README.md index 074697d..cbc5033 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@ Role Variables -------------- -|Variable name | Variable value -|--------------|--------------- -|*hostname* |new hostname (not FQDN, before first dot) -|*fqdn* | new domain name +| Variable name | Variable value | Default | +|---------------|----------------|---------| +|*hostname* | hostname (eg. vm1) | `inventory_hostname_short` | +|*fqdn* | domain name (eg. vm1.test.com) | `inventory_hostname` | Example ------- diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..710a5cc --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,3 @@ +--- +fqdn: "{{ inventory_hostname }}" +hostname: "{{ inventory_hostname_short }}" diff --git a/tasks/main.yml b/tasks/main.yml index c8574ee..67375a3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,14 +1,4 @@ --- -- name: fqdn | Check for FQDN variable presence - fail: - msg: "FQDN variable is not set!" - when: fqdn|default(False) == False - -- name: fqdn | Check for hostname variable presence - fail: - msg: "Hostname variable is not set!" - when: hostname|default(False) == False - - name: fqdn | Configure Debian include: debian.yml when: ansible_distribution in [ 'Debian', 'Ubuntu' ]