Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nspawn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ansible
nspawn
Commits
c392e997
Commit
c392e997
authored
9 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
- NAT is still WIP (hanged on Debian bug).
- Updated TODO list.
parent
b29d7ad3
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.rst
+2
-0
2 additions, 0 deletions
README.rst
files/nspawnbr0.netdev
+3
-0
3 additions, 0 deletions
files/nspawnbr0.netdev
files/nspawnbr0.network
+7
-0
7 additions, 0 deletions
files/nspawnbr0.network
tasks/main.yml
+44
-0
44 additions, 0 deletions
tasks/main.yml
with
56 additions
and
0 deletions
README.rst
+
2
−
0
View file @
c392e997
...
...
@@ -43,5 +43,7 @@ TODO
- If root mount is NOT btrfs, then create a sparse file, format with btrfs and
mount under /var/lib/machines.
- Disable the networking service, use systemd-networkd.
- Create a bridge with NAT using systemd-networkd, use dnsmasq for dns
resolving.
- Create a Debian Jessie base image to clone.
- Test mac-vlan on Vagrant.
This diff is collapsed.
Click to expand it.
files/nspawnbr0.netdev
0 → 100644
+
3
−
0
View file @
c392e997
[NetDev]
Name=nspawnbr0
Kind=bridge
This diff is collapsed.
Click to expand it.
files/nspawnbr0.network
0 → 100644
+
7
−
0
View file @
c392e997
[Match]
Name=nspawnbr0
[Network]
Address=192.168.123.1/24
DHCPServer=yes
IPMasquerade=yes
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
44
−
0
View file @
c392e997
...
...
@@ -10,7 +10,51 @@
with_items
:
-
systemd-sysv
-
systemd-container
-
libnss-myhostname
-
libnss-mymachines
-
libnss-resolve
-
ufw
-
btrfs-tools
-
debootstrap
-
yum
-
dnsmasq
-
name
:
Create npawn configuration directory
file
:
path
:
/etc/systemd/nspawn
owner
:
root
group
:
root
mode
:
'
0755'
state
:
directory
-
name
:
Allow IP forwarding in UFW
ufw
:
direction
:
routed
policy
:
allow
-
name
:
Configure systemd-networkd
with_fileglob
:
-
'
*.netdev'
-
'
*.network'
-
'
*.link'
copy
:
src
:
'
{{
item
}}'
dest
:
'
/etc/systemd/network/{{
item|basename
}}'
owner
:
root
group
:
root
mode
:
'
0644'
-
name
:
Disable networking service, enable systemd-networkd
with_items
:
-
name
:
systemd-resolved
state
:
started
enabled
:
yes
-
name
:
systemd-networkd
state
:
started
enabled
:
yes
-
name
:
networking
enabled
:
no
service
:
name
:
'
{{
item.name
}}'
state
:
'
{{
item.state|default(omit)
}}'
enabled
:
'
{{
item.enabled
}}'
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