Skip to main content

Posts

Showing posts with the label kitchen

Windows Testing Using Kitchen Chef

Kitchen-Vagrant has the capability to spin up a windows instatance for testing. To make it make it work you will need the vagrant-winrm to be installted on the workstation. Installing vagrant-winrm ┌─[ahmed][zubair-HP-ProBook][~/work] └─▪ vagrant plugin install vagrant-winrm Once you have have installed you might still get the below error. ┌─[ahmed][zubair-HP-ProBook][~/work] └─▪ kitchen list ------Exception------- Class: Kitchen::UserError Message: WinRM Transport requires the vagrant-winrm Vagrant plugin to properly communicate with this Vagrant VM. Please install this plugin with: `vagrant plugin install vagrant-winrm' and try again. Please see .kitchen/logs/kitchen.log for more details Also try running `kitchen diagnose --all` for configuration Download Windows Box. There is a nice repos which creates windows vagrant box. git clone https: / /github.com/boxcutter /windows.git Here is the output. ┌─[ahmed][zubair-HP-ProBook][~/work] └─▪ git clone https://...

Encrypted Data Bags - Chef

Data Bags are a way to store information on the chef-server which all the cookbooks can access. Few more additional advantages are that we can encrypt the data-bags as well, this will help in keeping any sensitive information like user/password. What we are doing now is to store user information in a data-bag and use them to create users on the servers. We will be using users cookbook to create the users. users cookbook details. https://github.com/chef-cookbooks/users https://supermarket.chef.io/cookbooks/users Steps. Create a secret file. Create json user files. Create data-bag on the chef-server . Add the local user .json file to data-bag with the secret file created. Creating secret file. We will be using the openssl to create a random file. user secret. openssl rand -base64 512 > ~ /work/chef -repo/cookbooks/init-setup/secret-files/user_data_bags_encrypted_secret Here is how the file would look like. ┌─[ahmed][zubair-HP-ProBook][~] └─▪ o...