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.

driver:
  name: ec2
  aws_ssh_key_id: MY_SSH_KEY_NAME
  ...

platforms:
  - name: windows-2019
    driver:
      image_id: "ami-MY_CUSTOM_AMI_ID"
      instance_type: t3.medium
      security_group_ids: ['sg-MY_SECURITY_GROUP_ID1','sg-MY_SECURITY_GROUP_ID2']
    transport:
      name: winrm
      elevated: true            # Required for the installation of some Windows features
      connection_timeout: 60
      connection_retries: 10
      username: MY_ADMIN_USERNAME
      password: MY_ADMIN_PASSWORD

Standard Amazon AMI with random password

When we use an Amazon standard Windows AMI, the kitchen-ec2 driver needs to retrieve the random password by using the SSH key the server was launched with.

driver:
  name: ec2
  aws_ssh_key_id: MY_SSH_KEY_NAME
  ...

platforms:
  - name: windows-2019
    driver:
      image_id: "ami-MY_CUSTOM_AMI_ID"
      instance_type: t3.medium
      security_group_ids: ['sg-MY_SECURITY_GROUP_ID1','sg-MY_SECURITY_GROUP_ID2']
    transport:
      name: winrm
      elevated: true            # Required for the installation of some Windows features
      connection_timeout: 60
      connection_retries: 10
      username: Administrator
      ssh_key: MY_SSH_KEY_PATH/MY_SSH_KEY_FILE.pem

If the ssh key location is not specified in the transport section of the platform in the kitchen.yml file, we get the error message:

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

Troubleshooting

When you get the error message:

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

  • Make sure the transport section of the platform in the kitchen.yml file contains the line
    ssh_key: MY_SSH_KEY_PATH/MY_SSH_KEY_FILE.pem
  • It is possible, that the saved password of the Windows instance in the .kitchen/...yml file is not valid anymore. Destroy the instance and execute the kitchen converge command again.

Scan documents into password-protected ZIP files with iPhone

Follow these steps to

  • scan documents into PDF format with your iPhone,
  • transfer them to your computer,
  • compress them to a password-protected ZIP file.

Scanning

Your iPhone can scan documents into PDF files

  • Open the Notes app
  • Tap the new document icon in the lower right corner to create a new note
  • Tap the camera icon
  • Select Scan Documents
  • Point the camera to the document and take a picture of it
  • Edit the corners if necessary and click Keep Scan
  • Scan all pages and click Save

  • Click the circle in the upper right corner
  • Select Send a Copy
  • Select Save to Files
  • Select the iCloud Drive and click the new folder icon to create a folder in the iCloud Drive
  • Enter the name of the new folder
  • Select the new folder and click Save in the upper right corner

Transfer the files to your computer

  • In your web browser navigate to icloud.com
  • Log in with your Apple ID
  • Select the iCloud Drive icon
  • Double click the folder of the document
  • Select the document
  • Click the download icon
  • Click the arrow next to the downloaded document and select Show in folder

Encrypt the document

  • Install 7-Zip on your computer from https://www.7-zip.org/download.html
  • In Windows Explorer right-click the downloaded file
  • In the 7-Zip section select Add to archive
  • Select the Zip archive format
  • Select AES-256 encryption method
  • Enter a secure password
  • Click the OK button

Send the document

If you send the ZIP file in an email do not include the password in the same email. If possible, use a different communication method to transfer the password. Send it as a text message (SMS), or tell the recipient over the phone.

Decrypt the document

Ask them to

  • Right-click the ZIP file
  • In the 7-Zip section of the pop-up menu select Extract to “…”
  • Enter the password to decrypt the Zip archive
  • The documents will be available in the folder named after the Zip file.

Search the Chef server

Use the knife search command to list nodes that match the provided criteria

Find nodes with a specific cookbook in the run list (runlist)

knife search node 'recipes:MY_COOKBOOK\:\:*'

Find nodes with a specific recipe in the run list (runlist)

knife search node 'recipes:MY_COOKBOOK\:\:MY_RECIPE'

List nodes with a specific OS

All Linux nodes

knife search node "os:linux"

All nodes with Ubuntu OS

knife search node 'platform:ubuntu'

The last time the node successfully executed the run list (checked in)

List the status of all nodes and save it in a file. The columns contain how long ago the node successfully executed the run list, the name of the node, and the operating system.

knife status > nodes.csv

List nodes attached to a specific Policy Group and display the ‘ec2.instance_id’ attribute only

knife search 'policy_group:dev' -a ec2.instance_id

Display all information about a node

knife node show <FQDN> -l

List all nodes and display the Policy Group attribute only

knife search node 'name:*' -a policy_group

Speed up the Windows 10 user interface

Windows 10 has pretty effects to fade in and out windows, animate the opening of menus and other objects.

If you prefer a relaxed appearance, it is for you, but if you want to complete your tasks and view the result of your actions faster, here is the way to turn the effects off.

  • Press the Windows and R keys together to open the Run dialog box
  • Enter sysdm.cpl into the box
  • On the Advanced tab click the Settings button
  • Unselect the items
    • Animate windows when minimizing and maximizing
    • Fade or slide menus into view
    • Fade or slide ToolTips into view
    • Fade out menu items after clicking

Configure Epson WF-3520 scanning on Windows 11

Install the Epson WF-3520 scanner driver and scanning utility

  • Download the Scanner Driver and Epson Scan Utility from the Driver section.
  • Double-click the downloaded file and install the application

Connect to the Epson WF-3520 scanner

  • Start the EPSON Scan Settings utility
  • Select Network and click the Add button
  • When the search is complete click the found IP address and the OK button
  • To test the scanner connection click the Test button
  • Click the OK button to save the settings

To enable the Preview function

In Windows 11 the Preview button is not visible by default. To make the Preview button visible on the Epson Scan page, we will need to press the Alt key on your keyboard.

  • On the first page of the Epson Scan utility click the Configuration button
  • On the Configuration page click the OK button
  • Press the Alt key
  • The Preview button magically appears

Scan with the Epson WF-3520 scanner

  • Open the EPSON Scan app

Generate the Chef cookbook dependency diagram

The Brew viz command reads the Berksfile.lock in the current Chef cookbook directory and saves the cookbook dependency diagram in the graph.png file.

The command requires the graphviz utility

Install graphviz

In the terminal window execute

brew install graphviz

Generate the cookbook dependency diagram and open it in Preview

In the Chef cookbook directory execute

berks viz;open graph.png

If you get the error message

The lockfile is out of sync! Run `berks install` to sync the lockfile.

First try

berks install

If the error persists, execute

berks update

Install TeamCity agent remotely

To install the TeamCity agent on a remote computer in the TeamCity UI on the Agents page select the Agent Push tab.

Make sure the remote computer is accessible by PSEXEC. See Configure the target server for PSEXEC

If the remote server is in the domain, make sure you prefix your username with the domain name to avoid the error message:

The handle is invalid.
Couldn’t access SERVER_NAME:

… was executed with error message(s): Execution error. Return code=6

Configure the target server for PSEXEC

PSEXEC is a remote procedure execution tool written by Mark Russinovich at Microsoft and available for download at https://docs.microsoft.com/en-us/sysinternals/downloads/psexec.

To use PSEXEC you need to open ports 135 (TCP) and 445 (TCP) on the target computer. 

  • Enable the ports in the security group
  • Open the ports inbound in the server’s firewall

You also need to have the IPC$ and ADMIN$ shares enabled. To test the availability of the IPC$ and ADMIN$ shares

  • Open a command prompt on the target computer, and use its IP address in the test
net use \\COMPUTER_IP\ipc$ /user:ADMIN_USER_NAME "ADMIN_USER_PASSWORD"

You should get the message:

The command completed successfully.

Make the GantChart Excel template smarter

There is a great, free Excel Gantt chart template on the Vertex42 web site at https://www.vertex42.com/ExcelTemplates/excel-gantt-chart.html

The free version lacks a few features that could make project planning easier. We can update our version of the template to make it smarter. Make these changes before you start to use the template, because inserting task rows can multiply the number of conditional formatting formulas to an unmanageable number.

Skip the weekends in the task end date calculation

When the template calculates the task end dates, it includes the weekends as worked days in the calculation. To make sure the task end date falls on a work day and the weekends are not included in the task duration, update the calculation. Update the cell in the first task row and copy the updated cell down to every row.

Change the formula in F9 from
=IF(ISBLANK(E9)," - ",IF(G9=0,E9,E9+G9-1))
to
=IF(ISBLANK(E9)," - ",IF(G9=0,E9,WORKDAY(E9,G9-1)))

Short tasks or headers with no task duration

There are task rows that should not be planned as a full day of work. If

  • a row is a group header
  • the task execution time is shorter than a day
  • multiple tasks can be done the same day

This change will start the task on the same day if the prior task has zero or empty “Days” value.

Update the start time formula in one cell and copy the updated formula down to every task row.

Change he formula in F10 from
=WORKDAY(F9,1)
to
=WORKDAY(F9,IF(G9=0,0,1))

Extend the range of the GantChart Excel template

The GantChart Excel template is configured to display the blue blocks only in an 8 week range.

If your project runs longer, you need to extend the range of the display area.

Copy the calendar blocks

  • Copy paste the calendar block on the top of the page
  • Select the columns of the newly created calendar headers and set the column width of all of them to 1.67




Extend the conditional formatting range

  • On the Home tab in the Conditional Formatting dropdown select Manage Rules
  • On the top select This Worksheet, and replace “$BN” with “$zz” in every formula.

Failed to complete #create action: [You are not authorized to perform this operation

When launching an instance in AWS with Chef Test Kitchen you get the error message

>>>>>>     Failed to complete #create action: [You are not authorized to perform this operation. Encoded authorization failure message:...
  • Make sure the image does not require the acceptance of the license before you first use it. This applies to Ubuntu, CentOS