Merge branch 'master' of adellam/ansible-roles into master

This commit is contained in:
Andrea Dell'Amico 2019-10-28 17:36:41 +01:00 committed by Gitea
commit 98a726cc4d
1 changed files with 6 additions and 1 deletions

View File

@ -51,11 +51,16 @@
command: timedatectl set-timezone {{ timezone }} command: timedatectl set-timezone {{ timezone }}
tags: [ 'centos', 'bootstrap' ] tags: [ 'centos', 'bootstrap' ]
- name: Set the hostname - name: Set the hostname when explicitly defined
hostname: name={{ hostname }} hostname: name={{ hostname }}
when: hostname is defined when: hostname is defined
tags: [ 'centos', 'bootstrap' ] 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 - name: Configure the main interface to set the correct resolvers. dns1
lineinfile: name=/etc/sysconfig/network-scripts/ifcfg-eth0 regexp="^DNS1=" line="DNS1={{ dns1 }}" lineinfile: name=/etc/sysconfig/network-scripts/ifcfg-eth0 regexp="^DNS1=" line="DNS1={{ dns1 }}"
when: centos_set_dns_servers when: centos_set_dns_servers