Code Monkey home page Code Monkey logo

marvin's Introduction

marvin

Marvin Image CC-BY-SA John Greenaway

Marvin manages our servers using ansible.

To use the Ansible playbooks, you need to

  1. install ansible on your local host.
  2. clone this repo
  3. setup credentials (copy files from AWS S3 to ./host_vars and ./vars aws s3 sync s3://sysadmin/marvin/host_vars/ host_vars/ && aws s3 sync s3://sysadmin/marvin/vars/ vars/. You'll need the AWS CLI installed and the correct credentials set up.
  4. setup access to the remote hosts: copy your public key to the remote host: ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
  5. put the vault password in ~/.vault_pass.txt on your local host
  6. run the relevant playbook: ansible-playbook -v --vault-password-file=~/.vault_pass.txt -i inventory.ini learningcircles.yml

Here are the different plays:

  1. learningcircles.yml - learningcircles.p2pu.org
  2. staging-learningcircles.yml - staging-learningcircles.p2pu.org
  3. community.yml - community.p2pu.org
  4. discourse.yml - discourse.p2pu.org
  5. etherpad.yml - etherpad.p2pu.org
  6. lernanta.yml - courses.p2pu.org (legacy)

marvin's People

Contributors

dirkcuys avatar ercchy avatar htgoebel avatar mkcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marvin's Issues

Find better way of passing env variables to django apps running in docker images

Currently it looks like this which is hard to maintain and error prone

    env:
      VIRTUAL_HOST: "{{LEARNINGCIRCLES.DOMAIN}}"
      LETSENCRYPT_HOST: "{{LEARNINGCIRCLES.DOMAIN}}"
      LETSENCRYPT_EMAIL: "[email protected]"
      DOMAIN: "{{LEARNINGCIRCLES.DOMAIN}}"
      DATABASE_URL: "postgres://{{ LEARNINGCIRCLES.DB_USER }}:{{ LEARNINGCIRCLES.DB_PASSWORD }}@postgres:5432/{{LEARNINGCIRCLES.DB_NAME}}"
      ADMIN_EMAIL: "{{LEARNINGCIRCLES.ADMIN_EMAIL}}"
      SECRET_KEY: "{{LEARNINGCIRCLES.SECRET_KEY}}"
      EMAIL_HOST: "{{LEARNINGCIRCLES.EMAIL_HOST}}"
      EMAIL_HOST_USER: "{{LEARNINGCIRCLES.EMAIL_HOST_USER}}"
      EMAIL_HOST_PASSWORD: "{{LEARNINGCIRCLES.EMAIL_HOST_PASSWORD}}"
      DEFAULT_FROM_EMAIL: "{{LEARNINGCIRCLES.DEFAULT_FROM_EMAIL}}"
      TWILIO_ACCOUNT_SID: "{{LEARNINGCIRCLES.TWILIO_ACCOUNT_SID}}"
      TWILIO_AUTH_TOKEN: "{{LEARNINGCIRCLES.TWILIO_AUTH_TOKEN}}"
      TWILIO_NUMBER: "{{LEARNINGCIRCLES.TWILIO_NUMBER}}"
      BROKER_URL: "amqp://guest:guest@rabbitmq//"
      BACKUP_DIR: "{{LEARNINGCIRCLES.BACKUP_DIR}}"
      BACKUP_AWS_ACCESS_KEY_ID: "{{LEARNINGCIRCLES.BACKUP_AWS_ACCESS_KEY_ID}}"
      BACKUP_AWS_SECRET_ACCESS_KEY: "{{LEARNINGCIRCLES.BACKUP_AWS_SECRET_ACCESS_KEY}}"
      BACKUP_AWS_STORAGE_BUCKET_NAME: "{{LEARNINGCIRCLES.BACKUP_AWS_STORAGE_BUCKET_NAME}}"
      BACKUP_AWS_KEY_PREFIX: "{{LEARNINGCIRCLES.BACKUP_AWS_KEY_PREFIX}}"
      GA_TRACKING_ID: "{{LEARNINGCIRCLES.GA_TRACKING_ID}}" 

Backups for learning circles not working

tar: upload/20200610_130141.jpg: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
[2020-09-29 01:00:42,780: ERROR/Worker-1] Backup failed
Traceback (most recent call last):
  File "/opt/app/backup/tasks.py", line 11, in make_backup
    backup_media()
  File "/opt/app/backup/utils.py", line 35, in backup_media
    raise BackupFailed('could not create media backup')
backup.utils.BackupFailed: could not create media backup

Delete rotated backups on etherpad server

It is not being rotated and DO droplet ran out of space. Had to do a manual cleanup.

Update the script uses to do backups roles/postgres_backup/templates/backup.sh to delete files after running upload_rotate.py

Forum down :(

Ran out of disk space because of old kernel sources :(

Netwell container not working

Traceback (most recent call last):
File "/usr/local/bin/netwell", line 5, in
from netwell.command import handle
File "/usr/local/lib/python3.12/site-packages/netwell/command.py", line 4, in
from netwell import checkers
File "/usr/local/lib/python3.12/site-packages/netwell/checkers.py", line 11, in
import requests
File "/usr/local/lib/python3.12/site-packages/requests/init.py", line 43, in
import urllib3
File "/usr/local/lib/python3.12/site-packages/urllib3/init.py", line 7, in
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 11, in
from .exceptions import (
File "/usr/local/lib/python3.12/site-packages/urllib3/exceptions.py", line 2, in
from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
ModuleNotFoundError: No module named 'urllib3.packages.six.moves'

Use a docker network rather than linking containers

This would avoid the problem of having to recreate any containers that depends on another container. ex app container depending on db container. If the db container is recreated, the app container needs to be recreated, otherwise it will link the old container that's nor running anymore

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.