From de7d7b41c05f591dae9c4519ca87e4fd1c51bb24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 24 Oct 2023 08:46:17 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=9B=B4=E6=96=B0=20tinker=20python=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deploy_applet_host/playbook.yml | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/apps/terminal/automations/deploy_applet_host/playbook.yml b/apps/terminal/automations/deploy_applet_host/playbook.yml index cd9bc655e..7af4cf2a9 100644 --- a/apps/terminal/automations/deploy_applet_host/playbook.yml +++ b/apps/terminal/automations/deploy_applet_host/playbook.yml @@ -65,16 +65,15 @@ - '%USERPROFILE%\AppData\Local\Programs\Tinker\' scope: user - - name: Download python-3.10.11 + - name: Download python-3.11.6 ansible.windows.win_get_url: - url: "{{ APPLET_DOWNLOAD_HOST }}/download/applets/python-3.10.11-amd64.exe" - dest: "{{ ansible_env.TEMP }}\\python-3.10.11-amd64.exe" + url: "{{ APPLET_DOWNLOAD_HOST }}/download/applets/python-3.11.6-amd64.exe" + dest: "{{ ansible_env.TEMP }}\\python-3.11.6-amd64.exe" validate_certs: "{{ not IGNORE_VERIFY_CERTS }}" - - name: Install the python-3.10.11 + - name: Install the python-3.11.6 ansible.windows.win_package: - path: "{{ ansible_env.TEMP }}\\python-3.10.11-amd64.exe" - product_id: '{371d0d73-d418-4ffe-b280-58c3e7987525}' + path: "{{ ansible_env.TEMP }}\\python-3.11.6-amd64.exe" arguments: - /quiet - InstallAllUsers=1 @@ -157,16 +156,36 @@ script: | pip install -r '{{ ansible_env.TEMP }}\pip_packages\pip_packages\requirements.txt' --no-index --find-links='{{ ansible_env.TEMP }}\pip_packages\pip_packages' + - name: Stop chromedriver before install (jumpserver) + ansible.windows.win_powershell: + script: | + if (Get-Process -Name 'chromedriver' -ErrorAction SilentlyContinue) { + TASKKILL /F /IM chromedriver.exe /T + } + else { + $Ansible.Changed = $false + } + - name: Download chromedriver (Chrome) ansible.windows.win_get_url: url: "{{ APPLET_DOWNLOAD_HOST }}/download/applets/chromedriver_win32.zip" - dest: "{{ ansible_env.TEMP }}\\chromedriver_win32.zip" + dest: "{{ ansible_env.TEMP }}\\chromedriver-win32.zip" validate_certs: "{{ not IGNORE_VERIFY_CERTS }}" - name: Unzip chromedriver (Chrome) community.windows.win_unzip: - src: "{{ ansible_env.TEMP }}\\chromedriver_win32.zip" - dest: C:\Program Files\JumpServer\drivers\chromedriver_win32 + src: "{{ ansible_env.TEMP }}\\chromedriver-win32.zip" + dest: C:\Program Files\JumpServer\drivers\chromedriver-win32 + + - name: Stop Chrome before install (jumpserver) + ansible.windows.win_powershell: + script: | + if (Get-Process -Name 'chrome' -ErrorAction SilentlyContinue) { + TASKKILL /F /IM chrome.exe /T + } + else { + $Ansible.Changed = $false + } - name: Download Chrome zip package (Chrome) ansible.windows.win_get_url: @@ -191,7 +210,7 @@ ansible.windows.win_path: elements: - 'C:\Program Files\JumpServer\applications\Chrome\Application' - - 'C:\Program Files\JumpServer\drivers\chromedriver_win32' + - 'C:\Program Files\JumpServer\drivers\chromedriver-win32' - name: Set Chrome variables disable Google Api (Chrome) ansible.windows.win_environment: