Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nationellt superdatorcentrum
puppetmodules
vm
Commits
ca496d75
Commit
ca496d75
authored
4 years ago
by
Hans Persson
Browse files
Options
Downloads
Patches
Plain Diff
Add network configuration for babylon and bluegrass.
parent
34cfa6c1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
manifests/guest.pp
+1
-0
1 addition, 0 deletions
manifests/guest.pp
templates/kickstart/xenguest.centos-6.ks.erb
+26
-0
26 additions, 0 deletions
templates/kickstart/xenguest.centos-6.ks.erb
templates/kickstart/xenguest.centos-7.ks.erb
+26
-0
26 additions, 0 deletions
templates/kickstart/xenguest.centos-7.ks.erb
with
53 additions
and
0 deletions
manifests/guest.pp
+
1
−
0
View file @
ca496d75
...
...
@@ -215,6 +215,7 @@ define vm::guest($ensure='installed', $autoboot=true, $virtmethod='xenpv',
include vm::network_bridging
include "
vm::osinst
::
$
{
nodash_os
}::
$
{
arch
}
"
include vm::guests::blacklist_hw_drivers
include puppet
file {
"
$
{
vm::osparams::xen_kickstart_dir
}
/
$
{
name
}
.
ks
":
...
...
This diff is collapsed.
Click to expand it.
templates/kickstart/xenguest.centos-6.ks.erb
+
26
−
0
View file @
ca496d75
...
...
@@ -39,6 +39,10 @@ reboot
ipaddr
=
Socket
.
getaddrinfo
(
@vm_fqdn
,
nil
,
family
=
Socket
::
AF_INET
)[
0
][
3
]
case
IPAddr
.
new
(
ipaddr
)
when
IPAddr
.
new
(
'130.236.100.0/25'
)
netmask
=
"255.255.255.128"
gateway
=
"130.236.100.1"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
).
reverse
()
when
IPAddr
.
new
(
'130.236.101.0/26'
)
netmask
=
"255.255.255.192"
gateway
=
"130.236.101.1"
...
...
@@ -47,6 +51,18 @@ reboot
netmask
=
"255.255.255.192"
gateway
=
"130.236.101.65"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
).
reverse
()
when
IPAddr
.
new
(
'130.236.103.112/28'
)
netmask
=
"255.255.255.240"
gateway
=
"130.236.103.113"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
)
when
IPAddr
.
new
(
'10.33.0.0/16'
)
netmask
=
"255.255.0.0"
gateway
=
"10.33.254.1"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
)
when
IPAddr
.
new
(
'192.168.118.0/24'
)
netmask
=
"255.255.255.0"
gateway
=
"192.168.118.10"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
).
reverse
()
else
raise
(
Puppet
::
ParseError
,
"Can't configure network for VM
#{
@name
}
(
#{
ipaddr
}
)"
)
...
...
@@ -165,3 +181,13 @@ if not explicit_home
_erbout
+=
mount_stanza
(
"/home"
,
nil
,
nil
,
true
)
end
-%>
cd
/
root
cat
>
bootstrap
<
<
EOF
wget
"
http:
//
<%=
scope
.
lookupvar
(
'puppet::master'
)
%>
/
pkg
/
puppet
/
runpuppet.sh
"
chmod
+
x
runpuppet.sh
PENV=
\${1:-production}
./
runpuppet.sh
--logdir=
/var/log/puppet
env=
<%=
scope
.
lookupvar
(
'puppet::master'
)
%>
:\$PENV
--tags=
pkgrepo
--waitforcert=
5
./
runpuppet.sh
--logdir=
/var/log/puppet
env=
<%=
scope
.
lookupvar
(
'puppet::master'
)
%>
:\$PENV
EOF
chmod
+
x
bootstrap
This diff is collapsed.
Click to expand it.
templates/kickstart/xenguest.centos-7.ks.erb
+
26
−
0
View file @
ca496d75
...
...
@@ -39,6 +39,10 @@ reboot
ipaddr
=
Socket
.
getaddrinfo
(
@vm_fqdn
,
nil
,
family
=
Socket
::
AF_INET
)[
0
][
3
]
case
IPAddr
.
new
(
ipaddr
)
when
IPAddr
.
new
(
'130.236.100.0/25'
)
netmask
=
"255.255.255.128"
gateway
=
"130.236.100.1"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
).
reverse
()
when
IPAddr
.
new
(
'130.236.101.0/26'
)
netmask
=
"255.255.255.192"
gateway
=
"130.236.101.1"
...
...
@@ -47,6 +51,18 @@ reboot
netmask
=
"255.255.255.192"
gateway
=
"130.236.101.65"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
).
reverse
()
when
IPAddr
.
new
(
'130.236.103.112/28'
)
netmask
=
"255.255.255.240"
gateway
=
"130.236.103.113"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
)
when
IPAddr
.
new
(
'10.33.0.0/16'
)
netmask
=
"255.255.0.0"
gateway
=
"10.33.254.1"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
)
when
IPAddr
.
new
(
'192.168.118.0/24'
)
netmask
=
"255.255.255.0"
gateway
=
"192.168.118.10"
nameservers
=
scope
.
lookupvar
(
'nscnets::dns_resolvers'
).
reverse
()
else
raise
(
Puppet
::
ParseError
,
"Can't configure network for VM
#{
@name
}
(
#{
ipaddr
}
)"
)
...
...
@@ -182,4 +198,14 @@ if not explicit_home
_erbout
+=
mount_stanza
(
"/home"
,
nil
,
nil
,
true
)
end
-%>
cd
/
root
cat
>
bootstrap
<
<
EOF
wget
"
http:
//
<%=
scope
.
lookupvar
(
'puppet::master'
)
%>
/
pkg
/
puppet
/
runpuppet.sh
"
chmod
+
x
runpuppet.sh
PENV=
\${1:-production}
./
runpuppet.sh
--logdir=
/var/log/puppet
env=
<%=
scope
.
lookupvar
(
'puppet::master'
)
%>
:\$PENV
--tags=
pkgrepo
--waitforcert=
5
./
runpuppet.sh
--logdir=
/var/log/puppet
env=
<%=
scope
.
lookupvar
(
'puppet::master'
)
%>
:\$PENV
EOF
chmod
+
x
bootstrap
%
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment