Coder Social home page Coder Social logo

ansible-role-db-assets-tasks's Introduction

ATTENTION: This repository is archived and therefore readonly.

Ansible DB & ASSETS Tasks

Adds DB & ASSETS Tasks to any project like pull, push and synchronize, based on Ansible. This project is heavily inspired by its ruby version.

Installation

DB & ASSETS Tasks is an Ansible role distributed globally using Ansible Galaxy. In order to install DB & ASSETS Tasks role you can use the following command.

$ ansible-galaxy install artack.db_assets_tasks

Update

If you want to update the role, you need to pass --force parameter when installing. Please, check the following command:

$ ansible-galaxy install --force artack.db_assets_tasks

Setup

Inventory

Define two hosts (dat_remote and dat_local) in a group dat. Use whatever connection settings are needed in your very own setup (i use vagrant here).

[dat]
dat_remote  ansible_host=remote-host.example.com    ansible_user=remote-user    ansible_port=1337
dat_local   ansible_host=192.168.0.100              ansible_user=vagrant        ansible_ssh_pass=vagrant

Playbook

- name: DAT Example playbook
  hosts: dat # The group from the inventory file
  vars:
  
    dat_db_name: xmas-web
    dat_assets_dir: # paths must end with a directory separator (/)
      -
        local: /vagrant/files/xmas/
        remote: ~/public_html/shared/files/xmas/

  vars_prompt:
    - name: dat_action
      prompt: "Enter an action to perform ({{ dat_allowed_tasks|join(' | ') }})"
      private: no

  roles:
    - { role: roles/ansible-db-assets-tasks } // TODO: Replace with galaxy role

Variables

# To remove the local dump after using
dat_db_local_clean: true

# To remove the remote dump after using
dat_db_remote_clean: true

# To specify the temp directory wher the dump is saved
dat_db_temp_dir: /tmp/.db

# To disallow any push to the remote (maybe productive) server
dat_disallow_pushing: false

# To specify the local & remote dirs to be synced - ATTENTION: Must end with a directory separator (/)
dat_assets_dir: []

Available Tasks

app:pull    # Synchronize your local database & assets using remote data
app:push    # Synchronize your remote database & assets using local data

assets:pull # Synchronize your local assets using remote assets data
assets:push # Synchronize your remote assets using local assets data

db:pull     # Synchronize your local database using remote database data
db:push     # Synchronize your remote database using local database data

ansible-role-db-assets-tasks's People

Contributors

scuben avatar

Watchers

 avatar

ansible-role-db-assets-tasks's Issues

How to specify DB username and password?

Coming from Capistrano, this seems a pretty great alternative. However, I went through the code and I did not see any way to configure the db hostname, username and password? How does it authenticate with the db? Thanks!

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.