-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docs #32
Update docs #32
Changes from 7 commits
415e513
fbbc0a3
3102c3f
206cf65
21fa7c0
dfe784d
1479deb
956367d
3ff748c
7cdc025
f66963d
856e102
a2beb99
4092ea8
8b77b8c
609deac
bdcce0d
5b45136
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ Monkeying around with virtual machines and pxe configs. | |
- [HTTP PXE](#http-pxe) | ||
- [HTTP VM](#http-vm) | ||
- [HTTP installimage](#http-installimage) | ||
- [HTTP DHCP](#http-dhcp) | ||
+ [Issues](#issues) | ||
+ [Copyright](#copyright) | ||
+ [Name origin](#name-origin) | ||
|
@@ -24,10 +25,26 @@ Monkeying around with virtual machines and pxe configs. | |
|
||
## Setup | ||
|
||
Create `marmoset.conf` before using marmoset! See `Configuration` for details. | ||
Clone the repo, for example into /opt. Than copy the service file into the systemd directory and reload systemd to recognize the file: | ||
```bash | ||
cd /opt | ||
git clone https://github.com/virtapi/marmoset.git | ||
cd marmoset | ||
cp ext/marmoset.service /etc/systemd/system/ | ||
systemctl daemon-reload | ||
``` | ||
Copy the `marmoset.conf.example` to `marmoset.conf` and adjust the settings to your needs. | ||
Checkout the Comments in the file our our [Configuration](#configuration) section. | ||
|
||
Now we need to setup a virtualenv and install the requirement python packages (remove libvirt from the requirements.txt and `pkg-config libvirt gcc` from the list of packages to install if you don't want to manage VMs with marmoset): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "and install the required python packages" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
```bash | ||
pacman -Syu python-virtualenv pkg-config libvirt gcc | ||
virtualenv prod | ||
source prod/bin/activate | ||
pip install --upgrade pip | ||
pip install -r requirements.txt | ||
``` | ||
|
||
--- | ||
|
||
## Requirements | ||
|
@@ -128,9 +145,11 @@ Start it like this: | |
|
||
$ ./marmoset.py server | ||
|
||
Or with gunicorn: | ||
Or use our systemd service: | ||
|
||
$ systemctl start marmoset | ||
|
||
$ gunicorn marmoset.app:app | ||
A third solution is to use nginx + uwsgi to power the app. This is the recommended way if you expect a high amount of requests. | ||
|
||
### HTTP PXE | ||
|
||
|
@@ -479,6 +498,58 @@ Errormessage if you want to delete or list a nonexistent entry: | |
} | ||
``` | ||
|
||
### HTTP DHCP | ||
This endpoint allows us the throw static IP/MAC combinations into an openldap database. This database is connected to an isc-dhcpd. We can identify an object by its IP or MAC address. | ||
|
||
#### List Entries | ||
curl -u admin:secret http://localhost:5000/v1/dhcp | ||
```json | ||
[ | ||
{ | ||
"additional_statements": {}, | ||
"dhcp_hostname": "odin.fritz.box", | ||
"gateway": "option routers 192.168.10.1", | ||
"ip_address": "192.168.10.5", | ||
"mac": "00:00:00:00:00:00", | ||
"networkmask": "option subnet-mask 255.255.255.0" | ||
}, | ||
{ | ||
"additional_statements": {}, | ||
"dhcp_hostname": "odin.fritz.box", | ||
"gateway": "option routers 10.3.7.1", | ||
"ip_address": "10.3.7.41", | ||
"mac": "00:00:00:00:00:00", | ||
"networkmask": "option subnet-mask 255.255.255.0" | ||
} | ||
] | ||
``` | ||
|
||
#### List One Entry based on MAC | ||
curl -u admin:secret http://localhost:5000/v1/dhcp/mac/00:00:00:00:00:00 | ||
```json | ||
{ | ||
"additional_statements": {}, | ||
"dhcp_hostname": "odin.fritz.box", | ||
"gateway": "option routers 10.3.7.1", | ||
"ip_address": "10.3.7.41", | ||
"mac": "00:00:00:00:00:00", | ||
"networkmask": "option subnet-mask 255.255.255.0" | ||
} | ||
``` | ||
|
||
#### List one Entry based on IP | ||
curl -u admin:secret http://localhost:5000/v1/dhcp/ipv4/10.3.7.41 | ||
```json | ||
{ | ||
"additional_statements": {}, | ||
"dhcp_hostname": "odin.fritz.box", | ||
"gateway": "option routers 10.3.7.1", | ||
"ip_address": "10.3.7.41", | ||
"mac": "00:00:00:00:00:00", | ||
"networkmask": "option subnet-mask 255.255.255.0" | ||
} | ||
``` | ||
|
||
--- | ||
|
||
## Issues | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,8 @@ | |
[Modules] | ||
PXE: True | ||
VM: True | ||
INSTALLIMAGE: True | ||
Installimage: True | ||
DHCP: True | ||
|
||
[Webserver] | ||
# Settings for HTTP Basic Auth | ||
|
@@ -34,9 +35,13 @@ Network: | |
# storage name is given. | ||
Storage: | ||
|
||
# this gets used for storing PXE options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "this will be used for" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
[PXEConfig] | ||
ConfigDirectory: /srv/tftp/pxelinux.cfg/ | ||
|
||
# this gets used for storing installimage options | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "this will be used for" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
[Config] | ||
ConfigDirectory: /srv/tftp/config/ | ||
# The PXELabel section has no defaults, as its entries depend on | ||
# the PXE configuration. The syntax is `label: callbackmethod`. | ||
# If the entry doesn't need any callback, just let callbackmethod | ||
|
@@ -47,3 +52,13 @@ ConfigDirectory: /srv/tftp/pxelinux.cfg/ | |
#freebsd: createpwhashfile | ||
#openbsd: | ||
|
||
[DHCPConfig] | ||
# list of all statements that we allow | ||
# see https://github.com/virtapi/marmoset/issues/7#issuecomment-175262281 | ||
# and see https://github.com/virtapi/marmoset/issues/7#issuecomment-175275522 | ||
additional_statements = option domain-name-servers,option domain-name,max-lease-time,default-lease-time,option ntp-servers | ||
ldap_server = localhost | ||
ldap_port = 389 | ||
ldap_bind_dn = cn=root,dc=example,dc=com | ||
ldap_passwort = secret | ||
ldap_client_base_dn = dc=example,dc=com |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/python3 | ||
#!/usr/bin/env python3 | ||
|
||
import marmoset | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Clone the repository into a directory of your choice, /opt for example" , "then"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed