【发布时间】:2020-03-12 09:07:00
【问题描述】:
我有这个任务:
---
- name: Deploy & Register the Gitlab runners
command: >
docker run
--name runner{{item}}
-d
-e CI_SERVER_URL="{{CI_SERVER_URL}}"
-e REGISTRATION_TOKEN="{{REGISTRATION_TOKEN}}"
-e DOCKER_PRIVILEGED=true
-e REGISTER_LOCKED=false
-v /var/run/docker.sock:/var/run/docker.sock
--restart=always
flakm/gitlab-runner-auto-register:latest
with_items:
- [ 1 , 2 ]
有效。但我希望能够自定义跑步者的数量。
所以,我想要这样的东西
with_items:
- [ 1 , {{ NUMBER_ΟF_RUNNERS }} ]
但这不起作用。
我从 Ansible 文档中阅读了 this,但找不到任何内容。
【问题讨论】: