Blog / Ansible

How to download the entire contents of a folder in an S3 bucket with Ansible

June 21, 2018

Just ran into this issue today. I needed to be able to download all the files inside a folder stored in an S3 bucket with Ansible.

The aws_s3 module docs on the Ansible site didn't provide an example on how to do this, but I did find a couple of articles that pointed me in the right direction.

- name: Get list of files from S3
aws_s3:
mode: list
aws_access_key: "{{ aws_access_key_id }}"
aws_secret_key: "{{ …

Using SSH Agent Forwarding with Ansible

December 24, 2017

I've been using SSH agent forwarding with Ansible for the last few projects I've been working on and I thought I'd just share my setup here.

The neat thing with SSH agent forwarding is not having to store your SSH keys on your servers when pulling down your Git repo during deployment.

For example, I can deploy new code to my servers through Ansible from my local machine using my local SSH keys. The servers …

Ansible Playbook for provisioning a Graylog central logging server

February 24, 2017

Graylog Message Stream

I first used Graylog a few years back while working for a tech startup in New York City. I was really impressed with it and it was probably the best log management software I've used at the time.

I've been meaning to set one up for Highview Apps for some time now, as we now have 5 servers for the different Django apps we've built and we will soon be adding another 3. Without centralized …

Automatically generating and renewing Let's Encrypt SSL certificates with the certbot client and Ansible

August 11, 2016

I just finished updating my ansible-django-stack project and added tasks to automatically issue a Let's Encrypt SSL certificate and set up a cron job to auto-renew the certificate.

We're now using it for all our Shopify apps which are built in Django. Let's Encrypt certificates are only valid for 90 days, so if you have a bunch of web apps like we do and have more planned in the future, automating this process now could …

Ansible playbook for provisioning a Jenkins CI server

May 27, 2016

I've finally decided to set up a Jenkins CI server for my Django projects earlier this week. For a long time, I've been deploying code via command line with Ansible. It worked very well but occasionally I find myself deploying from a coffee shop with unreliable connection, causing the deployment to get interrupted. Deploying instead from a virtual private server in the cloud would solve this and using Jenkins to do it was the first …

Older