forked from uncloud/uncloud
update to work on different computer
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
913e992a48
commit
938f0a3390
7 changed files with 139 additions and 88 deletions
|
|
@ -0,0 +1,44 @@
|
|||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
from opennebula.models import VM as VMModel
|
||||
from uncloud_vm.models import VMHost, VMProduct, VMNetworkCard, VMDiskImageProduct, VMDiskProduct, VMCluster
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
wireguard_template="""
|
||||
|
||||
[Interface]
|
||||
ListenPort = 51820
|
||||
PrivateKey = {privatekey}
|
||||
|
||||
# Nico, 2019-01-23, Switzerland
|
||||
#[Peer]
|
||||
#PublicKey = kL1S/Ipq6NkFf1MAsNRou4b9VoUsnnb4ZxgiBrH0zA8=
|
||||
#AllowedIPs = 2a0a:e5c1:101::/48
|
||||
"""
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'General uncloud commands'
|
||||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument('--hostname', action='store_true', help='Name of this VPN Host',
|
||||
required=True)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
# for net
|
||||
if options['bootstrap']:
|
||||
self.bootstrap()
|
||||
|
||||
self.create_vpn_config(options['hostname'])
|
||||
|
||||
def create_vpn_config(self, hostname):
|
||||
for pool in VPNPool.objects.filter(vpn_hostname
|
||||
default_cluster = VPNNetwork.objects.get_or_create(name="default")
|
||||
# local_host =
|
||||
Loading…
Add table
Add a link
Reference in a new issue