Update the hostname if update_hostname: yes
This commit is contained in:
parent
66acbf2930
commit
3c2f642820
3 changed files with 9 additions and 0 deletions
|
@ -12,6 +12,8 @@ Role Variables
|
||||||
Defaults:
|
Defaults:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
hostname: {{ inventory_hostname }}
|
||||||
|
update_hostname: no
|
||||||
locales_gen:
|
locales_gen:
|
||||||
- en_US.UTF-8
|
- en_US.UTF-8
|
||||||
- de_DE.UTF-8
|
- de_DE.UTF-8
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
---
|
---
|
||||||
# defaults file for common
|
# defaults file for common
|
||||||
|
hostname: '{{ inventory_hostname }}'
|
||||||
|
update_hostname: yes
|
||||||
locales_gen:
|
locales_gen:
|
||||||
- en_US.UTF-8
|
- en_US.UTF-8
|
||||||
- de_DE.UTF-8
|
- de_DE.UTF-8
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
---
|
---
|
||||||
# tasks file for common
|
# tasks file for common
|
||||||
|
- name: Update hostname
|
||||||
|
become: true
|
||||||
|
hostname:
|
||||||
|
name: '{{ hostname }}'
|
||||||
|
when: hostname and update_hostname == True
|
||||||
|
|
||||||
- name: Firewall
|
- name: Firewall
|
||||||
become: true
|
become: true
|
||||||
|
|
Loading…
Add table
Reference in a new issue