Resize the VirtualBox image hard drive

When your VirtualBox virtual machine’s hard drive fills up Virtual Box does not provide a user interface to extend it. If you run VirtualBox on a Macintosh workstation Stop the virtual machine On a Macintosh workstation, the virtual machine image files are located at ~/VirtualBox VMs The name of the subdirectory and the image file matches the …

Ruby tips and tricks

Bang methods (Exclamation point at the end of the method name) There are methods that have a permanent or dangerous version. The exclamation point designates to use the dangerous version of the method. String manipulation The bang versions of the string manipulation methods (with the exclamation point), modify the string variable in place. Some of these methods …

Find the AWS account number

The AWS account number uniquely identifies the AWs account you are working with. All AWS “arn” identifiers contain it, and you need to know it when you want to share AMIs with other accounts. If there are no resources created yet in the account, you can find the account number in the “arn” of your user …

Execute Terraform scripts with Octopus

Terraform is a very powerful, free command-line tool to launch servers in any cloud or virtual machine environment. Hashicorp, the creator of Terraform just introduced the paid Terraform Enterprise server, that orchestrates the execution of the Terraform scripts. Octopus is another tool that added Terraform orchestration functionality in version 2018.3 In this example, we will set …

Migrating from Chef Client version 12 to 13

Chef is under heavy development, every new major version introduces new features, and many times changes, deprecates, or removes some commands or options. Chef Client 13 introduced a new way of handling reboots and Windows scheduled tasks. reboot resource In Chef version 12, the “:reboot_now” action continued the execution of the Chef cookbook but after …

How to upgrade Jenkins

Jenkins regularly releases new versions. To upgrade Jenkins On Linux To install the Generic Java Package (.war) Write down the current version of Jenkins you have on your server Download the Jenkins “Generic Java Package (.war)” file from https://jenkins.io/download/to your workstation Upload the installer to Artifactory or other HTTP repository SSH into the Jenkins server Switch to sudo mode …

Calling a resource in the Chef recipe

During major Chef Client version upgrades, some instructions need to be changed based on the version of the Chef Client. For example, upgrading from version 12 to version 13, the “windows_task” resource requires a different action to make changes to existing scheduled tasks. To call a Chef resource in your cookbook, you need another resource to …

Make decisions in your Chef recipe based on the version of the Chef Client

There are times when you have to make a decision in your Chef recipe, based on the version of the Chef Client installed on the node. There are two ways to get the version of the installed Chef Client: Chef::VERSION node[‘chef_packages’][‘chef’][‘version’] To make a decision based on the installed Chef Client version if ( Chef::VERSION.to_f …

Test your cookbook in Chef Test Kitchen against multiple versions of the Chef Client

In large environments, during the Chef Client version change, some older servers still run the prior version of the Chef Client, the newly created servers launch with the new version of the Chef Client. It is very important to test your cookbooks with the old and the new versions of Chef Client. To specify the …