forked from ISTI-ansible-roles/ansible-roles
Set the hostname as defined in the inventory.
This commit is contained in:
parent
9913b65d09
commit
4b5809f4b1
|
@ -51,11 +51,16 @@
|
|||
command: timedatectl set-timezone {{ timezone }}
|
||||
tags: [ 'centos', 'bootstrap' ]
|
||||
|
||||
- name: Set the hostname
|
||||
- name: Set the hostname when explicitly defined
|
||||
hostname: name={{ hostname }}
|
||||
when: hostname is defined
|
||||
tags: [ 'centos', 'bootstrap' ]
|
||||
|
||||
- name: Set the hostname as defined in the inventory
|
||||
hostname: name={{ inventory_hostname }}
|
||||
when: hostname is not defined
|
||||
tags: [ 'bootstrap', 'set_hostname' ]
|
||||
|
||||
- name: Configure the main interface to set the correct resolvers. dns1
|
||||
lineinfile: name=/etc/sysconfig/network-scripts/ifcfg-eth0 regexp="^DNS1=" line="DNS1={{ dns1 }}"
|
||||
when: centos_set_dns_servers
|
||||
|
|
Loading…
Reference in New Issue