【问题标题】:Ansible win_package notifies change but does not installAnsible win_package 通知更改但不安装
【发布时间】:2021-09-12 16:12:26
【问题描述】:

我正在使用 ansible > win_package 方法安装visual studio 2013,2015,2017 和2019。对于VS2017 和2019 安装,win_package 通知更改但服务器上没有更改。该任务的运行时间不到 1 分钟,而实际安装需要 5-10 分钟。这可能是什么原因?

另外,这个 github 线程也有类似的问题,但没有解决方案。 https://github.com/ansible/ansible/issues/51385

VS INSTALLER TASK

    - name: VS Installer
      win_package:
        path: 'D:\Software\VisualStudio\ansible\install\{{ item.year }}\{{ item.installer_name }}'
        creates_path: "{{ item.create_path }}"
        state: present
        arguments: "{{ item.args }}"
      loop: "{{ visualstudio }}"
VARIABLES FILE

  - year: "2017"
    eng_serv_path: network file share
    create_path: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe'
    installer_name: vs_enterprise.exe
    product_key: product key
    version: enterprise
    args: '--in D:\Software\VisualStudio\ansible\install\2017\Response_vs2017.json'

  - year: "2019"
    eng_serv_path: network file share
    create_path: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe'
    installer_name: vs_enterprise__25978676.1624374836.exe
    product_key: product key
    version: enterprise
    args: '--in D:\Software\VisualStudio\ansible\install\2019\Response_vs2019.json'
OUTPUT EXAMPLE

changed: [IP address] => (item={u'eng_serv_path': u'network file share', u'version': u'enterprise', u'installer_name': u'vs_enterprise__25978676.1624374836.exe', u'create_path': u'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\devenv.exe', u'year': u'2019', u'args': u'--in D:\\Software\\VisualStudio\\ansible\\install\\2019\\Response_vs2019.json', u'product_key': u'product key'}) => {
    "ansible_loop_var": "item",
    "changed": true,
    "item": {
        "args": "--in D:\\Software\\VisualStudio\\ansible\\install\\2019\\Response_vs2019.json",
        "create_path": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\devenv.exe",
        "eng_serv_path": "network file share",
        "installer_name": "vs_enterprise__25978676.1624374836.exe",
        "product_key": "product key",
        "version": "enterprise",
        "year": "2019"
    },
    "rc": 0,
    "reboot_required": false
}



【问题讨论】:

    标签: ansible yaml ansible-2.x


    【解决方案1】:

    我找到的解决方案不是使用响应文件,而是直接传递参数并且它有效

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-06
      • 1970-01-01
      • 2013-08-16
      • 1970-01-01
      • 1970-01-01
      • 2016-08-24
      • 2021-11-11
      相关资源
      最近更新 更多