Skip to content

Commit

Permalink
Merge branch 'master' into task-add-git-ssh-deploykeys
Browse files Browse the repository at this point in the history
  • Loading branch information
jzandbergen authored Jun 12, 2020
2 parents 6515a80 + d234131 commit 1c6b8b3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docs/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,19 @@ With either of these, test-kitchen will do the following

If `kitchen test` was run, then the `kitchen list` command will show all the instances and what the result of their last command was.

## Run test interactivaly ##

If your `converge` or `verify` step is failing, by default `kitchen` will keep your VM running, so you can login using
ssh and debug things from there. To run the `state.apply` that converge is doing, run the following :

kitchen login
sudo salt-call --config-dir=/tmp/kitchen/etc/salt/ --log-level=debug state.apply

If you are using the `minion_id` argument run :

kitchen login
sudo salt-call --config-dir=/tmp/kitchen/etc/salt/ --log-level=debug --id=salt-minion-id state.apply

## Closing ##

This instance is now tested. For more information about `kitchen-salt` and `test-kitchen` in general please see the following links:
Expand Down
2 changes: 1 addition & 1 deletion docs/provisioner_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ Location to place the minion config in the sandbox.

default: `nil`

Local custom minion config template to be used in kitchen-salt. The default is {file:lib/kitchen/provisioner/minion.erb}
Local custom minion config template to be used in kitchen-salt. If filename ends in '.erb' it will be loaded as an Ruby ERB template, else it will be copied without modification. The default is {file:lib/kitchen/provisioner/minion.erb}

### salt_minion_id ###

Expand Down
8 changes: 8 additions & 0 deletions lib/kitchen/provisioner/salt_solo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,13 @@ def prepare_grains
end

def prepare_dependencies
# Dependency scripts are bash scripts only
# Copying them clobbers the kitchen temp directory
# with a file named `kitchen`. If adding Windows
# support for dependencies, relocate into a
# sub-directory
return if windows_os?

# Write ssh known_hosts
write_raw_file(File.join(sandbox_path, config[:ssh_home], "known_hosts"), File.read(File.expand_path("../known_hosts", __FILE__)))
# Write general deploy key.
Expand All @@ -439,6 +446,7 @@ def prepare_dependencies
write_raw_file(outfile, contents)
end
end

# upload scripts
sandbox_scripts_path = File.join(sandbox_path, config[:salt_config], 'scripts')
info("Preparing scripts into #{config[:salt_config]}/scripts")
Expand Down

0 comments on commit 1c6b8b3

Please sign in to comment.