Coder Social home page Coder Social logo

cloudweeb.polemarch's Introduction

Cloudweeb Polemarch

Build Status

Ansible role to install Polemarch

Requirements

  • MariaDB-devel
  • MariaDB-shared

Role Variables

polemarch_user: polemarch
polemarch_group: '{{ polemarch_user }}'

polemarch_main_dir: /opt/polemarch

polemarch_base_packages:
  - polemarch
  - mysqlclient

polemarch_db_name: polemarch_db
polemarch_db_user: polemarch_user
polemarch_db_pass: password

polemarch_system_dir:
  - '{{ polemarch_main_dir }}/logs'
  - '{{ polemarch_main_dir }}/pid'
  - '{{ polemarch_main_dir }}/projects'
  - '{{ polemarch_main_dir }}/hooks'
  - /etc/polemarch

polemarch_configuration_maps:
  - '{{ polemarch_main_config }}'
  - '{{ polemarch_database_config }}'
  - '{{ polemarch_database_options_config }}'
  - '{{ polemarch_uwsgi_config }}'
  - '{{ polemarch_worker_config }}'
  - '{{ polemarch_cache_config }}'
  - '{{ polemarch_locks_config }}'
  - '{{ polemarch_rpc_config }}'

polemarch_main_config:
  section: main
  options:
    projects_dir: /opt/polemarch/projects
    hooks_dir: /opt/polemarch/hooks

polemarch_database_config: {}
# section: database
# options:
#   engine: django.db.backends.mysql
#   name: '{{ polemarch_db_name }}'
#   user: '{{ polemarch_db_user }}'
#   password: '{{ polemarch_db_pass }}'

polemarch_database_options_config:
  section: database.options
  options:
    connect_timeout: 20
    init_command: SET sql_mode='STRICT_TRANS_TABLES', default_storage_engine=INNODB, NAMES 'utf8', CHARACTER SET 'utf8', SESSION collation_connection = 'utf8_unicode_ci'

polemarch_uwsgi_config:
  section: uwsgi
  options:
    processes: 4
    threads: 4
    harakiri: 120
    vacuum: True
    pidfile: '{{ polemarch_main_dir }}/pid/polemarch.pid'
    log_file: '{{ polemarch_main_dir }}/logs/{PROG_NAME}_web.log'

polemarch_worker_config:
  section: worker
  options:
    logfile: '{{ polemarch_main_dir }}/logs/{PROG_NAME}_worker.log'
    pidfile: '{{ polemarch_main_dir }}/pid/{PROG_NAME}_worker.pid'
    loglevel: INFO

polemarch_cache_config: {}
# section: cache
# options:
#   backend: django_redis.cache.RedisCache
#   location: redis://127.0.0.1:6379/1

polemarch_locks_config: {}
# section: locks
# options:
#   backend: django_redis.cache.RedisCache
#   location: redis://127.0.0.1:6379/2

polemarch_rpc_config: {}
# section: rpc
# options:
#   connection:
#   heartbeat: 5
#   concurrency: 8
#   enable_worker: true

Dependencies

  • geerlingguy.repo-epel
  • cloudweeb.mariadb
  • geerlingguy.redis (Optional)
  • cloudweeb.polemarch

Example Playbook

Installing Polemarch with standard installation

---
- name: Converge
  hosts: all

  vars:

    polemarch_db_name: polemarch_db
    polemarch_db_user: polemarch_user
    polemarch_db_pass: password

    polemarch_database_config:
      section: database
      options:
        engine: django.db.backends.mysql
        name: '{{ polemarch_db_name }}'
        user: '{{ polemarch_db_user }}'
        password: '{{ polemarch_db_pass }}'

    mariadb_root_password: "{{ lookup('password', '/tmp/mariadb_root_password length=15 chars=ascii_letters,digits,hexdigits') }}"

    mariadb_packages:
      - MariaDB-shared

    mariadb_databases:
      - name: '{{ polemarch_db_name }}'
        state: present

    mariadb_users:
      - name: '{{ polemarch_db_user }}'
        password: '{{ polemarch_db_pass }}'
        priv: "{{ polemarch_db_name }}.*:ALL"
        state: present

  roles:

    - role: geerlingguy.repo-epel
      when: ansible_os_family == 'RedHat'

    - cloudweeb.mariadb

    - cloudweeb.polemarch

Installing Polemarch with redis cache

---
- name: Converge
  hosts: all

  vars:

    polemarch_db_name: polemarch_db
    polemarch_db_user: polemarch_user
    polemarch_db_pass: password

    polemarch_database_config:
      section: database
      options:
        engine: django.db.backends.mysql
        name: '{{ polemarch_db_name }}'
        user: '{{ polemarch_db_user }}'
        password: '{{ polemarch_db_pass }}'

    mariadb_root_password: "{{ lookup('password', '/tmp/mariadb_root_password length=15 chars=ascii_letters,digits,hexdigits') }}"

    mariadb_packages:
      - MariaDB-shared

    mariadb_databases:
      - name: '{{ polemarch_db_name }}'
        state: present

    mariadb_users:
      - name: '{{ polemarch_db_user }}'
        password: '{{ polemarch_db_pass }}'
        priv: "{{ polemarch_db_name }}.*:ALL"
        state: present

    polemarch_cache_config:
      section: cache
      options:
        backend: django_redis.cache.RedisCache
        location: redis://127.0.0.1:6379/1

  roles:

    - role: geerlingguy.repo-epel
      when: ansible_os_family == 'RedHat'

    - cloudweeb.mariadb

    - geerlingguy.redis

    - cloudweeb.polemarch

License

MIT

Author Information

Agnesius Santo Naibaho

cloudweeb.polemarch's People

Contributors

spearcrow avatar tosabyte avatar

Watchers

 avatar  avatar

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.