Ansible course material¶
Prerequisites and installation¶
To be able to follow this course and do the exercises, Ansible need to be installed. The Ansible controller machines needs to run on som sort of nix system, preferably Linux or MacOS.
For Windows 10, installation via Linux Subsystem is recommended.
Install Ansible and the required packages (Ubuntu based):
sudo apt-get update
sudo apt-get install software-properties-common -y
sudo apt-get install python-pip -y
sudo pip install 'pywinrm>=0.1.1'
sudo apt-get install --reinstall ca-certificates -y
sudo apt-add-repository ppa:ansible/ansible -y
sudo apt-get update
sudo apt-get install ansible -y
Verify with ansible --version
.
By using the official Ansible package repo, new versions of Ansible will be installed when running:
shell sudo apt-get update sudo apt-get upgrade
Clone the project¶
Make sure git is installed and clone the project:
git clone https://github.com/DIPSAS/AnsibleCourse.git
Navigate to the folder AnsibleCourse/src
, this will be the working directory.
Editor¶
It is highly recommended to use an editor with tree view (showing file and folder structure) feature when working with Ansible codebases.
Recommendations are (pick one):
- VSCode with Ansible plugin.
- Atom with language-ansible and file-icons plugins.
Alternative installation with Vagrant¶
A prebuilt Virtual Machine can be used with Vagrant and the Vagrantfile
in the repo.
Clone the project and:
vagrant up # Let Vagrant download the VM image and provision it with Ansible vagrant ssh cd /vagrant/