mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-10 03:40:18 +01:00
Make sure socket connections work correctly on Ubuntu.
This commit is contained in:
parent
710c52c671
commit
8299775d52
2 changed files with 17 additions and 1 deletions
|
@ -40,7 +40,14 @@ script:
|
|||
- "sudo ls -lah /var/log"
|
||||
- "sudo cat /var/log/mysql/error.log"
|
||||
|
||||
# Check to make sure we can connect to MySQL.
|
||||
# Check to make sure we can connect to MySQL via Unix socket.
|
||||
- >
|
||||
mysql -u root -proot -e 'show databases;'
|
||||
| grep -q 'performance_schema'
|
||||
&& (echo 'MySQL running normally' && exit 0)
|
||||
|| (echo 'MySQL not running' && exit 1)
|
||||
|
||||
# Check to make sure we can connect to MySQL via TCP.
|
||||
- >
|
||||
mysql -u root -proot -h 127.0.0.1 -e 'show databases;'
|
||||
| grep -q 'performance_schema'
|
||||
|
|
|
@ -10,3 +10,12 @@
|
|||
|
||||
- name: Ensure MySQL is started and enabled on boot.
|
||||
service: "name={{ mysql_daemon }} state=started enabled={{ mysql_enabled_on_startup }}"
|
||||
|
||||
- name: Ensure MySQL socket file has correct permissions.
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
mode: 0755
|
||||
notify: restart mysql
|
||||
with_items:
|
||||
- "{{ mysql_datadir }}"
|
||||
- "{{ mysql_socket }}"
|
||||
|
|
Loading…
Reference in a new issue