Commit aec4ad19 authored by Jérémie Gaidamour's avatar Jérémie Gaidamour

[dev] fixed $INCLUDE in bindg5k scripts

parent 817bd610
......@@ -27,7 +27,7 @@ For the general design discussion, see:
Requirements
------------
Ruby 2.1 (+ HashDiff and Net/SSH for the oar-generator; + peach and ruby-cute for run-g5kchecks)
Ruby 2.1 (+ HashDiff and Net/SSH for the oar-generator; + peach and ruby-cute for run-g5kchecks; + hash_validator for the input validators)
Here is an example for creating a ruby setup with RVM (https://rvm.io/), gemset and bundle:
$ \curl -sSL https://get.rvm.io | bash -s stable --ruby
......@@ -96,8 +96,8 @@ The Reference API generator reads the input/ YAML files and generates the data/
Usage: cd reference-api/; ruby reference-api.rb
Update OAR properties
---------------------
Updating the OAR properties
---------------------------
The generator can show the differences between the reference-repo and the OAR servers databases:
......
......@@ -230,19 +230,19 @@ refapi["sites"].each { |site_uid, site|
# DNS (/modules/bindg5k/files/zones/nancy.db)
manual = site_uid + '-manual.db'
dns.unshift("$INCLUDE #{manual}") if File.exist?(zones_dir + manual) # add include statement
dns.unshift("$INCLUDE /etc/bind/zones/#{site_uid}/#{manual}") if File.exist?(zones_dir + manual) # add include statement
output_file = site_uid + '.db'
header = ERB.new(File.read('templates/bind-header.erb')).result(binding)
File.write(zones_dir + output_file, header + dns.join("\n"))
File.write(zones_dir + output_file, header + dns.join("\n") + "\n")
# Reverse DNS (/modules/bindg5k/files/zones/reverse-*db)
reverse.each { |output_file, output|
header = ERB.new(File.read('templates/bind-header.erb')).result(binding) # do not move outside of the loop (it uses the output_file variable)
manual = output_file.sub('.db', '') + '-manual.db'
output.unshift("$INCLUDE #{manual}") if File.exist?(zones_dir + manual) # add include statement
File.write(zones_dir + output_file, header + output.join("\n"))
output.unshift("$INCLUDE /etc/bind/zones/#{site_uid}/#{manual}") if File.exist?(zones_dir + manual) # add include statement
File.write(zones_dir + output_file, header + output.join("\n") + "\n")
}
# files/global/conf/global-nancy.conf
......
;
; This file was generated by reference-repository.git/generators/puppet/<%= File.basename($PROGRAM_NAME) %>
; Do not edit this file by hand. Your changes will be overwritten.
;
<%
if dir == 'global'
type = 'master'
......@@ -13,7 +8,7 @@
end
# List file in the directory instead of using the 'reverse' variable as some files might be set manually
Dir.entries(zones_dir).each { |file|
Dir.entries(zones_dir).sort.each { |file|
next unless /.*.db$/.match(file)
next if /.*-manual\.db/.match(file) # Those files are included in the generated version of the file
......
;
; This file was generated by reference-repository.git/generators/puppet/<%= File.basename($PROGRAM_NAME) %>
; Do not edit this file by hand. Your changes will be overwritten.
;
$TTL 3h
@ IN SOA dns.grid5000.fr. nsmaster.dns.grid5000.fr. (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment