只有在Windows服务器上运行时,Ansible才不会提取任何工件

时间:2019-02-22 18:12:25

标签: ansible

尝试在Windows Server 2016计算机和ansible上安装Java不会获得任何工件信息,但是使用Java在Linux上安装Java完全可以正常工作...

在Linux机器上的输出:

ok: [127.0.0.1] => {"ansible_facts": {"artifact_url_list": ["https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz", "https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz"]}, "changed": false}

TASK [../roles/java : Show artifacts' urls found] ******************************
ok: [127.0.0.1] => {
    "artifact_url_list": [
        "https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz", 
        "https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-linux-x64.tar.gz"
    ]
}

针对Windows Server 2016计算机的输出:

TASK [../roles/java : Find all possible artifact urls] ***********************************************************************************************************************************************
task path: /Users/aaron.west/Workspace/hss-iaas/ansible-repo/roles/java/tasks/win_fetch/oracle-fallback.yml:24
ok: [10.3.16.114] => {
    "ansible_facts": {
        "artifact_url_list": []
    },
    "changed": false
}

TASK [../roles/java : Show artifacts' urls found] ****************************************************************************************************************************************************
task path: /Users/aaron.west/Workspace/hss-iaas/ansible-repo/roles/java/tasks/win_fetch/oracle-fallback.yml:35
ok: [10.3.16.114] => {
    "artifact_url_list": []
}

实际上抛出的错误是:

TASK [../roles/java : No artifact urls found] ********************************************************************************************************************************************************
task path: /Users/aaron.west/Workspace/hss-iaas/ansible-repo/roles/java/tasks/win_fetch/oracle-fallback.yml:39
fatal: [10.3.16.114]: FAILED! => {
    "changed": false,
    "msg": "No artifact urls found, check java_package, java_major_version, java_minor_version, java_arch variables"
}

并且在Windows上运行时,scrip [t不能正确提取工件的部分是:

- name: Find all possible artifact urls
  set_fact:
    artifact_url_list: >-
      {{ release_page['content'] |
          regex_findall('https?://download.oracle.com/otn-pub/java/.*/' +
                        java_package|string + '-(?:' + java_major_version|string +
                        'u' + minor|string + '-|' + java_major_version|string +
                        '.' + minor|string + '_)' +  os|string + '-' +
                        java_arch|string + '(?!-demos).*' + extension|string) | list }}
  register: artifact_url_fact

它正试图从https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html那里获取工件

关于这里可能出什么问题的任何想法?

0 个答案:

没有答案