故障排除
运行器报错 404
如何修复
localhost 的 Gathering Facts 问题
该问题可能出现在通过 Snap 或 Docker 安装的 Semaphore UI 上。
4:10:16 PM
TASK [Gathering Facts] *********************************************************
4:10:17 PM
fatal: [localhost]: FAILED! => changed=false
原因
关于 Ansible 中 localhost 的使用,请阅读这篇文章:Implicit 'localhost'。
Ansible 尝试在本地收集 facts,但 Ansible 运行在一个受限的隔离容器中,不允许这样做。
如何修复
有两种方法:
- 禁用 facts 收集:
- hosts: localhost
gather_facts: False
roles:
- ...
- 显式将连接类型设置为 ssh:
[localhost]
127.0.0.1 ansible_connection=ssh ansible_ssh_user=your_localhost_user
panic: pq: SSL is not enabled on the server
这表示您的 Postgres 未启用 SSL。
如何修复
在配置文件中添加 sslmode=disable 选项:
"postgres": {
"host": "localhost",
"user": "postgres",
"pass": "pwd",
"name": "semaphore",
"options": {
"sslmode": "disable"
}
},