No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
.travis.yml
README.md
deploy.yml
inventory.ini
requirements.yml
rollback.yml

README.md

ansible-deploy

Build Status

Ansible abstraction for deploy tasks.

Ansible Deploy structure

Allows to deploy project dist with various methods. Contains reference to three main roles

Role Variables

Available variables are listed below, along with example values (see deploy.yml):

deploy:
  project:
    root: '/tmp/test_deploy'
    name: 'My Project'
    scm: 'rsync'
    source: "dist"
    keep_previous_releases: 3
    copy_previous_release: True
    writable_dirs:
      - src: "var/files"
    shared_dirs:
      - "var/files"
    shared_files: []
    templated_files:
      -
        source: "config/settings.ini.j2"
        dest: "config/settings.ini"
        owner: "{{ ansible_user }}"
        group: "{{ ansible_user }}"
  finalize:
    required_sudo: False
    commands: []
    to_be_restarted_services: []
permission_model: 'chmod'


deploy.project.root: '/tmp/test_deploy'

Destination project directory.

deploy.project.name: 'My project'

Identifies project name

deploy.project.scm: 'rsync'
#or
deploy.project.scm: 'archive'

Identifies project deploy method. Could be chosen from (rsync|git|archive). Make sure your target meets software requirements. git or rsync or tar,unzip are instaled.

deploy.project.rsync_opts: 
    - '--exclude=excluded_dir'

Allows to define additional rsync options (only applicable in case when rsync is used as deploy method)

deploy.project.source: 'dist'

Identifies project distribution source. Could be relative or absolute ('/home/jkanclerz/projects/foo/dist')

deploy.project.keep_previous_releases: 3

Identifies how many previous releases are kept on your target. Role will remove all other previous releases. Keep just choosen amount.

deploy.project.copy_previous_release: True

Force to copy currently used release as copy that is updated at code update stage. Increase speed of code updating. If switched off then builded dist is fully copied as next release.

deploy.project.writable_dirs:
	- src: "var/files"

Allows define which directories should be writable for web server user.

deploy.project.shared_dirs:
	- "var/files"

Allows define which directories should be shared between releases

deploy.project.shared_files:
	- "config/settings.yml"

Allows define which files should be shared between releases

deploy.project.templated_files:
    -
        source: "config/settings.ini.j2"
        dest: "config/settings.ini"
        owner: "{{ ansible_user }}"
        group: "{{ ansible_user }}"

Allows define which files should be copied from local stored template.

deploy.finalize.required_sudo: True

Define if sudo is required to perform finalization tasks

deploy.finalize.commands:
	- 'echo "deploy finished"'

Define define commands to be executed after finished deploy

deploy.finalize.to_be_restarted_services:
	- 'nginx'
	- 'my_app_service'

Define define services that should be restarted after finished deploy

Ansible Rollback

Allows to rollback project deployed via above roles

Role Variables

Available variables are listed below, along with example values (see rollback.yml):

deploy:
  project:
    root: '/tmp/test_deploy'

License

MIT / BSD

Author Information

Created by Jakub Kanclerz and Others