Using the asdf version manager to manage versions of various binaries like terraform, vault or packer is easily done by following the instructions below:
- Download and install asdf if you haven’t got it already (https://asdf-vm.com/#/core-manage-asdf)
- If you want to install the latest version of terraform for example do the following:
asdf plugin add terraform
asdf install terraform latest
asdf global terraform 0.14.9
You would like to tail the Vault auth log files, but if you use the vault tag for auditing and your server is also named vault, you cannot filter out the vault auth logs only.
Use the client_login as the filter in grep:
ubuntu@vault1:~$ sudo tail -f /var/log/auth.log | grep 'client_token'
You are trying to build a QEMU image with Packer, but you are getting the error suggesting to use the PACKER_LOG=1 option. But there is no indication where to place it in the command line.
Put it at the begging of the command line as folows:
kosmas:terraform (add_vault *%)$ PACKER_LOG=1 packer build vault_orchestration/template.json
You would like to test worldPing (https://worldping.raintank.io/worldping/) in your local environment for evaluation purposes.
- Install Grafana with docker as described here (https://grafana.com/docs/grafana/latest/installation/docker/) and give it a name (ie grafana)
- Login to the grafana container and install the worldPing plugin:
$ docker exec -it grafana /bin/bash
bash-5.0$ grafana-cli plugins install raintank-worldping-app
- Exit from the container and stop and start it
$ docker stop grafana
$ docker start grafana
- Login to your grafana installation on the browser (localhost:3000) and go to the section for the plugins to find worldPing
- To be able to enable it you will need an API key from Grafana Cloud, so create a free account (https://grafana.com/signup/starter/connect-account)
- Create an API key (Security – API Keys – Add API Key)
- Go back to Grafana web UI and add the API key so you can enable the worldPing. Add an endpoint to check and select the services to check (DNS, Ping, HTTP, HTTPS)
- Leave it running for a few minutes and check the dashboards afterwards.
- Remember to Disable if you want to go back to it again in the near future, or Destroy the endpoint if you do not need it anymore.
You would like to start using Terraform Cloud and when trying to initialize it with the new remote backend (app.terraform.io), you get the following error:
Error: Required token could not be found
Make sure you configured a credentials block for app.terraform.io in your CLI
Follow the instructions here https://www.terraform.io/docs/cloud/free/index.html and create a file ~/.terraformrc (in linux) with an API token.
You would like to get a list of the available images in Digital Ocean, in order to be able to use them in creating your Terraform IAC script.
By installing the command line tool doctl, (instructions here), according to the documentation (after authenticating) you can run:
doctl compute image list
But the available images are not listed. In order to be list all the images you have to add the –public option (as described here) :
doctl compute image list --public
When trying to configure nullmailer you may end up with many test emails that end up in the queue, that you don’t want to keep trying to send, but to delete them.
Clear the nullmailer queue by running:
You would like to know the IP for a running Docker container.
Run the following two commands (taken from here
docker inspect container_name | grep IPAddress
You run a query in PostgreSQL that takes a lot of time to finish (maybe because of an error) and you want to stop/kill it as it is blocking other queries in db.
You will need to find the pid for the query, either by using a GUI program like Pgadmin or by issuing the following to an SQL prompt:
select * from pg_stat_activity
make a note of the pid of the query that you want to stop/kill and issue the following:
You have a Xen virtual machine and the system clock regularly drifts off daily (not synchronised).
Use the instructions from here to synchronise the VM clock with the host.