diff --git a/playbooks/develop/create_user.yml b/playbooks/develop/create_user.yml index 2980ed4e..e7caf573 100755 --- a/playbooks/develop/create_user.yml +++ b/playbooks/develop/create_user.yml @@ -12,7 +12,6 @@ mode: 'o+rx' owner: '{{ frappe_user }}' group: '{{ frappe_user }}' - recurse: yes when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'CentOS' or ansible_distribution == 'Debian' - name: Set home folder perms @@ -21,7 +20,6 @@ mode: 'o+rx' owner: '{{ frappe_user }}' group: '{{ frappe_user }}' - recurse: yes when: ansible_distribution == 'MacOSX' - name: Set /tmp/.bench folder perms diff --git a/playbooks/develop/macosx.yml b/playbooks/develop/macosx.yml index b9175b7e..05b8c947 100644 --- a/playbooks/develop/macosx.yml +++ b/playbooks/develop/macosx.yml @@ -22,7 +22,7 @@ - wkhtmltopdf - name: configure mariadb - include: ../prerequisites/roles/mariadb/task/main.yml + include: ../prerequisites/roles/mariadb/tasks/main.yml vars: mysql_conf_tpl: ../prerequisites/files/mariadb_config.cnf diff --git a/playbooks/prerequisites/roles/mariadb/tasks/main.yml b/playbooks/prerequisites/roles/mariadb/tasks/main.yml index b731d39e..bbcc7e77 100644 --- a/playbooks/prerequisites/roles/mariadb/tasks/main.yml +++ b/playbooks/prerequisites/roles/mariadb/tasks/main.yml @@ -21,6 +21,9 @@ - name: Start and enable service service: name=mysql state=started enabled=yes +- debug: + msg: "{{ mysql_root_password }}" + - include: mysql_secure_installation.yml when: mysql_root_password is defined diff --git a/playbooks/prerequisites/roles/mariadb/tasks/mysql_secure_installation.yml b/playbooks/prerequisites/roles/mariadb/tasks/mysql_secure_installation.yml index 5a326624..d1ba6c4f 100644 --- a/playbooks/prerequisites/roles/mariadb/tasks/mysql_secure_installation.yml +++ b/playbooks/prerequisites/roles/mariadb/tasks/mysql_secure_installation.yml @@ -3,6 +3,8 @@ # UPDATE mysql.user SET Password=PASSWORD('mysecret') WHERE User='root'; # FLUSH PRIVILEGES; +- debug: + msg: "{{ mysql_root_password }}" - name: Set root Password mysql_user: name=root host={{ item }} password={{ mysql_root_password }} state=present @@ -13,30 +15,40 @@ - name: Add .my.cnf 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 mysql_user: name=root host={{ item }} password={{ mysql_root_password }} state=present with_items: - 127.0.0.1 - ::1 - ignore_errors: yes + when: not run_travis - name: Reload privilege tables command: 'mysql -ne "{{ item }}"' with_items: - FLUSH PRIVILEGES changed_when: False + when: not run_travis - name: Remove anonymous users command: 'mysql -ne "{{ item }}"' with_items: - DELETE FROM mysql.user WHERE User='' changed_when: False + when: not run_travis - name: Disallow root login remotely command: 'mysql -ne "{{ item }}"' with_items: - DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1') changed_when: False + when: not run_travis - name: Remove test database and access to it command: 'mysql -ne "{{ item }}"' @@ -44,13 +56,14 @@ - DROP DATABASE if exists test - DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%' changed_when: False - ignore_errors: True + when: not run_travis - name: Reload privilege tables command: 'mysql -ne "{{ item }}"' with_items: - FLUSH PRIVILEGES changed_when: False + when: not run_travis - name: add launchagents folder mac file: path=~/Library/LaunchAgents state=directory