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/
相关推荐
m4Rk_1 小时前
【论文阅读】Agent 记忆机制(86):Skill-Pro——用 Non-Parametric PPO 将交互经验演化为可复用技能
论文阅读·人工智能·学习·开源·github
别动我齐刘海1 小时前
简历技术栈全面复习——UDP / TCP / CAN / ZMQ / Protobuf 通信工程
网络·c++·python·tcp/ip·机器学习·udp·github
data analyse 4562 小时前
埋点工具的私有化部署成本高吗?
前端·数据分析·github
miofly5 小时前
GitHub 今日推荐|company-brain:在 Slack 里给团队装个会主动干活的 AI
开源·github
用户383170370549 小时前
PowerFS 是用 Rust 写的、面向 AI/GPU 训练的下一代分布式文件系统
github
钮钴禄·爱因斯晨9 小时前
用iPhone操作Codex CLI:ToDesk远程终端让我接回了开发环境
github
miofly11 小时前
GitHub 日榜趋势速报 | 2026-10-01
开源·github
阿里嘎多学长12 小时前
2026-09-30 GitHub 热点项目精选
开发语言·程序员·github·代码托管
miofly1 天前
GitHub 今日推荐|DiPlay:让 iPhone CarPlay 直连 BYD 车机,无需硬件适配器
开源·github
行者-全栈开发1 天前
【前端/JS框架】CVE-2026-3854:GitHub Enterprise Server X-Stat注入XSS漏洞深度剖析与紧急修复指南
前端·javascript·github