summaryrefslogtreecommitdiff
path: root/ansible/roles/srv01/tasks/set_hostname.yaml
blob: 9141763f3995974f3a35c87b6709c115e92fec7f (plain)
1
2
3
4
5
6
7
8
9
- 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"
    replace: "{{ main_linux_srv01_hostname }}.{{ main_domain_name }} {{ main_linux_srv01_hostname }}"