mwolff44.freeswitch-mw
Freeswitch-mw
FreeSwitch 1.6 的 Ansible 角色
需求
- 在 Ansible 2.0 或更高版本上测试通过。
通过 pip 安装 Ansible
sudo apt-get install -y ansible
角色变量
角色变量及默认值。
FreeSwitch
freeswitch_conf_dir: '/etc/freeswitch' # 配置目录
freeswitch_symlinks: True # 默认在 /usr/local/freeswitch 创建符号链接
freeswitch_install_conf: True # 允许安装配置文件 - 更新时可以禁用
freeswitch_conf_backup_dir: '/etc/freeswitch.orig' # 备份配置目录
freeswitch_config_template_dir: '../templates/freeswitch/config' # 用于 FreeSwitch 配置的模板目录
freeswitch_config_list: # 模板配置文件列表,以 ".j2" 结尾
- autoload_configs/console.conf.xml.j2
- autoload_configs/logfile.conf.xml.j2
- autoload_configs/modules.conf.xml.j2
- autoload_configs/switch.conf.xml.j2
- autoload_configs/syslog.conf.xml.j2
freeswitch_install_script: True # 允许安装脚本文件 - 更新时可以禁用
freeswitch_script_dir: '/usr/share/freeswitch/scripts' # 脚本目录
freeswitch_script_backup_dir: '/usr/share/freeswitch/scripts.orig' # 脚本备份目录
freeswitch_script_template_dir: '../templates/freeswitch/scripts' # 用于 FreeSwitch 脚本的模板目录
freeswitch_script_list: # 模板脚本文件列表,以 ".j2" 结尾
- test.lua.j2
freeswitch_packages: # 要安装的 FreeSwitch 包
- freeswitch-meta-all
- freeswitch-all-dbg
- gdb
FreeSwitch 配置
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 # 最大同时打开的数据库句柄数量
freeswitch_db_handle_timeout: 10 # 等待新数据库句柄的最大秒数
freeswitch_min_idle_cpu: 25 # 拒绝呼叫的最低空闲 CPU 百分比
freeswitch_max_sessions: 1000 # 任何时间允许的最大会话数
freeswitch_sessions_per_second: 30 # 每秒最多创建的通道数
freeswitch_global_loglevel: debug # 默认全局日志级别 - 值可以是 debug, info, notice, warning, err, crit, alert 之一
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' # 用于 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
fail2ban_local_jail_file: /etc/fail2ban/jail.local # FreeSwitch 的 fail2ban 监狱文件
fail2ban_filter_dir: /etc/fail2ban/filter.d # fail2ban 过滤目录
fail2ban_local_jail: ../templates/fail2ban/jail.local # FreeSwitch 的 fail2ban 模板监狱
fail2ban_fs: ../templates/fail2ban/freeswitch.conf # FreeSwitch 的 Fail2ban 过滤模板
fail2ban_dos_fs: ../templates/fail2ban/freeswitch-dos.conf # FreeSwitch DOS 的 Fail2ban 过滤模板
Sngrep
sngrep_install: False # 默认:不会安装 sngrep
与 systemd 进行时间同步
ntp_install: False # 默认:不会配置时间同步
ntp_servers: '{{ ntp_servers_map[ansible_distribution]
| d(ntp_servers_map["default"]) }}'
ntp_servers_map:
'Debian': [ '0.debian.pool.ntp.org', '1.debian.pool.ntp.org',
'2.debian.pool.ntp.org', '3.debian.pool.ntp.org' ]
'Ubuntu': [ '0.ubuntu.pool.ntp.org', '1.ubuntu.pool.ntp.org',
'2.ubuntu.pool.ntp.org', '3.ubuntu.pool.ntp.org' ]
'default': [ '0.pool.ntp.org', '1.pool.ntp.org',
'2.pool.ntp.org', '3.pool.ntp.org' ]
ntp_timezone: 'Europe/Paris'
ntp_timesyncd_template : ../templates/etc/systemd/timesyncd.conf.d/ansible.conf.j2
依赖关系
无
使用方法
将 mwolff44.freeswitch-mw
添加到您的角色,并在 playbook 文件中设置变量。示例:
- hosts: all
vars_files:
- 'defaults/main.yml'
tasks:
- include: 'tasks/main.yml'
handlers:
- include: 'handlers/main.yml'
许可证
根据 GPL v3 许可证授权。有关详细信息,请参阅 LICENSE 文件。
贡献者
特别感谢: Bruno SALZANO / [email protected]
作者信息
Mathias WOLFF / 电信博客 - PyFreeBilling
安装
ansible-galaxy install mwolff44.freeswitch-mw
许可证
gpl-3.0
下载
80
拥有者