2

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) 私の状況 (Prudentia の失敗) を修正し、2) それが再び起こらないように助けてください。

4

3 に答える 3