-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathAnsilbe-FreeSWITCH-Installation.yml
61 lines (52 loc) · 2.1 KB
/
Ansilbe-FreeSWITCH-Installation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Ansilbe playbook to install Freeswitch on Debian 10 and 11
# Update signalwire_freeswitch_key with your token from SignalWire
- name: Install Freeswitch
vars:
signalwire_freeswitch_key: pat_cF3Hvp5iFpsQFoA5Egk4Dgqf
hosts: all
remote_user: root
tasks:
- name: Installing prerequisites
ansible.builtin.apt:
name:
- gnupg2
- wget
- lsb-release
update_cache: yes
- name: Fetch FreeSWITCH GPG key
get_url:
url: https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg
username: signalwire
password: '{{ signalwire_freeswitch_key }}'
dest: /usr/share/keyrings/signalwire-freeswitch-repo.gpg
when: ansible_os_family == 'Debian' and ansible_distribution_major_version|int >= 10
- name: Auth Directory Creation
ansible.builtin.file:
path: /etc/apt/auth.conf.d
state: directory
mode: '0755'
when: ansible_os_family == 'Debian' and ansible_distribution_major_version|int >= 10
- name: Createing apt auth.conf.d
ansible.builtin.copy:
dest: /etc/apt/auth.conf.d/freeswitch.conf
owner: root
group: root
mode: '0700'
content: 'machine freeswitch.signalwire.com login signalwire password {{ signalwire_freeswitch_key }}'
when: ansible_os_family == 'Debian' and ansible_distribution_major_version|int >= 10
- name: "Add SignalWire FreeSWITCH repo"
ansible.builtin.apt_repository:
repo: deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ {{ ansible_distribution_release }} main
state: present
filename: freeswitch
when: ansible_os_family == 'Debian' and ansible_distribution_major_version|int >= 10
- name: Installing FreeSWITCH
ansible.builtin.apt:
name:
- freeswitch-meta-all
update_cache: yes
- name: Start service httpd, if not started
ansible.builtin.service:
name: freeswitch
enabled: true
state: started