当我尝试使用分子时,它找不到角色目录中的角色。
\n\n\xe2\x9d\xaf sudo molecule converge\n--> Test matrix\n\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 default\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 dependency\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 create\n \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 prepare\n \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 converge\n\n--> Scenario: \'default\'\n--> Action: \'dependency\'\nSkipping, missing the requirements file.\nSkipping, missing the requirements file.\n--> Scenario: \'default\'\n--> Action: \'create\'\nSkipping, instances already created.\n--> Scenario: \'default\'\n--> Action: \'prepare\'\nSkipping, prepare playbook not configured.\n--> Scenario: \'default\'\n--> Action: \'converge\'\n--> Sanity checks: \'docker\'\nERROR! the role \'curl\' was not found in /home/belluu/programming/Ansible-Posthog/molecule/default/roles:/root/.cache/molecule/Ansible-Posthog/default/roles:/home/belluu/programming:/root/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/home/belluu/programming/Ansible-Posthog/molecule/default\n\nThe error appears to be in \'/home/belluu/programming/Ansible-Posthog/molecule/default/converge.yml\': line 5, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n roles:\n - role: curl\n ^ here\nRun Code Online (Sandbox Code Playgroud)\n\n分子试图找到正确的目录,但没有成功。\n是否可以为他提供带有角色的目录路径?
\n小智 7
简单回答:是的
在您的 molecular.yml 文件中添加以下行env::
provisioner:
name: ansible
...
env:
ANSIBLE_ROLES_PATH: "../../roles"
Run Code Online (Sandbox Code Playgroud)
此外,您还可以将 Molecule 链接到其他“路径”:
provisioner:
name: ansible
...
env:
ANSIBLE_CONFIG: ../../ansible.cfg
inventory:
links:
group_vars: ../../inventory/group_vars
host_vars: ../../inventory/host_vars
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5465 次 |
| 最近记录: |