mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-27 23:56:09 +00:00
pref: 基本完成部署
This commit is contained in:
@@ -2,6 +2,7 @@ import os
|
||||
import datetime
|
||||
import shutil
|
||||
|
||||
import yaml
|
||||
from django.utils import timezone
|
||||
from django.conf import settings
|
||||
|
||||
@@ -26,10 +27,20 @@ class DeployAppletHostManager:
|
||||
|
||||
def generate_playbook(self):
|
||||
playbook_src = os.path.join(CURRENT_DIR, 'playbook.yml')
|
||||
with open(playbook_src) as f:
|
||||
plays = yaml.safe_load(f)
|
||||
for play in plays:
|
||||
play['vars'].update(self.deployment.host.deploy_options)
|
||||
play['vars']['DownloadHost'] = settings.BASE_URL + '/download/'
|
||||
play['vars']['CORE_HOST'] = settings.BASE_URL
|
||||
play['vars']['BOOTSTRAP_TOKEN'] = settings.BOOSTRAP_TOKEN
|
||||
play['vars']['HOST_NAME'] = self.deployment.host.name
|
||||
|
||||
playbook_dir = os.path.join(self.run_dir, 'playbook')
|
||||
playbook_dst = os.path.join(playbook_dir, 'main.yml')
|
||||
os.makedirs(playbook_dir, exist_ok=True)
|
||||
shutil.copy(playbook_src, playbook_dst)
|
||||
with open(playbook_dst, 'w') as f:
|
||||
yaml.safe_dump(plays, f)
|
||||
return playbook_dst
|
||||
|
||||
def generate_inventory(self):
|
||||
|
@@ -2,13 +2,17 @@
|
||||
|
||||
- hosts: all
|
||||
vars:
|
||||
- DownloadHost: https://demo.jumpserver.org/download
|
||||
- RDS_Licensing: enabled
|
||||
- RDS_LicenseServer: 127.0.0.1
|
||||
- RDS_LicensingMode: 4
|
||||
- RDS_fSingleSessionPerUser: 1
|
||||
- RDS_MaxDisconnectionTime: 60000
|
||||
- RDS_RemoteAppLogoffTimeLimit: 0
|
||||
DownloadHost: https://demo.jumpserver.org/download
|
||||
Initial: 0
|
||||
HOST_NAME: test
|
||||
CORE_HOST: https://demo.jumpserver.org
|
||||
BOOTSTRAP_TOKEN: PleaseChangeMe
|
||||
RDS_Licensing: enabled
|
||||
RDS_LicenseServer: 127.0.0.1
|
||||
RDS_LicensingMode: 4
|
||||
RDS_fSingleSessionPerUser: 1
|
||||
RDS_MaxDisconnectionTime: 60000
|
||||
RDS_RemoteAppLogoffTimeLimit: 0
|
||||
|
||||
tasks:
|
||||
- name: Install RDS-Licensing (RDS)
|
||||
@@ -136,3 +140,12 @@
|
||||
state: present
|
||||
arguments:
|
||||
- /quiet
|
||||
|
||||
- name: Generate component config
|
||||
ansible.windows.win_shell: >
|
||||
echo "Todo: Set config"
|
||||
|
||||
- name: Sync all remote applets
|
||||
ansible.windows.win_shell: >
|
||||
echo "TODO: Sync all remote applets"
|
||||
when: Initial
|
||||
|
Reference in New Issue
Block a user