├── .gitignore ├── test ├── inventory ├── symfony_43.yml ├── symfony_44.yml ├── symfony_50.yml └── symfony_34.yml ├── config ├── steps │ ├── empty.yml │ ├── assets.yml │ ├── assetic.yml │ ├── mongodb.yml │ ├── doctrine.yml │ ├── cache.yml │ └── composer.yml ├── after_update_code.yml └── after_symlink_shared.yml ├── vars └── main.yml ├── meta └── main.yml ├── LICENSE ├── defaults └── main.yml ├── .travis.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | meta/.galaxy_install_info 2 | -------------------------------------------------------------------------------- /test/inventory: -------------------------------------------------------------------------------- 1 | localhost ansible_connection=local 2 | -------------------------------------------------------------------------------- /config/steps/empty.yml: -------------------------------------------------------------------------------- 1 | # This file is intentionally left empty and it is used in those Capistrano flow steps 2 | # where you don't need to execute any custom tasks 3 | -------------------------------------------------------------------------------- /config/after_update_code.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Make way for shared paths / resources shared across releases 3 | file: 4 | state=absent 5 | path={{ansistrano_release_path.stdout}}/{{item}} 6 | with_items: ansistrano_shared_paths 7 | -------------------------------------------------------------------------------- /config/steps/assets.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install assets 3 | shell: chdir={{ansistrano_release_path.stdout}} 4 | SYMFONY_ENV={{symfony_env}} APP_ENV={{symfony_env}} {{symfony_php_path}} {{symfony_console_path}} assets:install {{ symfony_assets_options }} 5 | -------------------------------------------------------------------------------- /config/steps/assetic.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Dump assetic assets 3 | shell: chdir={{ansistrano_release_path.stdout}} 4 | SYMFONY_ENV={{symfony_env}} APP_ENV={{symfony_env}} {{symfony_php_path}} {{symfony_console_path}} assetic:dump {{ symfony_assetic_options }} 5 | -------------------------------------------------------------------------------- /vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ansistrano_after_update_code_tasks_file: "../../cbrunnkvist.ansistrano-symfony-deploy/config/after_update_code.yml" 3 | ansistrano_after_symlink_shared_tasks_file: "../../cbrunnkvist.ansistrano-symfony-deploy/config/after_symlink_shared.yml" 4 | -------------------------------------------------------------------------------- /config/steps/mongodb.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Update MongoDB schema 3 | shell: chdir={{ansistrano_release_path.stdout}} 4 | SYMFONY_ENV={{symfony_env}} APP_ENV={{symfony_env}} {{symfony_php_path}} {{symfony_console_path}} doctrine:mongodb:schema:update {{symfony_mongodb_options}} 5 | -------------------------------------------------------------------------------- /config/steps/doctrine.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Run Doctrine migrations 3 | shell: chdir={{ansistrano_release_path.stdout}} 4 | SYMFONY_ENV={{symfony_env}} APP_ENV={{symfony_env}} {{symfony_php_path}} {{symfony_console_path}} doctrine:migrations:migrate --no-interaction {{symfony_doctrine_options}} 5 | -------------------------------------------------------------------------------- /meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | dependencies: 3 | - ansistrano.deploy 4 | 5 | galaxy_info: 6 | author: Conny Brunnkvist 7 | description: Common post-deploy tasks for Symfony projects 8 | license: MIT 9 | min_ansible_version: 2.6 10 | platforms: 11 | - name: GenericUNIX 12 | versions: 13 | - any 14 | 15 | galaxy_tags: 16 | - web 17 | - ansistrano 18 | - deploy 19 | - deployment 20 | - symfony 21 | -------------------------------------------------------------------------------- /config/steps/cache.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Clear cache 3 | shell: chdir={{ansistrano_release_path.stdout}} 4 | SYMFONY_ENV={{symfony_env}} APP_ENV={{symfony_env}} {{symfony_php_path}} {{symfony_console_path}} cache:clear --no-warmup {{symfony_cache_options}} 5 | 6 | - name: Warm-up cache 7 | shell: chdir={{ansistrano_release_path.stdout}} 8 | SYMFONY_ENV={{symfony_env}} APP_ENV={{symfony_env}} {{symfony_php_path}} {{symfony_console_path}} cache:warmup {{symfony_cache_options}} 9 | -------------------------------------------------------------------------------- /test/symfony_43.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: TEST | symfony 4.3 3 | hosts: localhost 4 | gather_facts: false 5 | 6 | vars: 7 | ansistrano_deploy_to: /tmp/sf43 8 | ansistrano_deploy_via: git 9 | ansistrano_git_repo: https://github.com/symfony/skeleton.git 10 | ansistrano_git_branch: 4.3 11 | 12 | symfony_php_path: php7.4 13 | symfony_console_path: 'bin/console' 14 | symfony_run_assetic_dump: false 15 | 16 | ansistrano_allow_anonymous_stats: false 17 | 18 | roles: 19 | - cbrunnkvist.ansistrano-symfony-deploy 20 | -------------------------------------------------------------------------------- /test/symfony_44.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: TEST | symfony 4.4 3 | hosts: localhost 4 | gather_facts: false 5 | 6 | vars: 7 | ansistrano_deploy_to: /tmp/sf44 8 | ansistrano_deploy_via: git 9 | ansistrano_git_repo: https://github.com/symfony/skeleton.git 10 | ansistrano_git_branch: 4.4 11 | 12 | symfony_php_path: php7.4 13 | symfony_console_path: 'bin/console' 14 | symfony_run_assetic_dump: false 15 | 16 | ansistrano_allow_anonymous_stats: false 17 | 18 | roles: 19 | - cbrunnkvist.ansistrano-symfony-deploy 20 | -------------------------------------------------------------------------------- /test/symfony_50.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: TEST | symfony 5.0 3 | hosts: localhost 4 | gather_facts: false 5 | 6 | vars: 7 | ansistrano_deploy_to: /tmp/sf50 8 | ansistrano_deploy_via: git 9 | ansistrano_git_repo: https://github.com/symfony/skeleton.git 10 | ansistrano_git_branch: 5.0 11 | 12 | symfony_php_path: php7.4 13 | symfony_console_path: 'bin/console' 14 | symfony_run_assetic_dump: false 15 | 16 | ansistrano_allow_anonymous_stats: false 17 | 18 | roles: 19 | - cbrunnkvist.ansistrano-symfony-deploy 20 | -------------------------------------------------------------------------------- /test/symfony_34.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: TEST | symfony 3.4 3 | hosts: localhost 4 | gather_facts: false 5 | 6 | vars: 7 | ansistrano_deploy_to: /tmp/sf34 8 | ansistrano_deploy_via: git 9 | ansistrano_git_repo: https://github.com/symfony/symfony-standard.git 10 | ansistrano_git_branch: 3.4 11 | 12 | symfony_php_path: php7.4 13 | symfony_console_path: 'bin/console' 14 | symfony_run_assetic_dump: false 15 | 16 | ansistrano_allow_anonymous_stats: false 17 | 18 | roles: 19 | - cbrunnkvist.ansistrano-symfony-deploy 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | symfony_env: prod 3 | symfony_php_path: php # The PHP executable to use for all command line tasks 4 | 5 | symfony_run_composer: true 6 | symfony_composer_path: "{{ ansistrano_deploy_to }}/composer.phar" 7 | symfony_composer_options: '--no-dev --optimize-autoloader --no-interaction' 8 | symfony_composer_self_update: true # Always attempt a composer self-update 9 | 10 | symfony_run_assets_install: true 11 | symfony_assets_options: '--no-interaction' 12 | 13 | symfony_run_assetic_dump: true 14 | symfony_assetic_options: '--no-interaction' 15 | 16 | symfony_run_cache_clear_and_warmup: true 17 | symfony_cache_options: '' 18 | 19 | symfony_console_path: 'app/console' 20 | 21 | ############################################################################### 22 | # Enable the schema/migration tasks ONLY if you have 1 and only 1 host in your 23 | # inventory, since running migrations in parallel might lead to data corruption. 24 | # (see README.md for more details) 25 | ############################################################################### 26 | symfony_run_doctrine_migrations: false 27 | symfony_doctrine_options: '--no-interaction' 28 | 29 | symfony_run_mongodb_schema_update: false 30 | symfony_mongodb_options: '' 31 | -------------------------------------------------------------------------------- /config/steps/composer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Check for composer.phar 3 | stat: path={{symfony_composer_path}} 4 | register: composer_file 5 | 6 | - name: Run composer self-update 7 | shell: "{{symfony_composer_path}} selfupdate --no-interaction" 8 | when: composer_file.stat.exists and symfony_composer_self_update|bool 9 | register: composer_self_update_result 10 | changed_when: composer_self_update_result.stderr is search('Updating') 11 | 12 | - name: Install stable composer 13 | get_url: url=https://getcomposer.org/composer-stable.phar dest={{symfony_composer_path}} mode=0755 validate_certs=no force=no 14 | when: symfony_composer_version is not defined and symfony_composer_channel is not defined 15 | 16 | - name: Install composer {{symfony_composer_version}} 17 | get_url: url=https://getcomposer.org/download/{{symfony_composer_version}}/composer.phar dest={{symfony_composer_path}} mode=0755 validate_certs=no force=no 18 | when: symfony_composer_version is defined 19 | 20 | - name: Install composer installer 21 | get_url: url=https://getcomposer.org/installer dest={{ansistrano_deploy_to}}/composer-installer.php mode=0755 validate_certs=no force=no 22 | when: symfony_composer_channel is defined 23 | 24 | - name: Install composer {{symfony_composer_channel}} 25 | shell: 26 | cmd: "{{symfony_php_path}} composer-installer.php --quiet --{{symfony_composer_channel}}" 27 | chdir: "{{ansistrano_deploy_to}}" 28 | when: symfony_composer_channel is defined 29 | 30 | - name: Run composer install 31 | shell: chdir={{ansistrano_release_path.stdout}} 32 | export SYMFONY_ENV={{symfony_env}} APP_ENV={{symfony_env}} && {{symfony_php_path}} {{symfony_composer_path}} install {{symfony_composer_options}} 33 | register: composer_install_result 34 | changed_when: composer_install_result.stderr is search('- \w+ing ') 35 | -------------------------------------------------------------------------------- /config/after_symlink_shared.yml: -------------------------------------------------------------------------------- 1 | - include_tasks: "{{ ansistrano_symfony_before_composer_tasks_file | default('steps/empty.yml') }}" 2 | 3 | - import_tasks: "../../cbrunnkvist.ansistrano-symfony-deploy/config/steps/composer.yml" 4 | when: symfony_run_composer|bool 5 | 6 | - include_tasks: "{{ ansistrano_symfony_after_composer_tasks_file | default('steps/empty.yml') }}" 7 | 8 | - include_tasks: "{{ ansistrano_symfony_before_assets_tasks_file | default('steps/empty.yml') }}" 9 | 10 | - import_tasks: "../../cbrunnkvist.ansistrano-symfony-deploy/config/steps/assets.yml" 11 | when: symfony_run_assets_install|bool 12 | 13 | - include_tasks: "{{ ansistrano_symfony_after_assets_tasks_file | default('steps/empty.yml') }}" 14 | 15 | - include_tasks: "{{ ansistrano_symfony_before_assetic_tasks_file | default('steps/empty.yml') }}" 16 | 17 | - import_tasks: "../../cbrunnkvist.ansistrano-symfony-deploy/config/steps/assetic.yml" 18 | when: symfony_run_assetic_dump|bool 19 | 20 | - include_tasks: "{{ ansistrano_symfony_after_assetic_tasks_file | default('steps/empty.yml') }}" 21 | 22 | - include_tasks: "{{ ansistrano_symfony_before_cache_tasks_file | default('steps/empty.yml') }}" 23 | 24 | - import_tasks: "../../cbrunnkvist.ansistrano-symfony-deploy/config/steps/cache.yml" 25 | when: symfony_run_cache_clear_and_warmup|bool 26 | 27 | - include_tasks: "{{ ansistrano_symfony_after_cache_tasks_file | default('steps/empty.yml') }}" 28 | 29 | - include_tasks: "{{ ansistrano_symfony_before_doctrine_tasks_file | default('steps/empty.yml') }}" 30 | 31 | - import_tasks: "../../cbrunnkvist.ansistrano-symfony-deploy/config/steps/doctrine.yml" 32 | when: symfony_run_doctrine_migrations|bool 33 | 34 | - include_tasks: "{{ ansistrano_symfony_after_doctrine_tasks_file | default('steps/empty.yml') }}" 35 | 36 | - include_tasks: "{{ ansistrano_symfony_before_mongodb_tasks_file | default('steps/empty.yml') }}" 37 | 38 | - import_tasks: "../../cbrunnkvist.ansistrano-symfony-deploy/config/steps/mongodb.yml" 39 | when: symfony_run_mongodb_schema_update|bool 40 | 41 | - include_tasks: "{{ ansistrano_symfony_after_mongodb_tasks_file | default('steps/empty.yml') }}" 42 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: python 3 | python: "2.7" 4 | 5 | env: 6 | - ANSIBLE_VERSION: "2.6.20" 7 | SYMFONY_VERSION: 34 8 | PHP_VERSION: 7.4 9 | - ANSIBLE_VERSION: "2.7.16" 10 | SYMFONY_VERSION: 34 11 | PHP_VERSION: 7.4 12 | - ANSIBLE_VERSION: "2.8.10" 13 | SYMFONY_VERSION: 34 14 | PHP_VERSION: 7.4 15 | - ANSIBLE_VERSION: latest 16 | SYMFONY_VERSION: 34 17 | PHP_VERSION: 7.4 18 | - ANSIBLE_VERSION: "2.6.20" 19 | SYMFONY_VERSION: 43 20 | PHP_VERSION: 7.4 21 | - ANSIBLE_VERSION: "2.7.16" 22 | SYMFONY_VERSION: 43 23 | PHP_VERSION: 7.4 24 | - ANSIBLE_VERSION: "2.8.10" 25 | SYMFONY_VERSION: 43 26 | PHP_VERSION: 7.4 27 | - ANSIBLE_VERSION: latest 28 | SYMFONY_VERSION: 43 29 | PHP_VERSION: 7.4 30 | - ANSIBLE_VERSION: "2.6.20" 31 | SYMFONY_VERSION: 44 32 | PHP_VERSION: 7.4 33 | - ANSIBLE_VERSION: "2.7.16" 34 | SYMFONY_VERSION: 44 35 | PHP_VERSION: 7.4 36 | - ANSIBLE_VERSION: "2.8.10" 37 | SYMFONY_VERSION: 44 38 | PHP_VERSION: 7.4 39 | - ANSIBLE_VERSION: latest 40 | SYMFONY_VERSION: 44 41 | PHP_VERSION: 7.4 42 | - ANSIBLE_VERSION: "2.6.20" 43 | SYMFONY_VERSION: 50 44 | PHP_VERSION: 7.4 45 | - ANSIBLE_VERSION: "2.7.16" 46 | SYMFONY_VERSION: 50 47 | PHP_VERSION: 7.4 48 | - ANSIBLE_VERSION: "2.8.10" 49 | SYMFONY_VERSION: 50 50 | PHP_VERSION: 7.4 51 | - ANSIBLE_VERSION: latest 52 | SYMFONY_VERSION: 50 53 | PHP_VERSION: 7.4 54 | 55 | before_install: 56 | - sudo add-apt-repository -y ppa:ondrej/php 57 | - sudo apt-get update -qq 58 | - sudo apt-get -qq install php$PHP_VERSION-cli php$PHP_VERSION-xml 59 | - php$PHP_VERSION -v 60 | - php$PHP_VERSION -i 61 | 62 | install: 63 | - if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi 64 | - if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible-lint; fi 65 | - ansible --version 66 | - printf '[defaults]\nroles_path=../' > ansible.cfg 67 | - ln -s ./ansistrano-symfony-deploy ../cbrunnkvist.ansistrano-symfony-deploy 68 | - ansible-galaxy install ansistrano.deploy --force 69 | 70 | script: 71 | - ansible-playbook -i test/inventory test/symfony_$SYMFONY_VERSION.yml --syntax-check 72 | - ansible-playbook -i test/inventory test/symfony_$SYMFONY_VERSION.yml -vvvv 73 | 74 | notifications: 75 | webhooks: https://galaxy.ansible.com/api/v1/notifications/ 76 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ansistrano-symfony-deploy 2 | ========= 3 | 4 | [![Build Status](https://travis-ci.org/cbrunnkvist/ansistrano-symfony-deploy.svg?branch=master)](https://travis-ci.org/cbrunnkvist/ansistrano-symfony-deploy) 5 | 6 | A set of [Ansible](http://docs.ansible.com/) tasks for deploying PHP applications developed using the Symfony framework (incl. flex) onto *nix servers in a "Capistrano" fashion (releases, shared, current->releases/X). 7 | 8 | This role is more or less just a collection of the most common post-installation setup tasks (i.e. getting a Composer executable, installing dependencies and autoloader, perform cache warming, deploy migrations etc). It does not itself deal with setting up the directory structures or getting files onto your servers - that part is handled by the more generic `ansistrano-deploy` role. 9 | 10 | The way this is implemented is by defining a couple of the `ansistrano_(before|after)_X` vars (see the [ansistrano docs](https://github.com/ansistrano/deploy#main-workflow) for details). 11 | 12 | Requirements 13 | ------------ 14 | 15 | Due to shortcomings in the current version of Ansible, it __is__ a requirement that the `ansistrano-symfony-deploy` and `ansistrano-deploy` share the same parent directory. This will be the normal case so shouldn't be an issue as long as you install via `ansible-galaxy`. 16 | 17 | The tasks will _probably not_ work for Windows target hosts (untested). 18 | 19 | Role Variables 20 | -------------- 21 | 22 | The `defaults` vars declared in this module: 23 | 24 | ```YAML 25 | symfony_env: prod 26 | symfony_php_path: php # The PHP executable to use for all command line tasks 27 | 28 | symfony_console_path: 'app/console' # If using Symfony 3+ this should be 'bin/console' 29 | 30 | symfony_run_composer: true 31 | symfony_composer_path: "{{ ansistrano_deploy_to }}/composer.phar" 32 | symfony_composer_options: '--no-dev --optimize-autoloader --no-interaction' 33 | symfony_composer_self_update: true # Always attempt a composer self-update 34 | symfony_composer_version: 1.10.1 # Install specific composer version. If this variable is not set the latest stable version is installed 35 | symfony_composer_channel: 2.2 # (mutually exclusive to symfony_composer_version) Use the latest composer version from a specific release channel - see https://getcomposer.org/download/#download-channels for specifics 36 | 37 | symfony_run_assets_install: true 38 | symfony_assets_options: '--no-interaction' 39 | 40 | symfony_run_assetic_dump: true 41 | symfony_assetic_options: '--no-interaction' 42 | 43 | symfony_run_cache_clear_and_warmup: true 44 | symfony_cache_options: '' 45 | 46 | ############################################################################### 47 | symfony_run_doctrine_migrations: false 48 | symfony_doctrine_options: '--no-interaction' 49 | 50 | symfony_run_mongodb_schema_update: false 51 | symfony_mongodb_options: '' 52 | ``` 53 | 54 | Hooks 55 | ----- 56 | 57 | This role supports ansistrano like hooks before and after every task 58 | 59 | ```YAML 60 | ansistrano_symfony_before_composer_tasks_file 61 | ansistrano_symfony_after_composer_tasks_file 62 | 63 | ansistrano_symfony_before_assets_tasks_file 64 | ansistrano_symfony_after_assets_tasks_file 65 | 66 | ansistrano_symfony_before_assetic_tasks_file 67 | ansistrano_symfony_after_assetic_tasks_file 68 | 69 | ansistrano_symfony_before_cache_tasks_file 70 | ansistrano_symfony_after_cache_tasks_file 71 | 72 | ansistrano_symfony_before_doctrine_tasks_file 73 | ansistrano_symfony_after_doctrine_tasks_file 74 | 75 | ansistrano_symfony_before_mongodb_tasks_file 76 | ansistrano_symfony_after_mongodb_tasks_file 77 | 78 | ``` 79 | 80 | In addition to this, please also refer to the [list of variables used by ansistrano](https://github.com/ansistrano/deploy#role-variables). 81 | 82 | Note about ORM/ODM schema migrations 83 | ------------------------------------ 84 | 85 | Database schema migrations can generally NOT be run in parallel across multiple hosts! For this reason, the `symfony_run_doctrine_migrations` and `symfony_run_mongodb_schema_update` options both come turned off by default. 86 | 87 | In order to get around the parallel exection, you can do the following: 88 | 89 | 1. Specify your own `ansistrano_before_symlink_tasks_file`, perhaps with the one in this project as a template (look in cbrunnkvist.ansistrano-symfony-deploy/config/steps/). 90 | 2. Pick one of the following approaches: 91 | - (a) Organize hosts into groups such that the task will run on only the _first_ host in some group: 92 | `when: groups['www-production'][0] == inventory_hostname` 93 | - (b) Use the `run_once: true` perhaps with `delegate_to: some_primary_host` ([Docs: Playbook delegation](http://docs.ansible.com/ansible/playbooks_delegation.html#run-once)) 94 | 95 | Dependencies 96 | ------------ 97 | 98 | - [ansistrano.deploy](https://galaxy.ansible.com/ansistrano/deploy) 99 | 100 | Installing from the command line via `ansible-galaxy install cbrunnkvist.ansistrano-symfony-deploy` should pull down the external role as a dependency, so no extra step neccessary. 101 | 102 | Example playbook 103 | ---------------- 104 | 105 | As a bare minimum, you probably need to declare the `ansistrano_deploy_from` and `ansistrano_deploy_to` variables in your play. Ansistrano defaults to using rsync from a local directory (again, see the [ansistrano docs](https://github.com/ansistrano/deploy)). 106 | 107 | Let's assume there is a `my-app-infrastructure/deploy.yml`: 108 | ```YAML 109 | --- 110 | - hosts: all 111 | gather_facts: false 112 | vars: 113 | ansistrano_deploy_from: ../my-project-checkout 114 | ansistrano_deploy_to: /home/app-user/my-project-deploy/ 115 | ansistrano_before_symlink_tasks_file: "{{playbook_dir}}/config/app_specific_setup.yml" 116 | roles: 117 | - cbrunnkvist.ansistrano-symfony-deploy 118 | ``` 119 | 120 | This playbook should be executed like any other, i.e. `ansible-playbook -i some_hosts_file deploy.yml`. 121 | 122 | It probably makes sense to keep your one-off system prep tasks in a separate playbook, e.g. `my-app-infrastructure/setup.yml`. 123 | 124 | License 125 | ------- 126 | 127 | MIT 128 | 129 | Author Information 130 | ------------------ 131 | 132 | - ansistrano-symfony-deploy, written by Conny Brunnkvist 133 | - The underlying role is maintained by the `ansistrano-deploy` team 134 | - Some code was taken from/inspiried by the `symfony2-deploy` role by the Servergrove team 135 | --------------------------------------------------------------------------------