0

我需要使用 Docker Image httpd 测试我的应用程序,当我将其添加到当前的 .kitchen.yaml 文件时,它会失败并出现错误:


root@ip-172-31-1-22:~/test1# kitchen test
-----> Starting Kitchen (v1.23.2)
-----> Cleaning up any prior instances of <default-httpd>
-----> Destroying <default-httpd>...
       Finished destroying <default-httpd> (0m0.00s).
-----> Testing <default-httpd>
-----> Creating <default-httpd>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Create failed on instance <default-httpd>.  Please see       .kitchen/logs/default-httpd.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

root@ip-172-31-1-22:~/test1#


我的厨房.yaml 文件

driver:
  name: docker
  use_sudo: false
  #image: httpd

provisioner:
  hosts: aws
  name: ansible_playbook
  #roles_path: roles
  require_ansible_repo: true
  ansible_verbose: true
  ansible_version: latest
  require_chef_for_busser: false
  playbook: default.yml

verifier:
 name: inspec

platforms:
  #- name: ubuntu
  - name: httpd
    driver_config:
      run_command: /bin/systemd
      privileged: true
provision_command:
        - systemctl enable sshd.service

suites:
  - name: default
    verifier:
      inspec_tests:
        - path: /root/kitchen/test/integration/default/test.rb

用例:

1> Deoloy a Httpd base container 
2> Use Ansible Play book to move a index.html file
3> Use ansible tos tart and stop the services 
4> Run an inspec to check if the tests are successful

使用 kitchen.yaml 部署 httpd 并测试用例的正确程序是什么。

1> Is this the correct Approch??
2> Should i simply write a Ansible playbook to install httpd and then move my html files.
3> If the Answer to Q2 is yes, then doesn't it defeat the purpose of having an httpd Container already
4

1 回答 1

0

既然您使用的是ansible,那么使用docker模块来部署httpd

于 2018-12-05T20:50:12.447 回答