下面是将值保存在寄存器变量中的代码:
IA, IB
运行I1, I2
后,它将得到以下结果:
- name: "Install Msi on the Server - {{item.app_name}}"
win_package:
path: d:\temp_deploy\{{servergroup_variable}}_{{release_variable}}.{{build_variable}}\{{ item.app_name }}_{{ item.app_expectedversion }}.msi
state: present
arguments: "INSTALLDIR={{ item.app_installPath }} SELECTEDREGION={{ environment_variable }} ALLUSERS=1 /L*V c:\\log\\Deployment-{{ item.app_name }}.log"
retries: 3
register: task_result
until: task_result.failed == true
when: (item.app_type == "webService") or
(item.app_type == "Service" )
ignore_errors: yes
register: msi_deploy_var
现在真正的问题开始了-当我尝试对msi_deploy_var
进行迭代时,然后按预期运行。
ok: [server1] => {
"msg": {
"changed": false,
"failed": false,
"reboot_required": false
}
}
ok: [server2] => {
"msg": {
"changed": true,
"failed": false,
"rc": 0,
"reboot_required": false
}
}
但是它总是跳过条件评估。
任何帮助将不胜感激。