Skip to content

execute inspec

Russell Seymour edited this page Oct 16, 2018 · 4 revisions

Execute InSpec on machines in a Deployment Group

Settings

Setting Group Required Default Value Description
Display name yes Execute InSpec (Chef) Set the display name for this task
Profile path yes $(System.ArtifactsDirectory)/cookbooks Set a path to the InSpec profiles you wish to run
Arguments no This allows more options to be passed to the InSpec command, for example a target
InSpec Results File Advanced No inspec.out File that the results of the InSpec tests should be stored

Execute InSpec Task Options

Information

This task will perform the equivalent of executing inspec . on the target machine and given a directory of InSpec profiles to run. We recommend that this is performed via adding the task to a Deployment Group phase.

Output is returned in Junit-compatible format to a file inspec.out in the same location as the profiles. This file can be imported using the built-in Azure DevOps Test Results publishing task.

This task now has the option to specify more options using the 'Arguments' input field. Additionally the task will check the version of InSpec that is being run and set the output options for the results file accordingly. For example in InSpec 2.0 the option to save results to a file was changed to --reporter. The task will always generate a JUnit results file.

Note: You will need to ensure the tests from your build are copied to your drop location in order to use them in the Release phase.

  • On Windows, InSpec will be executed from c:\opscode\inspec\bin\inspec.bat and if not found an attempt will be made to install it.
  • On Linux, InSpec will be executed from /usr/bin/inspec and if not found an attempt will be made to install it.

Further information on InSpec

For further information on InSpec, visit https://www.inspec.io/docs/