Skip to content

Instantly share code, notes, and snippets.

powershell_script 'Install IIS' do
code 'Add-WindowsFeature Web-Server'
guard_interpreter :powershell_script
not_if "(Get-WindowsFeature -Name Web-Server).Installed"
end
---
driver:
name: vsphere
driver_options:
host: '127.0.0.1'
user: '[email protected]'
password: 'passssssworddddd'
insecure: true
machine_options:
start_timeout: 600
{
"name": "development",
"description": "The master development branch",
"cookbook_versions": {
"nginx": "<= 1.1.0",
"apt": "= 0.0.1"
},
"json_class": "Cheff:Environment",
"chef_type": "environment",
"default_attributes": {
{
"name": "client",
"description": "Temporary role for chef-client override",
"chef_type": "role",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
"chef-client": {
"config": {
inspec compliance login_automate https://MYAUTOMATE-URL.COM --user USERNAME --ent MYENTERPRISE --usertoken MYTOKEN --insecure
Token can be gathered from - https://YOUR_AUTOMATE_HOST/e/YOUR_AUTOMATE_ENTERPRISE/#/dashboard?token
Once succesful try a list
inspec compliance profiles
Positive response should be no avalible profiles
In Powershell/Command Line/Mac Terminal type out
echo $HOME
In that home directory create a folder called .berkshelf
In the .berkshelf directory create a file called config.json
Inside config.json
{
"name": "audit",
"description": "Windows Scanning",
"chef_type": "role",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
"audit": {
"collector": "chef-server-visibility",
{
"name": "example",
"description": "This is an example role defined as JSON",
"chef_type": "role",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
},
"run_list": [
"audit": {
"collector": "chef-server-visibility",
"insecure": false,
"profiles": [
{
"name": "my-profile",
"compliance": "john/my-profile"
}
]
}
"delivery-truck":{
"publish": {
"chef_server": "true"
}
}