An interactive tutorial about how to use the Ansible configuration management tool to run a long-running Python process on a remote machine in a repeatable manner
Clone or download
Latest commit 91e3d94 Mar 24, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
roles/supervisor/tasks more tutorial writing Mar 21, 2017
templates more tutorializing Mar 22, 2017
.gitignore more tutorial writing Mar 21, 2017
Automating Python with Ansible.ipynb add tweet Mar 24, 2017
LICENSE ready to post Mar 23, 2017
Makefile renumber cells Mar 23, 2017
README.md ready to post Mar 23, 2017
ansible.cfg initial commit Mar 15, 2017
environment.yml more for blog post Mar 20, 2017
hosts more for blog post Mar 20, 2017
ping.yml more for blog post Mar 20, 2017
playbook.yml more tutorializing Mar 22, 2017
supervisor.yml more tutorial writing Mar 21, 2017

README.md

By Tim Hopper: tdhopper.com

alt text alt text

Automating Python with Ansible is an interactive tutorial about how to use the Ansbile configuration management tool to run a long-running Python process on a remote machine in a repeatable manner. It's particularly oriented towards data scientists.

Install Instructions

Install Ansible

  • $ brew install ansible on a Mac.
  • $ sudo apt-get install ansible on a Debian/Ubuntu system.

Setup Jupyter Environment

  • Install Conda
  • $ conda env update to create Conda environment from environment.yml.
  • $ source activate automating_python (in Bash).
  • $ python -m bash_kernel.install to install Jupyter bash kernel.

Launch a Virtual Private Server

I used DigitalOcean. They have a nice UI and clear instructions. You'll want to add an SSH key so you can ssh without a password.

Setup ~/.ssh/config

To make it easy to SSH to the box, add something like this to your ~/.ssh/config:

Host digitalocean
  HostName VPS.IP.ADDR.ESS
  User root
  Port 22
  IdentityFile "/Users/USER/.ssh/id_rsa"
  ForwardAgent yes

Launch Notebook

  • $ jupyter-notebook to launch a local Jupyter notebook server.
  • Open the Automating Python with Ansible.ipynb notebook.