fpm-git.nimble-streamer
ansible-nimble-streamer
- 推荐使用 Ansible 2.1 以上版本
- 目前兼容 CentOS 7.x
目录
安装
$ ansible-galaxy install fpm-git.nimble-streamer
入门
此角色需以 root 用户或具有 sudo 权限的用户身份运行。
以下是一个示例 playbook,包含一些开启 nimble streamer 端口的防火墙任务:
---
- name: 配置 nimble streamers
hosts: edge_server
become: yes # 以 root 身份运行
vars:
- nimble_auto_update: true
- nimble_transcoder: true
- nimble_wmspanel_username: <您的 WMSPanel 用户名>
- nimble_wmspanel_password: <您的 WMSPanel 密码>
roles:
- fpm-git.nimble-streamer
tasks:
# ETH0 (互联网)
- firewalld:
zone: public
interface: eth0
permanent: true
immediate: true
state: enabled
- firewalld:
zone: public
service: ssh
permanent: true
immediate: true
state: disabled
# Nimble HTTP 端口
- firewalld:
zone: public
port: "{{ nimble_port }}/tcp"
permanent: true
immediate: true
state: enabled
# Nimble HTTPS 端口
- firewalld:
zone: public
port: "{{ nimble_ssl_port }}/tcp"
permanent: true
immediate: true
state: enabled
when: nimble_ssl
# ETH1 (私有网络)
- firewalld:
zone: internal
interface: eth1
permanent: true
immediate: true
state: enabled
- firewalld:
zone: internal
service: ssh
permanent: true
immediate: true
state: enabled
# Nimble HTTP 端口
- firewalld:
zone: internal
port: "{{ nimble_port }}/tcp"
permanent: true
immediate: true
state: enabled
# Nimble HTTPS 端口
- firewalld:
zone: internal
port: "{{ nimble_ssl_port }}/tcp"
permanent: true
immediate: true
state: enabled
when: nimble_ssl
角色变量
以下是此角色的所有默认变量列表,这些变量也可以在 defaults/main.yml 中找到。
---
###################################
# Ansible 任务选项
###################################
nimble_streamer_version:
nimble_force_service_restart: false
nimble_auto_update: false
nimble_transcoder: false
nimble_run_as_root: false
nimble_user: nimble
nimble_management_api: false
nimble_ssl: false
nimble_ssl_local_certificate:
nimble_ssl_local_certificate_key:
###################################
# Nimble Streamer 配置
#
# 文档: http://blog.wmspanel.com/p/nimble-streamer-configuration.html
###################################
nimble_port: 80
nimble_worker_threads: 1
nimble_transmuxer_threads:
nimble_listen_interfaces: "*"
nimble_enable_ipv6: false
nimble_restrict_session_ip: false
nimble_cdn_origin:
nimble_user_agent:
nimble_session_timeout:
nimble_pass_headers:
nimble_passed_header_prefix:
nimble_absolute_path:
nimble_update_geoip_database:
nimble_custom_pd_exts:
nimble_enable_pd_for_remote_vod:
nimble_vod_subtitle_default_language_id:
nimble_mpegts_for_audio_vod:
nimble_vod_transmuxing_buffer:
nimble_mpegts_inactivity_check_interval:
nimble_udp_so_receive_buffer:
nimble_video_index:
nimble_audio_index:
# 日志配置
nimble_logging: info
nimble_log_access:
nimble_log_sessions:
nimble_max_log_file_size:
nimble_max_log_files_to_keep:
# CORS 配置
nimble_access_control_allow_origin:
nimble_access_control_allow_credentials:
nimble_access_control_expose_headers:
nimble_access_control_allow_headers:
nimble_crossdomain_xml_allow_access_from_domain:
nimble_crossdomain_xml:
# HLS 相关配置
nimble_hls_add_program_date_time:
nimble_hls_add_closed_caption_none:
# RTMP 相关配置
nimble_rtmp_max_viewers:
nimble_rtmp_working_thread:
nimble_rtmp_buffer_items:
# Websocket 相关配置
nimble_websocket_live_max_viewers:
nimble_websocket_live_worker_threads:
# 缓存相关配置
nimble_cache_path: "/var/cache/nimble"
nimble_max_cache_size: 512
nimble_max_disk_cache_size: 4096
nimble_vod_cache_timeout:
nimble_vod_cache_min_storage_time:
nimble_vod_chunk_duration:
nimble_vod_to_ram_cache_first:
nimble_ram_cache_for_vod_threshold:
nimble_playlist_cache_control:
nimble_chunk_cache_control:
# 管理 API 配置
nimble_management_port: 8090
nimble_management_listen_interfaces: "*"
nimble_management_token:
# Nimble Streamer SSL 配置
nimble_ssl_port: 443
nimble_ssl_certificate:
nimble_ssl_certificate_key:
# Nimble Streamer WMSPanel 配置
nimble_wmspanel_username:
nimble_wmspanel_password:
nimble_recovery_id: