text
stringlengths
0
152
mysql_db:
login_user: root
login_password: "{{ updated_mysql_root_password }}"
name: test
state: absent
- user:
name: asterisk
state: present
createhome: yes
- group:
name: asterisk
state: present
- user:
name: astmin
groups: asterisk,wheel
state: present
- name: Install other dependencies
dnf:
name:
- unixODBC
- unixODBC-devel
- mysql-connector-odbc
- MySQL-python
- tcpdump
- ntp
- ntpdate
- jansson
- bind-utils
state: present
# Tweak the firewall for UDP/SIP
- firewalld:
port: 5060/udp
permanent: true
state: enabled
# Tweak firewall for UDP/RTP
- firewalld:
port: 10000-20000/udp
Dependencies
|
33
permanent: true
state: enabled
- name: Ensure NTP is running
service:
name: ntpd
state: started
enabled: yes
# The libmyodbc8a.so file is versioned, so if you don't have version 8, see what the
# /usr/lib64/libmyodbc<version>a.so file is, and refer to that instead
# on your 'Driver64' line, and then run the playbook again
- name: update odbcinst.ini
lineinfile:
dest: /etc/odbcinst.ini
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
state: present
with_items:
- regexp: "^Driver64"
line: "Driver64 = /usr/lib64/libmyodbc8a.so"
- regexp: "^Setup64"
line: "Setup64 = /usr/lib64/libodbcmyS.so"
- name: create odbc.ini
blockinfile:
path: /etc/odbc.ini
create: yes
block: |
[asterisk]
Driver = MySQL
Description = MySQL connection to 'asterisk' database
Server = localhost
Port = 3306
Database = asterisk
UserName = asterisk
Password = {{ updated_mysql_asterisk_password }}
#Socket = /var/run/mysqld/mysqld.sock
Socket = /var/lib/mysql/mysql.sock
...
Run the playbook with the following command:
$ ansible-playbook ~/ansible/playbooks/starfish.yml
Sit back and watch the magic happen.
Once Ansible has completed the assigned tasks, verify that ODBC can connect to the
database using the asterisk user credentials.