mirror of
https://github.com/frappe/bench.git
synced 2025-02-04 11:58:25 +00:00
check mysql root password
This commit is contained in:
parent
b9f096bd3e
commit
57499b8500
@ -12,7 +12,6 @@
|
|||||||
mode: 'o+rx'
|
mode: 'o+rx'
|
||||||
owner: '{{ frappe_user }}'
|
owner: '{{ frappe_user }}'
|
||||||
group: '{{ frappe_user }}'
|
group: '{{ frappe_user }}'
|
||||||
recurse: yes
|
|
||||||
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian'
|
when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian'
|
||||||
|
|
||||||
- name: Set home folder perms
|
- name: Set home folder perms
|
||||||
@ -21,7 +20,6 @@
|
|||||||
mode: 'o+rx'
|
mode: 'o+rx'
|
||||||
owner: '{{ frappe_user }}'
|
owner: '{{ frappe_user }}'
|
||||||
group: '{{ frappe_user }}'
|
group: '{{ frappe_user }}'
|
||||||
recurse: yes
|
|
||||||
when: ansible_distribution == 'MacOSX'
|
when: ansible_distribution == 'MacOSX'
|
||||||
|
|
||||||
- name: Set /tmp/.bench folder perms
|
- name: Set /tmp/.bench folder perms
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
- wkhtmltopdf
|
- wkhtmltopdf
|
||||||
|
|
||||||
- name: configure mariadb
|
- name: configure mariadb
|
||||||
include: ../prerequisites/roles/mariadb/task/main.yml
|
include: ../prerequisites/roles/mariadb/tasks/main.yml
|
||||||
vars:
|
vars:
|
||||||
mysql_conf_tpl: ../prerequisites/files/mariadb_config.cnf
|
mysql_conf_tpl: ../prerequisites/files/mariadb_config.cnf
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
- name: Start and enable service
|
- name: Start and enable service
|
||||||
service: name=mysql state=started enabled=yes
|
service: name=mysql state=started enabled=yes
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ mysql_root_password }}"
|
||||||
|
|
||||||
- include: mysql_secure_installation.yml
|
- include: mysql_secure_installation.yml
|
||||||
when: mysql_root_password is defined
|
when: mysql_root_password is defined
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
# UPDATE mysql.user SET Password=PASSWORD('mysecret') WHERE User='root';
|
# UPDATE mysql.user SET Password=PASSWORD('mysecret') WHERE User='root';
|
||||||
# FLUSH PRIVILEGES;
|
# FLUSH PRIVILEGES;
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ mysql_root_password }}"
|
||||||
|
|
||||||
- name: Set root Password
|
- name: Set root Password
|
||||||
mysql_user: name=root host={{ item }} password={{ mysql_root_password }} state=present
|
mysql_user: name=root host={{ item }} password={{ mysql_root_password }} state=present
|
||||||
@ -13,30 +15,40 @@
|
|||||||
- name: Add .my.cnf
|
- name: Add .my.cnf
|
||||||
template: src=my.cnf.j2 dest=/root/.my.cnf owner=root group=root mode=0600
|
template: src=my.cnf.j2 dest=/root/.my.cnf owner=root group=root mode=0600
|
||||||
|
|
||||||
|
- name: display .my.cnf
|
||||||
|
command: cat /root/.my.cnf
|
||||||
|
register: details
|
||||||
|
|
||||||
|
- debug:
|
||||||
|
msg: "{{ details.stdout_lines }}"
|
||||||
|
|
||||||
- name: Set root Password
|
- name: Set root Password
|
||||||
mysql_user: name=root host={{ item }} password={{ mysql_root_password }} state=present
|
mysql_user: name=root host={{ item }} password={{ mysql_root_password }} state=present
|
||||||
with_items:
|
with_items:
|
||||||
- 127.0.0.1
|
- 127.0.0.1
|
||||||
- ::1
|
- ::1
|
||||||
ignore_errors: yes
|
when: not run_travis
|
||||||
|
|
||||||
- name: Reload privilege tables
|
- name: Reload privilege tables
|
||||||
command: 'mysql -ne "{{ item }}"'
|
command: 'mysql -ne "{{ item }}"'
|
||||||
with_items:
|
with_items:
|
||||||
- FLUSH PRIVILEGES
|
- FLUSH PRIVILEGES
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
when: not run_travis
|
||||||
|
|
||||||
- name: Remove anonymous users
|
- name: Remove anonymous users
|
||||||
command: 'mysql -ne "{{ item }}"'
|
command: 'mysql -ne "{{ item }}"'
|
||||||
with_items:
|
with_items:
|
||||||
- DELETE FROM mysql.user WHERE User=''
|
- DELETE FROM mysql.user WHERE User=''
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
when: not run_travis
|
||||||
|
|
||||||
- name: Disallow root login remotely
|
- name: Disallow root login remotely
|
||||||
command: 'mysql -ne "{{ item }}"'
|
command: 'mysql -ne "{{ item }}"'
|
||||||
with_items:
|
with_items:
|
||||||
- DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')
|
- DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
when: not run_travis
|
||||||
|
|
||||||
- name: Remove test database and access to it
|
- name: Remove test database and access to it
|
||||||
command: 'mysql -ne "{{ item }}"'
|
command: 'mysql -ne "{{ item }}"'
|
||||||
@ -44,13 +56,14 @@
|
|||||||
- DROP DATABASE if exists test
|
- DROP DATABASE if exists test
|
||||||
- DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'
|
- DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'
|
||||||
changed_when: False
|
changed_when: False
|
||||||
ignore_errors: True
|
when: not run_travis
|
||||||
|
|
||||||
- name: Reload privilege tables
|
- name: Reload privilege tables
|
||||||
command: 'mysql -ne "{{ item }}"'
|
command: 'mysql -ne "{{ item }}"'
|
||||||
with_items:
|
with_items:
|
||||||
- FLUSH PRIVILEGES
|
- FLUSH PRIVILEGES
|
||||||
changed_when: False
|
changed_when: False
|
||||||
|
when: not run_travis
|
||||||
|
|
||||||
- name: add launchagents folder mac
|
- name: add launchagents folder mac
|
||||||
file: path=~/Library/LaunchAgents state=directory
|
file: path=~/Library/LaunchAgents state=directory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user