Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grid5000
reference-repository
Commits
aec4ad19
Commit
aec4ad19
authored
May 03, 2016
by
Jérémie Gaidamour
Browse files
[dev] fixed $INCLUDE in bindg5k scripts
parent
817bd610
Changes
4
Hide whitespace changes
Inline
Side-by-side
generators/README.md
View file @
aec4ad19
...
...
@@ -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:
$
\c
url -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
---------------------
Updat
ing th
e OAR properties
---------------------
------
The generator can show the differences between the reference-repo and the OAR servers databases:
...
...
generators/puppet/bindg5k.rb
View file @
aec4ad19
...
...
@@ -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
...
...
generators/puppet/templates/bind-global-site.conf.erb
View file @
aec4ad19
;
; 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
...
...
generators/puppet/templates/bind-header.erb
View file @
aec4ad19
;
; 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. (
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment