You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在CentOS服务器运行Ansible Playbook安装FortiClient时遇错误求助

解决CentOS上安装FortiClient的Ansible Playbook错误

错误提示里的Unsupported parameters for (ansible.legacy.dnf) module: description已经把问题说透了——你在yum和systemd模块里误用了description参数,这两个模块根本不支持这个参数,只有yum_repository模块需要用description来定义仓库的描述信息。

修正后的Playbook

---
- name: Install FortiClient
  hosts: all
  become: yes

  tasks:
    - name: Set up Fortinet repository
      yum_repository:
        name: fortinet
        description: configure yum for forticlient
        baseurl: http://repo.fortinet.com/repo/centos/7/os/x86_64/fortinet.repo

    - name: Install FortiClient
      yum:
        name: forticlient
        state: present

    - name: Restart FortiClient service
      systemd:
        name: forticlient
        state: restarted

修正说明

  • 保留yum_repository任务里的description,这是该模块的合法参数,用来描述仓库用途
  • 删除yum任务里的description,yum模块只需要指定要安装的包名和状态即可
  • 删除systemd任务里的description,systemd模块只需要服务名称和操作状态

验证步骤

运行修正后的Playbook后,可以通过以下命令确认结果:

# 检查FortiClient是否安装成功
rpm -q forticlient
# 检查FortiClient服务状态
systemctl status forticlient

内容的提问来源于stack exchange,提问作者Alpha Lima

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 09:57:06