ansible - 需要 ansible 库存文件详细信息
问题描述
有人可以帮我编写 ansible 库存文件以连接到 bitbucket - 克隆文件并放入 ansible 机器。
剧本
---
- hosts: bitbucketURL
tasks:
- git:
repo: https://p-bitbucket.com:5999/projects/VIT/repos/sample-playbooks/browse/hello.txt
dest: /home/xxx/demo/output/
库存文件
[bitbucketURL]
p-bitbucket.com:5999
[bitbucketURL:vars]
ansible_connection=winrm
ansible_user=xxx
ansible_pass=<passwd>
使用此剧本和库存文件时出现错误
-bash-4.2$ ansible-playbook -i inv demo_draft1.yml
PLAY [bitbucketURL] *****************************************************************************************************************************************
TASK [Gathering Facts] **************************************************************************************************************************************
fatal: [p-bitbucket.nl.eu.abnamro.com]: UNREACHABLE! => {"changed": false, "msg": "ssl: auth method ssl requires a password", "unreachable": true}
to retry, use: --limit @/home/c55016a/demo/demo_draft1.retry
PLAY RECAP **************************************************************************************************************************************************
p-bitbucket.nl.eu.abnamro.com : ok=0 changed=0 unreachable=1 failed=0
请帮我用正确的参数编写一个正确的库存文件
解决方案
您根本不需要库存。您需要做的就是将播放设置为执行localhost
:
---
- hosts: localhost
connection: local
gather_facts: false
tasks:
- git:
repo: https://p-bitbucket.com:5999/projects/VIT/repos/sample-playbooks/browse/hello.txt
dest: /home/xxx/demo/output/
也就是说,URL 应该指向 Git 存储库,而不是单个文件(如果hello.txt
是单个文件)。
推荐阅读
- django - 在 centos 中使用 postgrsql 迁移 Kiwi 时出错
- java - @Scope("singleton") 在 Spring Boot 应用程序中具有线程 ID
- makefile - nmake : NMAKE : 致命错误 U1073: 不知道如何制作 '"C:/Program Files (x86)/Git/nologo"'
- kdb - 在 q kdb 中使用 select/fby 优化查询两次
- android - Android Coroutine MVP junit 测试代码失败
- xslt - 在 XSLT 中标记除引号括起来的所有值
- c# - 每次单击“注册”按钮时如何用表单信息填充列表框(无 BD)
- docker - 如何在 python docker 中安装 p7zip-full
- python - 如果您在购买 twilio 号码时未捕获它,请稍后获取 twilio 电话号码 SID
- codeigniter - 如何在 CI 中执行 cronjob .. 调用特定控制器自动调用那些发送电子邮件