2017-04-24 6 views
0

여기 내 kitchen.ymlkitchen.yml에 역할을 추가 할 수 있습니까?

--- 
driver: 
    name: vagrant 
    network: 
    - ["private_network", {ip: "192.168.35.35"}] 

provisioner: 
    name: chef_zero 
    # You may wish to disable always updating cookbooks in CI or other testing environments. 
    # For example: 
    # always_update_cookbooks: <%= !ENV['CI'] %> 
    always_update_cookbooks: true 
    roles_path: test/integration/roles/ 

verifier: 
    name: inspec 

platforms: 
    - name: ubuntu-14.04 

suites: 
    - name: default 
    run_list: 
     - role[tomcat_role] 
    verifier: 
     inspec_tests: 
     - test/smoke/default 
    attributes: 

내가 요리사 서버에 분명히 존재하지만 여전히 나는이 오류가 무엇입니까 다음과 같은 오류를

[2017-04-24T10:39:02+00:00] ERROR: Role tomcat_role (included by 'top lev 
el') is in the runlist but does not exist. Skipping expand. 

     ========================================================================= 
======= 
     Error expanding the run_list: 
     ========================================================================= 
======= 

     Missing Role(s) in Run List: 
     ---------------------------- 
     * tomcat_role included by 'top level' 

역할을 점점 계속. 우리는 kitchen.yml의 실행 목록 속성에서 역할을 사용할 수 있습니까?

+0

요리사 서버는 로컬 공급자를 사용하기 때문에 중요하지 않지만 테스트 역할을 입력 한 경로는 무엇입니까? – coderanger

+0

json 파일 (tomcat.json)은 테스트/통합/역할 폴더'roles_path : test/integration/roles /'에 있습니다. – aaj

+0

json 파일을 보관해야하는 특정 위치가 있습니까? – aaj

답변

1

설명에서 언급했듯이 역할의 파일 이름은 name 필드와 일치해야하며 실행 목록의 role[name] 문자열과 일치해야합니다. 그 중 세 가지가 모두 정렬되어 있는지 확인하고 모두 설정해야합니다.

+0

시도했습니다. 내 json 파일 이름은'tomcatrole'이고, json의 이름 필드도'tomcatrole'이고 kitchen.yml도'tomcatrole'이 있습니다. run_list : - "role [tomcatrole]" – aaj

0

좋아, 문제는 roles_paths입니다. 나는 이것을 role_path으로 바꿨고 모든 것이 잘 작동했다.

+0

이것이 효과가 있다면 그것은 대답으로. – Pred