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

Ansible剧本在SUSE系统上跳过Apache安装的问题求助

Ansible剧本在SUSE系统上跳过Apache安装的问题求助

大家好,我写了一个简单的Ansible剧本,想要在CentOS和SUSE系统上安装Apache。目前这个剧本在CentOS上运行完全正常,但在SUSE上会直接跳过Apache的安装步骤,而且没有任何报错信息,我实在搞不清楚问题出在哪,想请大家帮忙看看。

下面是我的剧本内容:

---
name: To install Apache on CentOS and Suse
hosts: all
gather_facts: True
become: yes
become_user: root

tasks:
  - name: Installing Apache on CentOS or RedHat
    yum:
      name: httpd
      state: latest
    when: ansible_facts['distribution']=="CentOS" or ansible_facts['distribution']=="Red Hat Enterprise Linux"

  - name: Installing Apache on Suse
    zypper:
      name: apache2
      state: latest
    when: ansible_facts['distribution']=="Suse" or ansible_facts['distribution']=="SLES"

备注:内容来源于stack exchange,提问作者emp0001

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.23 07:48:10