diff --git a/data/vagrant/Vagrantfile b/data/vagrant/Vagrantfile index 73bc0bff8..69d23558d 100644 --- a/data/vagrant/Vagrantfile +++ b/data/vagrant/Vagrantfile @@ -54,7 +54,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # View the documentation for the provider you're using for more # information on available options. config.vm.provision "ansible" do |ansible| - ansible.playbook = "ansible_golang_release.yml" + ansible.playbook = "cgrates_release.yml" #ansible.verbose = "vvvv" end end diff --git a/data/vagrant/bashrc b/data/vagrant/bashrc index 5695ae03e..5bf6f20a2 100644 --- a/data/vagrant/bashrc +++ b/data/vagrant/bashrc @@ -110,6 +110,6 @@ if ! shopt -oq posix; then fi export GOROOT=$HOME/go -export GOPATH=$HOME/go_home +export GOPATH=$HOME/code export PATH=$PATH:$GOROOT/bin:$GOPATH/bin diff --git a/data/vagrant/ansible_golang_release.yml b/data/vagrant/cgrates_devel.yml similarity index 80% rename from data/vagrant/ansible_golang_release.yml rename to data/vagrant/cgrates_devel.yml index 2c499a6dc..da255369a 100644 --- a/data/vagrant/ansible_golang_release.yml +++ b/data/vagrant/cgrates_devel.yml @@ -33,23 +33,11 @@ - freeswitch-meta-vanilla - freeswitch-mod-json-cdr - - name: add cgrates apt-key - apt_key: url=http://apt.itsyscom.com/conf/cgrates.gpg.key state=present - - - name: add cgrates repo - apt_repository: repo='deb http://apt.itsyscom.com/debian wheezy main' state=present - - - name: install cgrates - apt: pkg=cgrates update_cache=yes state=latest - - name: update mysql root password for root account mysql_user: name=root host=localhost password={{ root_db_password }} - name: copy .my.cnf template: src=my.cnf dest=/root/.my.cnf mode=0600 - - - name: setup database tables - shell: chdir=/usr/share/cgrates/storage/mysql ./setup_cgr_db.sh root {{ root_db_password }} localhost - hosts: all user: vagrant @@ -68,4 +56,14 @@ copy: src=bashrc dest=~/.bashrc - name: get cgrates - shell: GOROOT=~/go GOPATH=~/go_home ~/go/bin/go get -u -v github.com/cgrates/cgrates + shell: GOROOT=~/go GOPATH=~/code ~/go/bin/go get -u -v github.com/cgrates/cgrates + + - name: create a link to data dir + file: src=~/code/src/github.com/cgrates/cgrates/data dest=/usr/share/cgrates state=symlink + + - name: setup database tables + shell: chdir=/usr/share/cgrates/storage/mysql ./setup_cgr_db.sh root {{ root_db_password }} localhost + + - name: create link to cgrates dir + file: src=~/code/src/github.com/cgrates/cgrates dest=~/cgr state=symlink + diff --git a/data/vagrant/cgrates_release.yml b/data/vagrant/cgrates_release.yml new file mode 100644 index 000000000..540d0f0b6 --- /dev/null +++ b/data/vagrant/cgrates_release.yml @@ -0,0 +1,51 @@ +--- + +- hosts: all + user: vagrant + sudo: yes + vars: + root_db_password: CGRateS.org + + tasks: + - name: install dependency + apt: pkg={{ item }} state=latest + with_items: + - git + - redis-server + - mysql-server + - python-mysqldb + + - name: add freeswitch gpg key + command: gpg --keyserver pool.sks-keyservers.net --recv-key D76EDC7725E010CF + + - name: add freeswitch apt key + shell: gpg -a --export D76EDC7725E010CF | sudo apt-key add - + + - name: add freeswitch apt repo + apt_repository: repo='deb http://files.freeswitch.org/repo/deb/debian/ wheezy main' state=present + + - name: install freeswitch + apt: pkg={{ item }} update_cache=yes state=latest + with_items: + - freeswitch-meta-vanilla + - freeswitch-mod-json-cdr + + - name: add cgrates apt-key + apt_key: url=http://apt.itsyscom.com/conf/cgrates.gpg.key state=present + + - name: add cgrates repo + apt_repository: repo='deb http://apt.itsyscom.com/debian wheezy main' state=present + + - name: install cgrates + apt: pkg=cgrates update_cache=yes state=latest + + - name: update mysql root password for root account + mysql_user: name=root host=localhost password={{ root_db_password }} + + - name: copy .my.cnf + template: src=my.cnf dest=/root/.my.cnf mode=0600 + + - name: setup database tables + shell: chdir=/usr/share/cgrates/storage/mysql ./setup_cgr_db.sh root {{ root_db_password }} localhost + +