Giter Site home page Giter Site logo

ansible-flyway's Introduction

flyway

Installs and configures flyway commandline tool from http://flywaydb.org/getstarted/download.html. It installs files to /opt/flyway and creates symlink from /usr/bin/flyway to the binary in the /opt/flyway.

Requirements

Ansible 1.4+. You'll need java on the host to use flyway, but role will succeed even without java.

Role Variables

All variables are optional

  • fly_version: (default: "3.1")
  • flyway_download_url: (default: "http://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/%s/flyway-commandline-%s.tar.gz")
  • flyway_root: (default: /opt/flyway)
  • flyway_config:
    • database:
      • dbms: (Tested with postgress and oracle)
      • host: db hostname or IP
      • port: 5432
      • name: database name
      • user: username
      • password: password for username
    • schemas: schemas to manage
  • flyway_table: flyway table (default schema_history)
  • flyway_locations: path to sql migrations

Dependencies

None

Example Playbook (postgres)

- hosts: javadb
  roles:
     - { role: flyway }
  vars:
     - flyway_root: /opt/flyway
     - flyway_config:
        database: 
          host: localhost
          port 5432
          dbms: postgesql
          name: example
          user: postgres
          password: postgres
        schemas: public, myschema
     - flyway_locations: /opt/migrations/

Example Playbook (Oracle)

- hosts: oracledb
  roles:
     - { role: flyway }
  vars:
    - flyway_driver: oracle.jdbc.OracleDriver
    - flyway_config:
       database:
       dbms: oracle
       host: localhost
       port: 1521
       name: XE
       user: APP
       password: appsecret
       schemas: APP
    - flyway_locations: filesystem:/opt/migrations/full,filesystem:/opt/migrations/demo

Configuration tested with Oracle XE 11.

Note: you need to copy the driver jar to flyway:

- name: Copy Oracle JDBC driver to machine Flyway folder
  copy: src=./lib/ojdbc6-11.1.0.7.0.jar dest=/opt/flyway/flyway-{{ flyway_version }}/drivers
  sudo: yes

License

BSD

Author Information

(c) George Shuklin, rastaman 2015

ansible-flyway's People

Contributors

amarao avatar gpouilloux avatar rastaman 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.