summaryrefslogtreecommitdiff
path: root/ansible/roles/srv01/tasks/set_hostname.yaml
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-07-12 17:41:30 +0300
committerheqnx <root@heqnx.com>2025-07-12 17:41:30 +0300
commit62acc6423bfead7cee08352dfc92e154eabbb4aa (patch)
treea435a4f996ea7ba28f5bec57baab655aaf114553 /ansible/roles/srv01/tasks/set_hostname.yaml
parent6e559dd880cf72b23c98d63e53982e4f359747f4 (diff)
downloadansible-active-directory-range-62acc6423bfead7cee08352dfc92e154eabbb4aa.tar.gz
ansible-active-directory-range-62acc6423bfead7cee08352dfc92e154eabbb4aa.zip
fixed linux domain join
Diffstat (limited to 'ansible/roles/srv01/tasks/set_hostname.yaml')
-rw-r--r--ansible/roles/srv01/tasks/set_hostname.yaml8
1 files changed, 6 insertions, 2 deletions
diff --git a/ansible/roles/srv01/tasks/set_hostname.yaml b/ansible/roles/srv01/tasks/set_hostname.yaml
index 6e04085..9141763 100644
--- a/ansible/roles/srv01/tasks/set_hostname.yaml
+++ b/ansible/roles/srv01/tasks/set_hostname.yaml
@@ -1,5 +1,9 @@
-- name: "update /etc/hosts"
+- name: set hostname
+ ansible.builtin.hostname:
+ name: "{{ main_linux_srv01_hostname }}.{{ main_domain_name }}"
+
+- name: update /etc/hosts
ansible.builtin.replace:
path: /etc/hosts
- regexp: "ubuntu-server2404"
+ regexp: "ubuntu"
replace: "{{ main_linux_srv01_hostname }}.{{ main_domain_name }} {{ main_linux_srv01_hostname }}"