Prudentia 找不到我定义的框。我很确定盒子在那里。当我使用绝对路径时,它会抱怨$prudentia_dir
在 Ansible 中。
这是我的目录树:
deployment/
|-- Readme.md
|-- boxes
| |-- common_vars.yml
| |-- dev.yml
| |-- dev_vars.yml
| |-- enable_cd.yml
| |-- staging.yml
| `-- staging_vars.yml
`-- components
|-- api.yml
|-- base.yml
|-- client.yml
|-- files
| `-- ssh
| |-- id_rsa
| `-- id_rsa.pub
|-- mongo.yml
`-- templates
|-- api
| |-- logback.xml.j2
| `-- upstart.conf.j2
`-- client
`-- nginx.conf.j2
当我启动 Prudentia SSH 并尝试注册一个盒子时:
(Prudentia > Ssh) register
Specify the playbook path: deployment/boxes/staging.yml
25-06-2014 18:48:35.339 [root] ERROR: Box not added.
Traceback (most recent call last):
File "/Users/rob/tmp/prudentia/src/ssh.py", line 26, in register
hostname = self.fetch_box_hostname(playbook)
File "/Users/rob/tmp/prudentia/src/simple.py", line 202, in fetch_box_hostname
with open(playbook, 'r') as f:
IOError: [Errno 2] No such file or directory: 'deployment/boxes/staging.yml'
There was some problem while adding the box: [Errno 2] No such file or directory: 'boxes/staging.yml'
在对相对路径应该是什么不同的假设进行了几次尝试之后,我决定使用绝对路径。在该尝试中发生以下错误:
(Prudentia > Ssh) register
Specify the playbook path: /Users/rob/......./deployment/boxes/staging.yml
Specify the box name [default: acme-staging]:
Specify the address of the instance: poc01
Specify the remote user [default: rob]: pocuser
Specify the password for the remote user [default: ssh key]:
25-06-2014 18:50:07.654 [root] ERROR: Box not added.
Traceback (most recent call last):
File "/Users/rob/tmp/prudentia/src/ssh.py", line 33, in register
self.add_box(box)
File "/Users/rob/tmp/prudentia/src/simple.py", line 164, in add_box
self.load_tags(box)
File "/Users/rob/tmp/prudentia/src/simple.py", line 180, in load_tags
play = Play(playbook, playbook.playbook[0], dirname(b.playbook))
File "/Users/rob/tmp/prudentia/p-env/lib/python2.7/site-packages/ansible/playbook/play.py", line 152, in __init__
self._tasks = self._load_tasks(self._ds.get('tasks', []), load_vars)
File "/Users/rob/tmp/prudentia/p-env/lib/python2.7/site-packages/ansible/playbook/play.py", line 588, in _load_tasks
loaded = self._load_tasks(data, mv, default_vars, included_sudo_vars, list(included_additional_conditions), original_file=include_filename, role_name=new_role)
File "/Users/rob/tmp/prudentia/p-env/lib/python2.7/site-packages/ansible/playbook/play.py", line 583, in _load_tasks
data = utils.parse_yaml_from_file(include_filename, vault_password=self.vault_password)
File "/Users/rob/tmp/prudentia/p-env/lib/python2.7/site-packages/ansible/utils/__init__.py", line 551, in parse_yaml_from_file
raise errors.AnsibleError("file could not read: %s" % path)
AnsibleError: file could not read: /Users/rob/dev/...../components/$prudentia_dir/tasks/mongodb.yml
There was some problem while adding the box: file could not read: /Users/rob/...../deployment/components/$prudentia_dir/tasks/mongodb.yml
之后,Prudentia 退出并在每次尝试重新启动时都失败并出现相同的错误。
Prudentia 中似乎有一些关于它想如何使用的假设,我不明白。请帮助 1)解决我的情况(保诚失败)和 2)防止它再次发生。