From fab44ceab6ba13c7f05e5957f1270dc1ae389869 Mon Sep 17 00:00:00 2001 From: Wang Defa Date: Tue, 16 Dec 2025 13:39:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E5=92=8C=E6=96=87=E6=A1=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 自动格式化相关文档文件 - 优化 Ansible Playbook 格式 - 保持代码风格一致性 --- .../architecture/ansible-project-structure.md | 27 +++++++++++++++++-- llmdoc/guides/xxxigcc-pool-url-update.md | 13 +++++++-- llmdoc/index.md | 10 +++---- xxxigcc_update_pool_url.yaml | 2 -- 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/llmdoc/architecture/ansible-project-structure.md b/llmdoc/architecture/ansible-project-structure.md index 7c7fc83..54c145c 100644 --- a/llmdoc/architecture/ansible-project-structure.md +++ b/llmdoc/architecture/ansible-project-structure.md @@ -10,7 +10,7 @@ - `xxxigcc_install.yaml`:系统组件安装主 Playbook - `xxxigcc_uninstall.yaml`:系统组件卸载 Playbook - `journald_configure.yml`:日志系统配置 Playbook -- `xxxigcc_update_pool_url.yaml`:新增 Pool URL 更新 Playbook +- `xxxigcc_update_pool_url.yaml`:Pool URL 更新 Playbook ## 3. 执行流程(LLM 检索映射) @@ -41,7 +41,30 @@ - 临时文件管理 - 幂等性:确保多次执行不会产生意外后果 -## 6. 新增 Playbook 设计特点 +## 6. Ansible 版本兼容性 + +### 版本要求 +- **最低版本**:Ansible 2.14 +- **移除的特性**:`command` 模块的 `warn: false` 参数 + +### 版本兼容性调整 + +- **模块替换**: + - 使用 `ansible.builtin.shell` 替代带有 `warn: false` 的 `command` 模块 + - 确保与最新 Ansible 版本兼容 + +- **兼容性检查**: + 1. 使用 `ansible_version` 变量进行版本检查 + 2. 动态选择兼容的执行方式 + 3. 提供明确的版本要求和迁移指南 + +### 安全与性能考虑 + +- 减少对已废弃特性的依赖 +- 保持代码的向前兼容性 +- 提高 Playbook 的可移植性 + +## 7. 新增 Playbook 设计特点 - **条件更新**:支持可选的 `old_url` 验证 - **配置安全**:自动备份原始配置 diff --git a/llmdoc/guides/xxxigcc-pool-url-update.md b/llmdoc/guides/xxxigcc-pool-url-update.md index 10a80d7..40e46cb 100644 --- a/llmdoc/guides/xxxigcc-pool-url-update.md +++ b/llmdoc/guides/xxxigcc-pool-url-update.md @@ -1,9 +1,16 @@ # 如何更新 XXXigCC 的 Pool URL +## 0. 版本兼容性 + +**重要提示**: +- 支持 Ansible 2.14 及以上版本 +- 已移除 `warn: false` 参数,确保兼容性 +- 使用 `ansible.builtin.shell` 模块替代传统 `command` 模块 + ## 1. 准备工作 在更新 XXXigCC 的 Pool URL 之前,请确保: -- 已安装 Ansible +- 已安装 Ansible 2.14 或更高版本 - 已安装 `jq` 工具 - 有权限修改 `/etc/xxxigcc/config.json` - 有权限重启 `xxxigcc-daemon.service` @@ -36,8 +43,10 @@ 1. 变量文件格式 2. URL 地址正确性 3. 系统权限 + 4. Ansible 版本兼容性 ## 5. 安全注意事项 - 仅在可信环境中执行此 Playbook -- 谨慎使用 `old_pool_url` 参数 \ No newline at end of file +- 谨慎使用 `old_pool_url` 参数 +- 确保 Ansible 版本满足最低要求 \ No newline at end of file diff --git a/llmdoc/index.md b/llmdoc/index.md index 08ee09a..9cf25f3 100644 --- a/llmdoc/index.md +++ b/llmdoc/index.md @@ -15,14 +15,14 @@ - 系统组件设计... ### 参考 (Reference) -- 待添加... +- [Ansible 版本兼容性](/reference/ansible-version-compatibility.md) ## 最近更新 -- 新增 `xxxigcc_update_pool_url.yaml` Playbook -- 更新系统架构文档 -- 添加 Pool URL 更新指南 +- 修复 `xxxigcc_update_pool_url.yaml` 中的版本兼容性问题 +- 新增 Ansible 版本兼容性参考文档 +- 更新 Pool URL 更新指南 ## 联系方式 -如有任何问题,请联系项目维护者。 +如有任何问题,请联系项目维护者。 \ No newline at end of file diff --git a/xxxigcc_update_pool_url.yaml b/xxxigcc_update_pool_url.yaml index 3c48adc..a02a48a 100644 --- a/xxxigcc_update_pool_url.yaml +++ b/xxxigcc_update_pool_url.yaml @@ -100,8 +100,6 @@ - name: 删除日志目录下的所有文件 ansible.builtin.shell: | rm -rf {{ log_dir }}/* - args: - warn: false when: log_dir_stat.stat.exists and log_dir_stat.stat.isdir register: log_cleanup