Skip to content

Commit

Permalink
modif ansible: copy database.yml in shared dir on server
Browse files Browse the repository at this point in the history
  • Loading branch information
franck committed Oct 21, 2014
1 parent e00a149 commit e844ce3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions ansible/group_vars/local.yml
Expand Up @@ -4,4 +4,5 @@ app_db_name: barbier_dev

nginx_server_name: "{{ hostname }}"
app_public_path: "/var/www/{{ app_name }}/local/current/public"
app_shared_path: "/var/www/{{ app_name }}/local/shared"

21 changes: 20 additions & 1 deletion ansible/roles/app/tasks/main.yml
Expand Up @@ -61,6 +61,26 @@
tags:
- app

- name: Create shared directory
file: >
state=directory
mode=0711
owner={{ app_user }}
group={{ app_user }}
path={{ app_shared_path }}
tags:
- app

- name: Copy database.yml
copy: >
src={{ playbook_dir }}/../../config/database.yml
dest={{ app_shared_path }}/config/database.yml
mode=0600
owner={{ app_user }}
group={{ app_user }}
tags:
- app

- name: send key to remote deploy user
copy: >
src=private_key
Expand All @@ -69,7 +89,6 @@
tags:
- app


- name: add ssh priv_key to ssh config (line 1)
lineinfile:
dest: /home/{{ app_user }}/.ssh/config
Expand Down
2 changes: 1 addition & 1 deletion config/deploy.rb
Expand Up @@ -14,7 +14,7 @@

set :linked_files, %w{config/database.yml}

set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
Expand Down

0 comments on commit e844ce3

Please sign in to comment.