Posts By: jonny

Hashicorp Nomad Dev Install on Debian

Ensure the deb repo is configured and install nomad: Environment Variables Development Mode These commands are for testing non-production tasks. In this example I am running on a server with IP address 192.168.1.91 The web UI will be available on that IP port 4646 Check the status of the node: Running a test redis job… Read more »

Hashicorp Vault Install on Debian

For a new vault cluster, add the APT repo: Depending on how you have configured the listener you may need to set an environment variable specifying the vault location before commands like ‘vault status’ will work: Notice I am setting a variable to disable certificate verification to avoid having to add ‘-tls-skip-verify’ to each command…. Read more »

Packer HCL Environment Variables

Converting Packer templates from json to HCL for Packer version 1.7.2. The easiest thing to do is try the automated conversion: For environment variables we need to set them with a PKR_VAR prefix e.g. Then that can be defined in the template.pkr.hcl file with: And then used in later sections like this: Then your validation… Read more »

CentOS 8 munin-node needs PowerTools

I had the following error installing munin-node on a new CentOS 8 system: Depsolve Error occured: Problem: package munin-node-2.0.54-2.el8.noarch requires perl(Net::SNMP), but none of the providers can be installed\n – conflicting requests – nothing provides perl(Digest::SHA1) >= 1.02 needed by perl-Net-SNMP-6.0.1-25.el8.1.noarch Solution is to enable the repo CentOS-PowerTools sed -i ‘/enabled=0/enabled=1/’ /etc/yum.repos.d/CentOS-PowerTools.repo

Gitlab API and Python

To start, create a config file with your Gitlab personal token: vi ~/.python-gitlab.cfg With contents similar to below: [global] default = gitlab ssl_verify = true timeout = 5 [gitlab] url = https://gitlab.com private_token = 1234ABCD1234ABCD api_version = 4 next create a directory and a python virtualenv: bashmkdir ./code/python/testpython3 -m venv envsource env/bin/activatepip3 install requests python-gitlab… Read more »

Chef Beginner First Cookbook

I wanted to play around with Chef locally for testing pulling encrypted variables from data bags. Prerequisites ChefDK (includes chef-solo) Encryption Create a Cookbook: chef generate cookbook “firstcookbook” Data Bags Create the encryption key for encrypting data bag items: openssl rand -base64 512 > ~/.chef/encrypted_data_bag_secret Create a local data bag: knife data bag create ssh-private-keys… Read more »

Chef Knife List Nodes with IPs

I had to fiddle a bit with this so possibly worth keeping a note of it. I wanted to pull all the node hostnames and ip addresses from chef for use in hostname lookups and ssh config.

Resetting MySQL root password on newer MySQL 5.7

In newer versions of MySQL it looks like the ‘Password’ field has been replaced with the ‘authentication_string’ field so older instructions online may not work. Stop the currently running MySQL service: systemctl stop mysql Start mysql skipping permissions tables: mysqld_safe –skip-grant-tables Then in another terminal run the mysql client: mysql Then the following SQL: UPDATE… Read more »