- Ansible runs only on Unixlike machines, so your laptop must be running Mac OS X or GNU/Linux or similar. If your laptop runs Windows, you must read the section about Windows further below, otherwise you will be unable to attend the workshop.
- We can’t afford to waste time during the workshop trying to figure out problems about Ansible installation, so you must have already installed Ansible on a virtualenv on your laptop before the start of the workshop. The way to install Ansible on Ubuntu and Debian is this:
apt install python3-paramiko python3-jinja2 python3-yaml mkvirtualenv --python=/usr/bin/python3 --system-site-packages ansible-workshop pip install 'ansible<2.3'
Then check that ansible works; enter
ansible --helpand verify that it gives you a usage message.
I don’t know how to do it on Mac OS X, but it shouldn’t be difficult to do the equivalent of the above commands. It’s fine if you install jinja2 and yaml with pip, but paramiko can be tricky (because of its crypto dependencies), so it’s better if you install a system package.
If you have trouble installing it on Python 3 but can do it on Python 2, it’s fine, it doesn’t make any difference.
- Please download file ansible-workshop.zip and keep it on your laptop; you will use its contents during the workshop.
- Please create a quicksearch in your browser with keyword “ansible” and URL “http://docs.ansible.com/ansible/%s_module.html”. (if you don’t understand what I’m talking about please read An easy tip to quickly access the Python reference).
- I have created a Ubuntu 16.04 server for each one of you and you will work on it during the workshop. You can ssh into it with
ssh -i ansible_rsa XXXXX.djangodeployment.info, where XXXXX is your Slack nick. You will find
- You must have clear understanding of virtualenv, particularly of the fact that it does nothing more than alter the system path and the python path. If this is not entirely clear to you, please read virtualenv demystified.
- We will be deploying Django with nginx, gunicorn and systemd, essentially following this cheat sheet. In order to be able to concentrate on Ansible, it will be best if you have at least a general understanding of it. If it is mysterious to you, it will help you to watch this 20-minute walkthrough (start at 10:40, the presentation is 20 minutes, the rest is Q&A).
If your laptop runs Windows, you must install a GNU/Linux virtual machine on it using Virtualbox. You will not be able to attend the workshop if you don’t.
During the workshop, you will be editing files a lot. You will be creating files, creating directories, renaming files and directories, copying stuff from one file to another, and so on. It will be really better if you do this in your favorite editor, and be graphically viewing the directory tree if you are accustomed to that. So logging into your virtual machine and working in there with vim is really suboptimal (unless this is the way you commonly work). It’s probably better if you work in a directory shared with Windows, in which case you will do all editing and file management in Windows, and only execute Ansible on the virtual machine.
The rest of the instructions above also apply to you. The ansible-workshop.zip must be where you edit and manage your files (i.e. on the shared directory, if any).