Commit ccf8b646 authored by Mathias WOLFF's avatar Mathias WOLFF

odbc config + many tunning

parent 37e2666f
Changelog
=========
v2.3
----
- Install and configure ODBC
v2.2
-----
- Script install management for freeswitch
......
......@@ -31,7 +31,21 @@ The role variables and default values.
freeswitch_symlinks: True # default FS layout in /usr/local/freeswitch by creating symlinks
freeswitch_install_conf: True # Allow the installation of the configuration files - Could be disabled when updating
freeswitch_conf_backup_dir: '/etc/freeswitch.orig' # Backup configuration directory
freeswitch_config_template_dir: ../templates/freeswitch/config/ # Templates directory used for FreeSwitch configuration
freeswitch_config_template_dir: ../templates/freeswitch/config # Templates directory used for FreeSwitch configuration
freeswitch_config_list: # List of templates config files without ending ".j2"
- autoload_configs/console.conf.xml
- autoload_configs/logfile.conf.xml
- autoload_configs/modules.conf.xml
- autoload_configs/switch.conf.xml
- autoload_configs/syslog.conf.xml
freeswitch_install_script: True # Allow the installation of the script files - Could be disabled when updating
freeswitch_script_dir: '/usr/share/freeswitch/scripts' # Script directory
freeswitch_script_backup_dir: '/usr/share/freeswitch/scripts.orig' # Backup cscript directory
freeswitch_script_template_dir: ../templates/freeswitch/scripts # Templates directory used for FreeSwitch script
freeswitch_script_list: # List of templates script files without ending ".j2"
- test.lua
freeswitch_packages: # FreeSwitch packages to be installed
- freeswitch-meta-all
- freeswitch-all-dbg
......@@ -51,6 +65,26 @@ The role variables and default values.
freeswitch_rtp_start_port: 16384
freeswitch_rtp_end_port: 32768
### ODBC
odbc_install: false
odbc_packages_install: false
odbc_packages:
- unixodbc-bin
- unixodbc-dev
odbc_postgresql_install: false
odbc_postgresql_packages:
- odbc-postgresql
postgresql_packages_install: false
odbc_template_dir: ../templates/odbc # Templates directory used for ODBC
odbc_server: 127.0.0.1
odbc_port: 5432
odbc_database: 'mydatabase'
odbc_user: 'myuser'
odbc_password: 'mypass'
odbc_tracefile: '/tmp/psqlodbc.log'
### Fail2ban
......
---
# version
freeswitch-mw_version: "2.2"
freeswitch-mw_version: "2.3"
# base packages
basepackages_install: True
......@@ -59,17 +59,20 @@ freeswitch_conf_dir: '/etc/freeswitch' # Configuration directory
freeswitch_install_conf: True # Allow the installation of the configuration files - Could be disabled when updating
freeswitch_daemon_args: -nc -nonat
freeswitch_conf_backup_dir: '/etc/freeswitch.orig' # Backup configuration directory
freeswitch_config_template_dir: ../templates/freeswitch/config/ # Templates directory used for FreeSwitch configuration
freeswitch_config_template_dir: ../templates/freeswitch/config # Templates directory used for FreeSwitch configuration
freeswitch_config_list: # List of templates config files without ending ".j2"
- autoload_configs/console.conf.xml
- autoload_configs/logfile.conf.xml
- autoload_configs/modules.conf.xml
- autoload_configs/switch.conf.xml
- autoload_configs/syslog.conf.xml
freeswitch_install_script: True # Allow the installation of the script files - Could be disabled when updating
freeswitch_script_dir: '/usr/share/freeswitch/scripts' # Script directory
freeswitch_script_backup_dir: '/usr/share/freeswitch/scripts.orig' # Backup cscript directory
freeswitch_script_template_dir: ../templates/freeswitch/scripts # Templates directory used for FreeSwitch script
freeswitch_script_list: # List of templates script files without ending ".j2"
- logfile.conf.xml
- modules.conf.xml
- switch.conf.xml
- test.lua
freeswitch_g729_install: False
freeswitch_reload: False
......@@ -81,17 +84,36 @@ freeswitch_packages:
- gdb
# FreeSwitch config
freeswitch_log_mapping: <map name="err" value="debug,info,notice,warning,err,crit,alert"/>
freeswitch_log_max_rotate: <!-- <param name="maximum-rotate" value="32"/> -->
freeswitch_log_mapping: '<map name="err" value="debug,info,notice,warning,err,crit,alert"/>'
freeswitch_log_max_rotate: '<!-- <param name="maximum-rotate" value="32"/> -->'
freeswitch_max_db_handles: 50 # Maximum number of simultaneous DB handles open
freeswitch_db_handle_timeout: 10 # Maximum number of seconds to wait for a new DB handle before failing
freeswitch_min_idle_cpu: 25 # Minimum idle CPU before refusing calls
freeswitch_max_sessions: 1000 # Max number of sessions to allow at any given time
freeswitch_sessions_per_second: 30 # Most channels to create per second
freeswitch_global_loglevel: debug # Default Global Log Level - value is one of debug,info,notice,warning,err,crit,alert
freeswitch_global_loglevel: 'debug' # Default Global Log Level - value is one of debug,info,notice,warning,err,crit,alert
freeswitch_rtp_start_port: 16384
freeswitch_rtp_end_port: 32768
# ODBC install
odbc_install: false
odbc_packages_install: false
odbc_packages:
- unixodbc-bin
- unixodbc-dev
odbc_postgresql_install: false
odbc_postgresql_packages:
- odbc-postgresql
postgresql_packages_install: false
odbc_template_dir: ../templates/odbc # Templates directory used for ODBC
odbc_server: 127.0.0.1
odbc_port: 5432
odbc_database: 'mydatabase'
odbc_user: 'myuser'
odbc_password: 'mypass'
odbc_tracefile: '/tmp/psqlodbc.log'
# Fail2ban
fail2ban_install: False
fail2ban_local_jail_file: /etc/fail2ban/jail.local # fail2ban jail file for FreeSwitch
......
---
# Install odbc packages
- name: Install odbc packages
apt: name={{ item }} state=latest
with_items: "{{ odbc_packages }}"
when: odbc_packages_install
# Install postgresl for ODBC
- name: Install postgresql ODBC client
apt: name={{ item }} state=latest
with_items: "{{ odbc_postgresql_packages }}"
when: odbc_postgresql_install
# Configure ODBC
- name: Configure ODBC
template:
src: '../templates/odbc/odbc.ini.j2'
dest: "/etc/odbc.ini"
owner: 'root'
- template:
src: '../templates/odbc/odbcinst.ini.j2'
dest: "/etc/odbcinst.ini"
owner: 'root'
......@@ -12,6 +12,11 @@
include: upgrade_kernel4_jessie.yml
when: upgrade_kernel
# Install and configure ODBC
- name: Install and configure odbc
include: odbc.yml
when: odbc_install
# Freeswitch repo
- name: Add FreeSwitch Repo Signing key
apt_key: url=https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub state=present
......@@ -122,20 +127,25 @@
- name: Create symlinks like default FS install documention
file:
src: '{{ item.src }}'
dest: '/usr/local/freeswitch/{{ item.dst }}'
dest: '/usr/local/freeswitch/{{ item.dest }}'
force: '{{ item.force }}'
state: 'link'
with_items:
- { src: '/usr/bin/freeswitch', dest: 'bin/' }
- { src: '/usr/bin/fs_*', dest: 'bin/' }
- { src: '/usr/bin/fsxs', dest: 'bin/' }
- { src: '/usr/bin/tone2wav', dest: 'bin/' }
- { src: '/usr/bin/gentls_cert', dest: 'bin/' }
- { src: '/etc/freeswitch', dest: 'conf' }
- { src: '/var/lib/freeswitch/*', dest: '' }
- { src: '/var/log/freeswitch', dest: 'log' }
- { src: '/var/run/freeswitch', dest: 'run' }
- { src: '/etc/freeswitch/tls', dest: 'certs' }
- { src: '/usr/lib/freeswitch/mod', dest: '' }
- { src: '/usr/bin/freeswitch', dest: 'bin/freeswitch', force: no }
- { src: '/usr/bin/fs_cli', dest: 'bin/fs_cli', force: no }
- { src: '/usr/bin/fs_encode', dest: 'bin/fs_encode', force: no }
- { src: '/usr/bin/fs_ivrd', dest: 'bin/fs_ivrd', force: no }
- { src: '/usr/bin/fsxs', dest: 'bin/fsxs', force: no }
- { src: '/usr/bin/tone2wav', dest: 'bin/tone2wave', force: no }
- { src: '/usr/bin/gentls_cert', dest: 'bin/gentls_cert', force: no }
- { src: '/etc/freeswitch', dest: 'conf', force: no }
- { src: '/var/lib/freeswitch/db', dest: 'db', force: no }
- { src: '/var/lib/freeswitch/images', dest: 'images', force: no }
- { src: '/var/lib/freeswitch/recordings', dest: 'recordings', force: no }
- { src: '/var/lib/freeswitch/storage', dest: 'storage', force: no }
- { src: '/var/log/freeswitch', dest: 'log', force: no }
- { src: '/var/run/freeswitch', dest: 'run', force: no }
- { src: '/etc/freeswitch/tls', dest: 'certs', force: no }
when: freeswitch_symlinks
# g729
......
<configuration name="syslog.conf" description="Syslog Logger">
<!-- SYSLOG -->
<!-- emerg - system is unusable -->
<!-- alert - action must be taken immediately -->
<!-- crit - critical conditions -->
<!-- err - error conditions -->
<!-- warning - warning conditions -->
<!-- notice - normal, but significant, condition -->
<!-- info - informational message -->
<!-- debug - debug-level message -->
<settings>
<param name="facility" value="user"/>
<param name="ident" value="freeswitch"/>
<param name="loglevel" value="warning"/>
<!-- log uuids in syslogs -->
<param name="uuid" value="true"/>
</settings>
</configuration>
<configuration name="syslog.conf" description="Syslog Logger">
<!-- SYSLOG -->
<!-- emerg - system is unusable -->
<!-- alert - action must be taken immediately -->
<!-- crit - critical conditions -->
<!-- err - error conditions -->
<!-- warning - warning conditions -->
<!-- notice - normal, but significant, condition -->
<!-- info - informational message -->
<!-- debug - debug-level message -->
<settings>
<param name="facility" value="user"/>
<param name="ident" value="freeswitch"/>
<param name="loglevel" value="warning"/>
<!-- log uuids in syslogs -->
<param name="uuid" value="true"/>
</settings>
</configuration>
[freeswitch]
Driver = PostgreSQL
Description = Connection to POSTGRESQL
Servername = {{ odbc_server }}
Port = {{ odbc_port }}
Username = {{ odbc_user }}
Password = {{ odbc_password }}
Database = {{ odbc_database }}
Trace = No
TraceFile = {{ odbc_tracefile }}
ReadOnly = Yes
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =
[PostgreSQL]
Description = PostgreSQL ODBC driver (Unicode version)
Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
Debug = 0
CommLog = 1
UsageCount = 0
Threading = 0
MaxLongVarcharSize = 65536
......@@ -4,6 +4,10 @@
vars:
freeswitch_g729_install: true
fail2ban_install: true
odbc_install: true
odbc_postgresql_install: true
postgresql_packages_install: true
odbc_packages_install: true
roles:
- ../freeswitch-mw
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment