Failed to complete #create action: [undefined method `[]’ for nil:NilClass] on …

When we launch a test instance with Chef Test Kitchen, we may get the error message: —–> Starting Test Kitchen (…)—–> Creating …——Exception——->>>>>> Class: Kitchen::ActionFailed>>>>>> Message: 1 actions failed.>>>>>> Failed to complete #create action: [undefined method `[]’ for nil:NilClass] on …>>>>>> ———————->>>>>> Please see .kitchen/logs/kitchen.log for more details>>>>>> Also try running kitchen diagnose –all for […]

Test Chef cookbooks with Docker containers

Kitchen Dokken is a provisioner to test cookbooks in Docker containers. It is very fast and efficient compared to cloud instances like AWS EC2s, Vagrant boxes, or VMWare virtual machines. Currently, you can only test Linux cookbooks with Kitchen Dokken. To generate a cookbook with the dokken provisioner use the –kitchen option The Kitchen Dokken […]

Is the Chef aws_s3_file resource idempotent?

Yes, it is idempotent. It means, when the target file on the local drive matches the source file in the S3 bucket, Chef Client does not download the file. In the past aws_s3_file was not idempotent, but now behind the scenes it calls remote_file which compares the files and skips the download when the files […]

Chef FATAL: IndexError: string not matched

Chef attributes are “Mash” type. From the Ruby Doc: “Mash allows you to create pseudo-objects that have method-like accessors for hash keys.” Mash is inherited from Hash. Attributes can hold any data type, but we need to make sure the type does not change as we create more attributes. In this example we change the […]

Change or reset the user password if you cannot logon

I have found an interesting article by Raymond on how to reset the password of your Windows computer even if you cannot log in. Change Or Reset User Password If You Cannot Logon For the last method, you will need a bootable USB drive to start your computer. See my article Install Windows 10 from […]

Failed to complete #converge action: [password is a required option]

The Chef Test Kitchen EC2 driver can connect to Windows instances two ways. Using a custom image with known admin account credentials When we use a custom built image which has a local administrator account with known username and password, specify it in the kitchen.yml file. Standard Amazon AMI with random password When we use […]