Commit 3dd3da9e authored by Ing. Matej Madeja's avatar Ing. Matej Madeja
Browse files

current work

parent 1d2575e9
---
# handlers file for mariadb-config
\ No newline at end of file
# handlers file for mariadb-config
- name: restart apache
service:
name: apache2
state: restarted
enabled: yes
become: yes
\ No newline at end of file
---
# tasks file for mariadb-config
- name: Install phpmyadmin
- name: Install phpmyadmin and dependencies
apt:
pkg:
- phpmyadmin
- php7.3-mbstring
- php7.3-gettext
- python3-pip
update_cache: yes
become: yes
notify: restart apache
- name: "Ensure phpmyadmin config is include in main apache config"
become: yes
......@@ -14,3 +18,32 @@
state: present
regexp: '^Include.+phpmyadmin.+$'
line: "Include /etc/phpmyadmin/apache.conf"
insertafter: "EOF"
notify: restart apache
- name: "Generate new password"
shell: "openssl rand -hex 7"
register: mysql_new_root_pass
- debug:
var: mysql_new_root_pass
- name: "Install PyMySQL"
become: yes
pip:
name: PyMySQL
- name: "Change password for root"
become: yes
mysql_user:
name: root
password: "{{ mysql_new_root_pass.stdout }}"
priv: '*.*:ALL'
host: "{{ item }}"
state: present
with_items:
- 127.0.0.1
- ::1
- localhost
- "{{ ansible_hostname }}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment