Ansible中缺少jenkins_configure_proxy角色

时间:2017-08-17 12:49:04

标签: ansible

我有Ansible 2.4.0。我正在尝试根据Ansible Jenkins DevOps Roles documentation配置Jenkins代理:

- hosts: master
  roles:
    - jenkins_configure_proxy:
      jenkins_home: "{{ jenkins_home }}"
      proxy_host: "{{ proxy_host }}"
      proxy_port: "{{ proxy_port }}"
      become: true
      environment: "{{proxy_env}}"

当我尝试执行ansible_playbook时,我得到:

ERROR!角色定义必须包含角色名称

The error appears to have been in '/Users/me/projects/jenkins/jenkins.yml': line 10, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  roles:
    - jenkins_configure_proxy:
      ^ here

这很奇怪,因为像jenkins_plugin这样的其他角色工作正常。

我做错了什么?

1 个答案:

答案 0 :(得分:1)

您使用不带参数的角色语法来应用带参数的角色,请参阅示例:

time.time()