使用ansible在ec2实例上注册gitlab运行程序时,SSH连接失败



当我想用相同的ansible模块注册gitlab运行程序时,这是ansible-vvvv的输出:

fatal: [EC2-IP]: FAILED! => changed=false 
module_stderr: |-
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 31106
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 1
Shared connection to EC2-IP closed.
module_stdout: |-
Traceback (most recent call last):
File "/home/user/.ansible/tmp/ansible-tmp-1573211018.16-273297078504854/AnsiballZ_gitlab_runner.py", line 114, in <module>
_ansiballz_main()
File "/home/user/.ansible/tmp/ansible-tmp-1573211018.16-273297078504854/AnsiballZ_gitlab_runner.py", line 106, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/user/.ansible/tmp/ansible-tmp-1573211018.16-273297078504854/AnsiballZ_gitlab_runner.py", line 49, in invoke_module
imp.load_module('__main__', mod, module, MOD_DESC)
File "/usr/lib/python3.6/imp.py", line 235, in load_module
return load_source(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 170, in load_source
module = _exec(spec, sys.modules[name])
File "<frozen importlib._bootstrap>", line 618, in _exec
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/tmp/ansible_gitlab_runner_payload_igdyaz51/__main__.py", line 389, in <module>
File "/tmp/ansible_gitlab_runner_payload_igdyaz51/__main__.py", line 354, in main
TypeError: __init__() got an unexpected keyword argument 'email'
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1

这是剧本中失败的部分:

- name: Register runner
gitlab_runner:
url: https://git.myurl.com/
api_token: {{ correct_token }}
registration_token: "{{ runners_token.stdout }}"
description: instance
state: present
active: True
tag_list: ['tag1']
run_untagged: False
locked: False
register: configuration

api和注册令牌都是正确的,url也是正确的,通过调试进行检查。这个注册以前有效,但当我重新启动实例时,它失败了,我无法修复它,我尝试了另一个实例,这是相同的输出。

我还部署了存储库的所有密钥,所有其他任务都可以正常工作。

我还安装了所有的依赖项,比如我们,boto,botocore,boto3,python-gitlab。。。

我刚刚遇到了同样的问题,似乎是版本不兼容:

https://github.com/ansible/ansible/issues/65189

使用旧版本的python gitlab对我有效:

python-gitlab<1.13

最新更新