Ansible playbooks

I’ve been messing around with Ansible for some time now and have created simple playbooks to patch our servers. I use pip to install the latest Ansible: sudo apt install python3-pip python3-venv python3 -m venv env source env/bin/activate pip3 install ansible The first thing I created was a hosts.ini file: cat hosts.ini [xyze] backup.xyze ansible_ssh_extra_args=”[email protected]” … Read more

AWS CLI archive ami

I use Amazon’s Daily Backup service which creates Amazon Machine Images from snapshots which I keep for a year in S3 Deep Archive and then automatically delete using a Lifecycle Rule (Daily backups.) However I’ve upgraded the Git server and I want to keep a copy of the old one in a bucket of old … Read more

WordPress, Lighttpd, and Cloudflare

I’ve been meaning to try Lighttpd for ages as I wanted to downgrade my server to save money and it takes the least amount of memory compared with apache or nginx. Installed with the help of: https://www.how2shout.com/linux/install-wordpress-on-lighttpd-web-server-ubuntu/ https://www.howtoforge.com/how-to-install-lighttpd-with-php-and-mariadb-on-debian-10/ But had to make changes too. james@instance-1:~$ sudo mysql CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; … Read more

AWS CLI start instance

I wanted to start an instance from my terminal rather than going onto the AWS console. Firstly choose the profile, then search for the instance: export AWS_PROFILE=xyze aws ec2 describe-instances –output table | grep -B150 backup | grep InstanceId –output table presents the output as a nice table rather than json. Grep searches for the … Read more

Daily Backups

Amazon’s guide to AWS Backup is here: https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html Our Backup plan is called xyze-prod-backup and can be viewed by clicking on ‘Manage Backup plans’ from the AWS Backup dashboard. I’ve set up a backup rule called ‘DailyBackups’ which are kept for 7 days in EBS as most recent backups are likely to be the ones that … Read more

Install AWS CLI

I’m using pip to install the latest awscli as the version in apt won’t work for the new ‘Deep Archive’ however awscli v2 is now available and should be used instead of the old one: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html pip3 install awscli Now we need to configure the cli by installing authentication from AWS. Log into the AWS … Read more

Upgrading AWS Hardware

Over the weekend of 8th Feb 2020 I upgraded our AWS production instances to the new nitro series 3 platform plumping for the AMD based T3a family as this attracted a 10 percent discount and we are looking to reduce our AWS costs as they are increasing month by month. Whereas our customers upgrades (using … Read more