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 …

Open the system drive of an AWS instance you cannot log into

If you cannot log into an AWS instance and want to inspect files on it, you can detach the volume from the lost instance and attach it to another instance as the secondary drive. Create a new instance Create a new AWS instance and log into it, Make a note of the Instance ID of …

Debugging a Packer build

Packer can configure a server instance and create an image of it. If you need to examine what Packer is doing, you can run Packer in debug mode and RDP into the instance to view files and other settings. Open the firewall In the “builders” element add a line to the Packer template to execute …