Download:
child 39:28ad6d3e2618
parent 37:16b1f46f4cbf
38:91e692b46f92
Anton Shestakov <av6@dwimlabs.net>, Tue, 22 Mar 2016 20:54:38 +0800
provision: run as user 'vagrant' by default to remove synced_folder hack

4 файлов изменено, 7 вставок(+), 9 удалений(-) [+]
contrib/Vagrantfile file | annotate | diff | comparison | revisions
contrib/provision/roles/tram-im/tasks/main.yml file | annotate | diff | comparison | revisions
contrib/provision/roles/tram-im/templates/etc/nginx/sites-available/tram-im file | annotate | diff | comparison | revisions
contrib/provision/roles/tram-im/vars/main.yml file | annotate | diff | comparison | revisions
--- a/contrib/Vagrantfile Tue Mar 22 19:52:35 2016 +0800
+++ b/contrib/Vagrantfile Tue Mar 22 20:54:38 2016 +0800
@@ -4,11 +4,7 @@
config.vm.network "private_network", ip: "192.168.33.111"
config.vm.network "forwarded_port", guest: 443, host: 21443
- # disabled because we don't need it
- config.vm.synced_folder ".", "/vagrant", disabled: true
-
- # disabled because user/group don't exist on the first run yet
- config.vm.synced_folder "..", "/home/tram-im/tram-im/", owner: "tram-im", group: "tram-im", mount_options: ["dmode=755,fmode=644"], disabled: true
+ config.vm.synced_folder "..", "/vagrant", mount_options: ["dmode=755,fmode=644"]
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cpus", "1"]
--- a/contrib/provision/roles/tram-im/tasks/main.yml Tue Mar 22 19:52:35 2016 +0800
+++ b/contrib/provision/roles/tram-im/tasks/main.yml Tue Mar 22 20:54:38 2016 +0800
@@ -10,11 +10,11 @@
tags: [packages]
- name: Create user
- user: name=tram-im
+ user: name={{ user }}
-- include: appinstall.yml dir=/home/tram-im/tram-im/
+- include: appinstall.yml
sudo: yes
- sudo_user: tram-im
+ sudo_user: '{{ user }}'
- name: Add Prosody VirtualHost
template: src=etc/prosody/conf.avail/tram-im.cfg.lua dest=/etc/prosody/conf.avail/{{ domain }}.cfg.lua
--- a/contrib/provision/roles/tram-im/templates/etc/nginx/sites-available/tram-im Tue Mar 22 19:52:35 2016 +0800
+++ b/contrib/provision/roles/tram-im/templates/etc/nginx/sites-available/tram-im Tue Mar 22 20:54:38 2016 +0800
@@ -47,7 +47,7 @@
keepalive_timeout 5;
location / {
- root /home/tram-im/tram-im;
+ root {{ dir }};
expires max;
access_log off;
}
--- a/contrib/provision/roles/tram-im/vars/main.yml Tue Mar 22 19:52:35 2016 +0800
+++ b/contrib/provision/roles/tram-im/vars/main.yml Tue Mar 22 20:54:38 2016 +0800
@@ -1,4 +1,6 @@
---
ssl_cert: /etc/ssl/selfsigned/{{ domain }}/selfsigned.pem
ssl_key: /etc/ssl/selfsigned/{{ domain }}/clean.key
+dir: /vagrant/
+user: vagrant
...