Use variables

This commit is contained in:
Oliver Davies 2019-01-22 21:04:37 +00:00
parent 5b4c91091e
commit 57e8aa59fa
3 changed files with 10 additions and 4 deletions

View file

@ -2,18 +2,21 @@
- hosts: dransible
become: true
vars_files:
- ../../vars/vars.yml
tasks:
- name: Creating project directory
file:
path: /var/www/app
path: "{{ app_project_root }}"
state: directory
- name: Uploading application
synchronize:
src: ../../../../
dest: /var/www/app
dest: "{{ app_project_root }}"
- name: Installing Composer dependencies
composer:
command: install
working_dir: /var/www/app
working_dir: "{{ app_project_root }}"

View file

@ -1,7 +1,7 @@
---
apache_vhosts:
- servername: dransible
documentroot: "/var/www/app/web"
documentroot: "{{ app_project_docroot }}"
php_packages:
- libapache2-mod-php{{ php_default_version_debian }}

View file

@ -1,4 +1,7 @@
---
app_project_root: /var/www/app
app_project_docroot: "{{ app_project_root }}/web"
app_db_name: "{{ vault_app_db_name }}"
app_db_user: "{{ vault_app_db_user }}"
app_db_password: "{{ vault_app_db_password }}"