1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/pbx/tasks/chan_dongle.yml

62 lines
1.9 KiB
YAML
Raw Normal View History

2019-01-19 05:12:48 +00:00
- name: chan_dongle - Download software to /opt/iiab/downloads
get_url:
url: "{{ chan_dongle_url }}/{{ chan_dongle_src_file }}"
dest: "{{ downloads_dir }}/{{ chan_dongle_src_file }}"
timeout: "{{ download_timeout }}"
when: internet_available
- name: chan_dongle - Check for /opt/iiab/downloads/{{ chan_dongle_src_file }}
stat:
path: "{{ downloads_dir }}/{{ chan_dongle_src_file }}"
register: chan_dongle_src
- name: chan_dongle - FAIL (force Ansible to exit) IF /opt/iiab/downloads/{{ chan_dongle_src_file }} doesn't exist
fail:
msg: "{ downloads_dir }}/{{ chan_dongle_src_file }} is REQUIRED in order to install."
when: not chan_dongle_src.stat.exists
- name: chan_dongle - Create install source directory
file:
path: "{{ chan_dongle_src_dir }}"
state: directory
- name: chan_dongle - Extract source
unarchive:
src: "{{ downloads_dir }}/{{ chan_dongle_src_file }}"
dest: "{{ downloads_dir }}"
2019-01-19 05:12:48 +00:00
owner: root
group: root
- name: chan_dongle - move to {{ chan_dongle_src_dir }}
2019-01-19 14:22:38 +00:00
command: mv {{ downloads_dir }}/asterisk-chan-dongle-master/ {{ chan_dongle_src_dir }}
args:
2019-01-19 14:12:44 +00:00
chdir: "{{ downloads_dir }}"
2019-01-19 05:12:48 +00:00
- name: chan_dongle - Run the bootstrap script
command: "./bootstrap"
args:
chdir: "{{ chan_dongle_src_dir }}"
2019-01-19 05:40:51 +00:00
creates: "{{ chan_dongle_src_dir }}/configure"
- name: chan_dongle - Find out asterisk version
command: "asterisk -V |cut -d ' ' -f 2"
register: asterisk_ver
2019-01-19 05:12:48 +00:00
- name: chan_dongle - Run the configure script
2019-01-19 05:40:51 +00:00
command: "./configure --with-astversion={{asterisk_ver.stdout}}"
2019-01-19 05:12:48 +00:00
args:
chdir: "{{ chan_dongle_src_dir }}"
2019-01-19 05:40:51 +00:00
creates: "{{ chan_dongle_src_dir }}/Makefile"
2019-01-19 05:12:48 +00:00
- name: chan_dongle - Run 'make'
command: make
args:
chdir: "{{ chan_dongle_src_dir }}"
2019-01-19 05:40:51 +00:00
creates: "{{ chan_dongle_src_dir }}/chan_dongle.o"
- name: chan_dongle - Run 'make install'
command: make install
args:
chdir: "{{ chan_dongle_src_dir }}"
creates: "/usr/lib/asterisk/modules/chan_dongle.so"