我希望只能在与“server_1”或“server_2”不匹配的主机上运行任务。 在半伪代码: - name: Set localtime
file: src=/usr/share/zoneinfo/UTC
dest=/etc/localtime
state=link
when: only when hostname is NOT "server_1"
我使用的是2.4.0,并根据检查模式尝试使用ignore_errors和with_items。 根据docs about check_mode,您可以根据是否在检查模式下运行,来定义ignore_errors。如果没有with_items指令,这很有效,但对于这两个元素都会忽略失败。 工作示例不with_items: # test_i.yml
- name: test without array
我收到以下错误,当我运行ansible剧本: Do you have azure>=2.0.0 installed? Try pip install 'azure>=2.0.0' --upgrade - No module named containerservice Ansible版本: ansible 2.4.0.0
config file = /var/www/Ansible/ansibl
我正在学习从ansible-beginner到micheal堆的pro。看起来windows不支持ansible。该书建议改为从虚拟机运行。我使用vagrant启动了一个VMbox,它上面有ubuntu/trusty64。我成功地运行了我的剧本。然而,我在创造星系角色时遇到了一个问题。 我找不到在Windows上创建/初始化角色的方法。我依稀从这个问题How to automatically in