Skip to content

gomezgoiri/learninglocker-centos7

Repository files navigation

LearningLocker on CentOS7

This project contains Vagrant and Ansible scripts to provision CentOS7 machines with LearningLocker. The Ansible playbook has been successfully used with RHEL 7 too.

This LearningLocker installation will depend on Apache2 and MongoDB. Note that there is another Vagrant and Ansible script to provision one Ubuntu VM with LearningLocker using nginx which can be found here.

Configuration

Copy vars.secret.yml.edit file to vars.secret.yml and edit it following the instructions detailed in the file.

Optionally, you might want to edit the files located in the group_vars or the vagrant directories.

Typical usage

This section explains three ways to install LearningLocker:

  1. Create one VM machine with LL installed.
  2. Create two VM machines with LL installed: one for the webserver and the other for the database.
  3. Install LL in existing machines.

Use case 1. Create one VM machine

To create a virtual machine and provision it with LearningLocker, simply run:

vagrant up

If the installation is completed successfully, you will be able to:

Use case 2. Create two VM machines

To create a virtual machine and provision it with LearningLocker, simply run:

MACHINES='./vagrant/two_machines' vagrant up

If the installation is completed successfully, you will be able to:

  • Access LL through your web browser: http://192.168.35.3
  • Connect to the machines:
  • vagrant ssh ll-web
  • vagrant ssh ll-db

Use case 3. Install it in existing machine(s)

First, you need to create an inventory file specifying the machines that you will use. The inventories directory contains some sample files which can be used as inventory templates.

Then, run Ansible as follows.

ansible-playbook --private-key=[path_to_private_key] --user=[remote_user] -i [path_to_inventory_file] main.yml

If the MongoDB will not run in the same machine as the web server, you should specify it in the following way:

ansible-playbook --extra-vars={"mongodb_host":"[ip-of-the-machine]"} (...)

To provision only the web server run:

ansible-playbook (...) learninglocker.yml

To provision only the database run:

ansible-playbook (...) database.yml

Troubleshooting

  • Ansible throws an error which says: Missing become password.
  • What happens? The remote user you are running needs to introduce a password to become sudo.
  • Quick solution: Add the --ask-become-pass parameter.

Acknowledgements

This playbook was made as part of the FORGE project.

To create the Ansible playbook, the steps described by David Pesce here were a great help. Therefore, part of the credit goes to him.

About

Vagrant and Ansible scripts to provision one (or more) CentOS7 machines to use LearningLocker.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages