From c9514dd1cc885d30a141b62c71e4d7347c8a40c3 Mon Sep 17 00:00:00 2001
From: chodorenko <chodorenko@mail.ru>
Date: Sun, 12 Apr 2020 22:27:48 +0300
Subject: [PATCH] Fix Centos 7 template symbol "" + Add Global Vlan Support and
 Hostname (#308)

* Add files via upload

* Add files via upload

* Add files via upload

* Revert "Add files via upload"

This reverts commit 631fd0a9afa1b1be89a951214e3367f19ec09ed1.

* Revert "Add files via upload"

This reverts commit 3e0090262ed46d2fe9301e538d5c6b32e4fed052.

* Revert "Add files via upload"

This reverts commit 785a34d189ad8d0526d06ff547dea2fa5b708409.

* Vlan to global Config if defined
Redefine hostname in manifest

* Syntax Fix

Co-authored-by: Michail.Chodorenko via puppet-sandbox <michail.chodorenko@hoster.by>
---
 manifests/init.pp             | 2 ++
 templates/hostname-RedHat.erb | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/manifests/init.pp b/manifests/init.pp
index ceae669..6624d4c 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -132,6 +132,8 @@ class network (
 
   $hiera_merge               = false,
 
+  $vlan                      = undef,
+
   ) inherits ::network::params {
 
   # Hiera import
diff --git a/templates/hostname-RedHat.erb b/templates/hostname-RedHat.erb
index ba0a82b..4c3b470 100644
--- a/templates/hostname-RedHat.erb
+++ b/templates/hostname-RedHat.erb
@@ -10,4 +10,8 @@ NOZEROCONF="<%= @nozeroconf %>"
 NETWORKING_IPV6="<%= @ipv6enable %>"
 IPV6INIT="<%= @ipv6enable %>"
 <% end -%>
-HOSTNAME="<%= @manage_hostname.split('.').first %>"
+<% if @hostname -%>HOSTNAME="<%= @hostname %>"
+<%- else %>HOSTNAME="<%= @manage_hostname.split('.').first %>"
+<% end -%>
+<% if @vlan -%>VLAN="<%= @vlan %>"
+<% end -%>
-- 
GitLab