Files
cgrates/data/ansible/calls/freeswitch/cgrates.yaml
2021-06-25 18:11:16 +02:00

77 lines
2.0 KiB
YAML

---
- name: create cgrates directory
become: yes
file:
state: directory
mode: 'u=rwx,go=rx'
owner: "{{ user }}"
group: "{{ user }}"
dest: '{{ cgrates_dir }}'
become_user: "{{ user }}"
- name: git clone cgrates
git:
repo: https://github.com/cgrates/cgrates.git
dest: '{{ cgrates_dir }}'
update: yes
force: yes
become: yes
become_user: "{{ user }}"
- name: build cgrates
shell: "sh {{ cgrates_dir }}/build.sh"
environment:
PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}"
args:
chdir: '{{ cgrates_dir }}'
- name: symbol link
become: yes
file:
src: "{{ cgrates_dir }}/data"
dest: "/usr/share/cgrates"
state: link
- name: symbol link 2
become: yes
file:
src: "{{ golang_gopath }}/bin/cgr-engine"
dest: "/usr/bin/cgr-engine"
state: link
# post install
- name: post install for ers mysql
become: yes
command: 'sh {{ cgrates_dir }}/data/storage/mysql/setup_ers_db.sh root CGRateS.org localhost'
args:
chdir: '{{ cgrates_dir }}/data/storage/mysql/'
- name: post install mysql
become: yes
command: 'sh {{ cgrates_dir }}/data/storage/mysql/setup_cgr_db.sh root CGRateS.org localhost'
args:
chdir: '{{ cgrates_dir }}/data/storage/mysql/'
- name: post install postgres2
become: yes
command: 'sh {{ cgrates_dir }}/data/storage/postgres/create_db_with_users.sh'
args:
chdir: '{{ cgrates_dir }}/data/storage/postgres/'
- name: post install for ers postgres
become: yes
command: 'sh {{ cgrates_dir }}/data/storage/postgres/create_ers_db.sh'
args:
chdir: '{{ cgrates_dir }}/data/storage/postgres/'
- name: post install mongo
become: yes
command: 'sh {{ cgrates_dir }}/data/storage/mongo/setup_cgr_db.sh'
args:
chdir: '{{ cgrates_dir }}/data/storage/mongo/'
- name: set versions
command: 'cgr-migrator -exec=*set_versions -config_path=/usr/share/cgrates/conf/samples/tutmysql'
environment:
PATH: "{{ lookup('env','PATH') }}:{{ golang_gopath }}/bin:/usr/local/go/bin:{{ ansible_env.PATH }}"