wls 下使用ubuntu 安装ansible 上传jar包并重启服务

wsl安装 ubuntu 并导出到e盘

wsl --import Ubuntu-22.04 E:\WSL\ubuntu E:\WSL\Ubuntu-22.04.tar --version 2

wsl --export Ubuntu-22.04 E:\WSL\Ubuntu-22.04.tar

在ubuntu下建立客户端和服务器互信,使用

客户端通过ssh服务生成密钥,把公钥复制到服务器上,可以免密登录

复制代码
root@DESKTOP-9ALD7L2:~# cat /etc/ansible/deploy.yml
---
- name:  编译|部署jar包到服务器 | 重启服务
  hosts: web
  tasks:
    - name: 复制jar包到web服务器
      copy:
        src: "{{item }}"
        dest: /root/lechi-web-admin/lib/
      with_items:
        - /mnt/d/lechi-web/lechi-web-admin/target/lechi-web-admin/lechi-web-admin/lib/lechi-web-admin-1.0.0.jar
        - /mnt/d/lechi-web/lechi-web-admin/target/lechi-web-admin/lechi-web-admin/lib/lechi-web-system-1.0.0.jar
        - /mnt/d/lechi-web/lechi-web-admin/target/lechi-web-admin/lechi-web-admin/lib/lechi-iot-netty-1.0.0.jar
        - /mnt/d/lechi-web/lechi-web-admin/target/lechi-web-admin/lechi-web-admin/lib/lechi-web-common-1.0.0.jar
        - /mnt/d/lechi-web/lechi-web-admin/target/lechi-web-admin/lechi-web-admin/lib/lechi-web-framework-1.0.0.jar
    - name: 重启服务
      shell:
        cmd: "./jfinal.sh restart"
        chdir: /root/lechi-web-admin/
相关推荐
badhope4 小时前
AI Skill 技术全景解析——从“聊天机器人”到“全能战神”的进化之路
架构·github
徐小夕21 小时前
我们用1万行Vue3代码,做了款开源AI PPT项目
github
苏同学1 天前
LangGraph 实战:从零实现多工具协作的可追溯文档问答 Agent
github
逛逛GitHub1 天前
给 OpenClaw 小龙虾🦞搞个像素办公室,这个 GitHub 项目有趣啊。
github
doup智能AI1 天前
数据分析师:报表自动生成与洞察——AI 员工系列 Vol.4
github
答案answer1 天前
Three.js3D编辑器必备的相机视图插件
开源·github·three.js
RickeyBoy2 天前
Git Worktree / Worktrunk:并行 AI 开发工作流实战
github·vibecoding
逛逛GitHub2 天前
55 个 AI Agent 组成虚拟公司开源,2 天就 1 万星
github
Tapir2 天前
被 Karpathy 下场推荐的 NanoClaw 是什么来头
前端·后端·github
ShingingSky2 天前
用 Claude Skill 改造 AgentTeams:我实现了 AI 协作的质变
github