Giter VIP home page Giter VIP logo

stouts.source's Introduction

Stouts.source

Build Status Galaxy Tag

Ansible role wich manage sources from git or mercurial repositoires.

The role is allowing you to clone sources from git or mercurial repositories to your servers and run handlers when it was updated.

Variables

source_enabled: yes                   # Enable role
source_sources: []                    # Repositories to clone
                                      # Define your sources here
                                      # Ex: source_sources:
                                        #   - repo: [email protected]:my/repo1.git
                                        #     dest: /some/destination/path
                                        #     version: develop
                                        #     handlers:
                                        #     - sudo restart myservice
                                        #   - repo: [email protected]:my/repo2.git
                                        #     dest: /some/another/path
                                        #     version: master
                                        #     handlers:
                                        #     - cd /some/another/path && make static db
                                        #     - sudo /etc/init.d/service restart

source_sources_type: git              # Set repository type (git, hg)
source_copy_keys: []                  # Copy defined key files from host to server in ~/.ssh/*
source_ssh_keys: []                   # Copy keys from variables
                                      #   source_ssh_keys:
                                      #   - file_name: deploy
                                      #     private_key: "KEY CONTENT"
source_user: "{{ansible_ssh_user}}"   # Run from user
source_group: "{{source_user}}"       # Run from user
source_user_ssh_home: ~{{source_user}}/.ssh

# Repository defaults (could be replaced individually)
source_default_dest: ""               # Default destination
source_default_force: yes             # Default force
source_default_accept_hostkey: yes    # Accept hostkey (git)
source_default_bare: no               # Clone bare by default (git)
source_default_key_file: ""           # Default key file (git)
source_default_recursive: yes         # Clone recursivly by default (git)
source_default_remote: origin         # Default remote name (git)
source_default_ssh_opts:              # Default ssh options (git)
source_default_version: HEAD          # Default version (branch, tag, commit) (git)
source_default_revision: default      # Default revision (branch, tag, commit) (hg)
source_default_purge: no              # Default purge (hg)

source_fingerprints:
- "bitbucket.org,131.103.20.167 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw=="
- "github.com,204.232.175.90 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ=="

Usage

Add Stouts.source to your roles and set vars in your playbook file.

Example:

- hosts: all

  roles:
    - Stouts.source

  vars:
    source_copy_keys:
     - "{{inventory_dir}}/keys/deploy_key"
    source_sources:
    - repo: https://github.com/Dipsomaniac/dj-simple.git
      dest: /usr/lib/simple/source
      key_file: "/home/{{ansible_ssh_user}}/.ssh/deploy_key"
      version: "develop"
      handlers:
      - reload uwsgi

See git-module and hg-module for source params.

License

Licensed under the MIT License. See the LICENSE file for details.

Feedback, bug-reports, requests, ...

Are welcome!

stouts.source's People

Contributors

elvistheking avatar klen avatar

Stargazers

 avatar  avatar  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.