![]() ![]() ![]() Ssh_fingerprint="xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" Replace the do_token string with your DigitalOcean API token and the ssh_fingerprint string with your SSH key fingerprint (remember to remove the 'MD5:' prefix): do_token="xxxxxxxxxxxxxx" Create a 'terraform.tfvars' file and 'provider.tf' file (see examples below).For your configuration file, remove the 'MD5:' prefix, so it's just the plain hash.Get your SSH key fingerprint: ssh-keygen -E md5 -lf ~/.ssh/id_rsa.Make your project directory: mkdir wordpress1 cd wordpress1.Just make sure it's not a public repository and make sure your DigitalOcean credentials are not included, because otherwise anyone can create DigitalOcean servers in your account. You can of course also create a GIT repository for your project. Preparations: Project directory and DigitalOcean credentials Unzip the package: unzip terraform*.zip.Download the Terraform binary for your system from.Create a Terraform directory: mkdir terraform cd terraform.Log in to your workstation or Linux system.They provide binaries and you can simply unzip them: DigitalOcean API key (you can create one in your account).ĭownloading and installing Terraform is easy.SSH key (~/.ssh/id_rsa and ~/.ssh/id_rsa.pub) which is also added to your DigitalOcean account (make sure this is the same key, always check key fingerprints!).Actually, there are also Terraform binaries for Windows. Linux workstation, or access to a Linux shell (or macOS or FreeBSD).DigitalOcean account (use my referral link to get free credit).This is not going to be a complete SSH key and Linux guide. So nothing really fancy, but it will give you an idea of the possibilities and opens doors for bigger projects □ What you'll need In this article I will give you an example of how you can start 1 server using the DigitalOcean Terraform provider, with the remote-exec provisioner. It's easy to create multiple servers (you can simply add a 'count' option), so you can create clusters such as a load balancer with 3 web servers in just a few configuration files. And you can perform other tasks such as add the server to Chef or execute commands. You can provision servers in environments like AWS, DigitalOcean and Kubernetes. So you basically write your infrastructure in configuration files (as code). Terraform is an infrastructure as code tool. ![]() In this blog article I will explain how you can do the same installation as described in my WordPress on a CentOS LAMP stack guide blog article, but now in an upgraded way, using Terraform. I will get into more detail about what is changing later. New things are happening in my life, which is pushing me to try new technology/software/everything (which is a very positive thing). ![]()
0 Comments
Leave a Reply. |