Giter Club home page Giter Club logo

ansible-discourse's Introduction

Ansible-discourse

Provisioning Discourse with Vagrant, Ansible and Discourse Docker

Requirements

  • Vagrant (tested with 1.8.1)
  • Ansible (tested with 1.9.3)

Basic Setup

  1. Clone this project:
git clone [email protected]:xpeppers/ansible-discourse.git
  1. Add an entry to your /etc/hosts file that maps the domain discourse.dev to the IP of the virtual machine:
192.168.11.3    discourse.dev
  1. Start the virtual machine with vagrant:
vagrant up
  1. Install the ansible roles (execute from the host machine):
[sudo] ansible-galaxy install -r requirements.yml
  1. Configure Discourse (from the host machine)

Clone Discourse Docker to properly configure your Discourse installation:

git clone [email protected]:discourse/discourse_docker.git

Copy the configuration file discourse_docker/samples/standalone.yml:

cp discourse_docker/samples/standalone.yml discourse_docker/containers/app.yml
  1. Edit the file app.yml accordingly to your setup (hostname, stmp settings, etc.)

6b) For the production machine setup, if you are using HTTPS, place the SSL key and certificate under playbooks/roles/discourse/files/ and name the files ssl.key and ssl.crt and uncomment the line with templates/web.ssl.template.yml in app.yml to enable HTTPS. (Reference: Allowing SSL / HTTPS for your Discourse Docker setup)

  1. (Optional) Configure backup:
cp playbooks/roles/discourse/files/backup.cron.template.sh playbooks/roles/discourse/files/backup.cron.sh

Fill the API key in backup.cron.sh with the key you find here: https://<DISCOURSE_HOST>/admin/api/keys

  1. (Optional) If you want to change the default (/var/discourse) installation directory of Discourse, you can change the value in playbooks/vars/main.yml and change the value of volumes in app.yml too.

Provisioning

Provision with

# Vagrant host
scripts/provision_vagrant
# or
scripts/provision_vagrant_only_machine
# or
scripts/provision_vagrant_only_discourse

# AWS host
scripts/provision_aws
# or
scripts/provision_aws_only_machine

Utility scripts

Manual/Automatic Backups

Run this command to trigger a backup:

scripts/cmd_aws "sudo sh /home/discourse/backup.cron.sh"

Additionally there is a cron configured that runs automatic backups at 9:00, 14:00 and 20:00. For additional configuration see playbooks/roles/discourse/tasks/main.yml.

Gather info about the machine

scripts/info_vagrant

# or

scripts/info_aws

Machine logs

scripts/logs_vagrant

# or

scripts/logs_aws

Execute arbitrary commands

scripts/cmd_aws "ls -lh /var/discourse"
scripts/cmd_aws "sudo docker ps"

scripts/cmd_aws [YOUR-PEM-LOCATION] "sudo docker ps"

Useful resources

Notes

Ansibles gather_facts cannot be disabled.

(Un)License

All information is public content.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.