Change default location of puppet-network routes file on Debian
In order to compare the difference between sysinv database and currently configured static routes, the destination directory will be changed to /var/run/network-scripts.puppet/ This new location will be used by apply_network_config script to update modified configuration from the database and save the result in /etc/network/routes be used during boot by ifupdown Story: 2009101 Task: 44728 Signed-off-by: Andre Fernando Zanella Kantek <AndreFernandoZanella.Kantek@windriver.com> Change-Id: I4ba06160c2cc7db2bfec061c09b9eb6a75961ce4
This commit is contained in:
parent
46b4bcfcfe
commit
11cc1482ca
config/puppet-modules/puppet-network/debian/deb_folder/patches
49
config/puppet-modules/puppet-network/debian/deb_folder/patches/0003-set-routes-file-to-var-run-network-scripts.puppet.patch
Normal file
49
config/puppet-modules/puppet-network/debian/deb_folder/patches/0003-set-routes-file-to-var-run-network-scripts.puppet.patch
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
From 2ee2caf0b72ae54341934933c23d80c9a1b4e244 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andre Fernando Zanella Kantek
|
||||||
|
<AndreFernandoZanella.Kantek@windriver.com>
|
||||||
|
Date: Wed, 9 Mar 2022 09:59:06 -0300
|
||||||
|
Subject: [PATCH] set routes file to /var/run/network-scripts.puppet
|
||||||
|
|
||||||
|
Signed-off-by: Andre Fernando Zanella Kantek <AndreFernandoZanella.Kantek@windriver.com>
|
||||||
|
---
|
||||||
|
lib/puppet/provider/network_route/routes.rb | 13 +++++++++++--
|
||||||
|
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lib/puppet/provider/network_route/routes.rb b/lib/puppet/provider/network_route/routes.rb
|
||||||
|
index 290bb4d..9f7b40c 100644
|
||||||
|
--- a/lib/puppet/provider/network_route/routes.rb
|
||||||
|
+++ b/lib/puppet/provider/network_route/routes.rb
|
||||||
|
@@ -24,12 +24,19 @@ Puppet::Type.type(:network_route).provide(:routes) do
|
||||||
|
|
||||||
|
has_feature :provider_options
|
||||||
|
|
||||||
|
+ # WRS: Generate temporary copy. It will get compared to file
|
||||||
|
+ # /etc/network/interfaces afterward. Only config that have changed
|
||||||
|
+ # will get replaced. Don't let puppet directly manage it, else it will
|
||||||
|
+ # trigger un-wanted networking actions (like up/down).
|
||||||
|
+ SCRIPT_ROUTES_DIRECTORY = '/var/run/network-scripts.puppet/'
|
||||||
|
+ SCRIPT_ROUTES_FILE = SCRIPT_ROUTES_DIRECTORY + 'routes'
|
||||||
|
+
|
||||||
|
def select_file
|
||||||
|
- '/etc/network/routes'
|
||||||
|
+ SCRIPT_ROUTES_FILE
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.target_files
|
||||||
|
- ['/etc/network/routes']
|
||||||
|
+ [SCRIPT_ROUTES_FILE]
|
||||||
|
end
|
||||||
|
|
||||||
|
class MalformedRoutesError < Puppet::Error
|
||||||
|
@@ -86,6 +93,8 @@ Puppet::Type.type(:network_route).provide(:routes) do
|
||||||
|
|
||||||
|
# Generate an array of sections
|
||||||
|
def self.format_file(_filename, providers)
|
||||||
|
+ Dir.mkdir(SCRIPT_ROUTES_DIRECTORY) unless File.exists?(SCRIPT_ROUTES_DIRECTORY)
|
||||||
|
+
|
||||||
|
contents = []
|
||||||
|
contents << header
|
||||||
|
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
@ -1,2 +1,3 @@
|
|||||||
0001-save-result-file-to-var-run-network-to-allow-manipul.patch
|
0001-save-result-file-to-var-run-network-to-allow-manipul.patch
|
||||||
0002-set-provider-mode-when-formatting-interfaces-file.patch
|
0002-set-provider-mode-when-formatting-interfaces-file.patch
|
||||||
|
0003-set-routes-file-to-var-run-network-scripts.puppet.patch
|
Loading…
x
Reference in New Issue
Block a user