Przeglądaj źródła

Added workaround for broken MySQL socket auth with PyMysql

merge-requests/1/merge
Christoph Haas 6 lat temu
rodzic
commit
80a009dbd5
3 zmienionych plików z 21 dodań i 8 usunięć
  1. +2
    -2
      Vagrantfile
  2. +18
    -6
      ansible/roles/ispmail-database/tasks/main.yml
  3. +1
    -0
      ansible/roles/ispmail-database/templates/root-my-cnf.j2

+ 2
- 2
Vagrantfile Wyświetl plik

@@ -39,7 +39,7 @@ Vagrant.configure(2) do |config|
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
#config.vm.synced_folder "ansible", "/root"
#config.vm.synced_folder "ansible", "/vagrant"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
@@ -73,6 +73,7 @@ Vagrant.configure(2) do |config|

config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/ispmail.yml"
#ansible.playbook = "ispmail.yml"
ansible.become = true
#ansible.become_user = 'root'
ansible.compatibility_mode = '2.0'
@@ -97,4 +98,3 @@ Vagrant.configure(2) do |config|
# Submission
config.vm.network "forwarded_port", guest: 587, host: 10587
end


+ 18
- 6
ansible/roles/ispmail-database/tasks/main.yml Wyświetl plik

@@ -1,15 +1,27 @@
---
- name: Installing required Python mysqldb module for Ansible to manage databases
# apt: name=python-mysqldb
apt: name=python-pymysql

- name: Set root user password
become: true
# If .my.cnf already exists, this will cause an mysql-root-password update.
# - name: Set root user password
# become: true
# # If .my.cnf already exists, this will cause an mysql-root-password update.
# mysql_user:
# name: root
# password: "{{ ispmail_mysql_root_password}}"
# login_unix_socket: /var/run/mysqld/mysqld.sock
# check_implicit_admin: true

- name: Set a new root password
mysql_user:
name: root
password: "{{ ispmail_mysql_root_password}}"
check_implicit_admin: yes
user: root
password: "{{ ispmail_mysql_root_password }}"
login_unix_socket: /var/run/mysqld/mysqld.sock
check_implicit_admin: true
host: "{{ item }}"
with_items:
- localhost
- 127.0.0.1

- name: Create .my.cnf
template:


+ 1
- 0
ansible/roles/ispmail-database/templates/root-my-cnf.j2 Wyświetl plik

@@ -1,3 +1,4 @@
[client]
user=root
password={{ispmail_mysql_root_password}}
socket=/var/run/mysqld/mysqld.sock

Ładowanie…
Anuluj
Zapisz