Skip to content

Guybrush21/picard

Repository files navigation

picard

Ansible playbook for playtesting.

Status

Build Status

Get started

You need a valid control node capable of running Ansible and Vagrant. Check control node prerequisites

Vagrant

We create the needed vagrant machines:

export VAGRANT_EXPERIMENTAL="disks"
vagrant up

VAGRANT_EXPERIMENTAL is needed to create a bigger inital disk (80GB instead of 40GB) to complete ex. 2.

Vagrant will provision the vms ensuring python3 is installed, this because centos7 is still defaulting to python2.

Ansible

Play ansible directly with the inventory parameter.

ansible-playbook playbook.yml -i host.ini

Final result

Navigating to http://riker.uss will welcome you with a web page with the iconc USS Enterprise crew.

Ansible exercise

Using an ansible playbook:

  1. Provisioning of two CentOS VM, cloud or locally.
  2. Setting VM: Ensure partition used by Docker is at least 40GB.
  3. Install Docker on the VMs
  4. Setting up Docker:
    1. Securely expose Docker Daemon REST API
    2. Ensure Docker Daemon is configured as a service that starts on boot.
  5. Configure a Docker Swarm on the two VMs, securely accessible. Ensure you can deploy services on the swarm.
  6. Optionally: Test one of the task above using Molecule.

Describe each activity with appropriate Ansible roles and related tasks. The reuse of Ansible roles and playbooks made available in the open-source community is highly recommended (some of which are already linked in the text as an example and below for useful references). In case of code reuse it is important to motivate the role selection criteria, to know its features and contents, and to be able to describe any customizations carried out for the purpose of carrying out the above activities.

Code Versioning:

  1. Versioning the code on a public repository on Github.com, so that there is a clear description of the work done in the history of the repository;

Continuous Integration:

  1. Configure a Continuous Integration pipeline on a tool of your choice (tip: Travis, for simple integration with GitHub, Ansible Docker)
  2. Pipeline should:
    1. Linting the code and failing in case of errors, which must be suitably corrected.
    2. Optionally: Execute the test carried out in point 6 automatically at each code push on the repository

References: