mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 02:56:24 +05:00
88 lines
2.7 KiB
YAML
88 lines
2.7 KiB
YAML
---
|
|
|
|
- hosts: all
|
|
user: vagrant
|
|
sudo: yes
|
|
vars:
|
|
root_db_password: CGRateS.org
|
|
|
|
tasks:
|
|
- name: install dependency
|
|
apt: pkg={{ item }} state=latest
|
|
with_items:
|
|
- git
|
|
- bzr
|
|
- redis-server
|
|
- mysql-server
|
|
- python-pycurl
|
|
- python-mysqldb
|
|
- mercurial
|
|
|
|
- name: add cgrates user
|
|
user: name=cgrates comment=CGRateS home=/var/run/cgrates shell=/bin/false system=yes
|
|
|
|
- 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: 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
|
|
|
|
- hosts: all
|
|
user: vagrant
|
|
vars:
|
|
root_db_password: CGRateS.org
|
|
go_version: 1.2.2
|
|
|
|
tasks:
|
|
- name: get golang
|
|
get_url: url=https://storage.googleapis.com/golang/go{{ go_version }}.linux-amd64.tar.gz dest=~/go{{ go_version }}.linux-amd64.tar.gz
|
|
|
|
- name: unpack go
|
|
command: chdir=~/ tar xvf go{{ go_version }}.linux-amd64.tar.gz
|
|
|
|
- name: delete golang archive
|
|
file: path=~/go{{ go_version }}.linux-amd64.tar.gz state=absent
|
|
|
|
- name: add variables to variables /etc/profile
|
|
copy: src=golang.sh dest=/etc/profile.d/golang.sh
|
|
sudo: yes
|
|
|
|
- name: get cgrates
|
|
shell: GOROOT=~/go GOPATH=~/code ~/go/bin/go get -u -v github.com/cgrates/cgrates
|
|
|
|
- name: create cgr-engine link
|
|
file: src=/home/vagrant/code/bin/cgr-engine dest=/usr/bin/cgr-engine state=link
|
|
sudo: yes
|
|
|
|
- name: create a link to data dir
|
|
sudo: yes
|
|
file: src=/home/vagrant/code/src/github.com/cgrates/cgrates/data dest=/usr/share/cgrates state=link
|
|
|
|
- name: expand freeswitch json conf
|
|
command: tar -xzvf /usr/share/cgrates/tutorials/fs_json/freeswitch/etc/freeswitch_conf.tar.gz
|
|
|
|
- name: expand freeswitch csv conf
|
|
command: tar -xzvf /usr/share/cgrates/tutorials/fs_csv/freeswitch/etc/freeswitch_conf.tar.gz
|
|
|
|
- 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=link
|
|
|