1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/phpmyadmin/tasks/install.yml

60 lines
2.2 KiB
YAML
Raw Normal View History

2021-02-03 19:49:17 +00:00
- name: Download {{ phpmyadmin_dl_url }} to {{ downloads_dir }}
get_url:
url: "{{ phpmyadmin_dl_url }}" # e.g. https://files.phpmyadmin.net/phpMyAdmin/5.0.4/phpMyAdmin-5.0.4-all-languages.zip
dest: "{{ downloads_dir }}" # /opt/iiab/downloads
timeout: "{{ download_timeout }}"
2021-02-03 19:49:17 +00:00
- name: Does {{ downloads_dir }}/{{ phpmyadmin_name_zip }} exist?
stat:
path: "{{ downloads_dir }}/{{ phpmyadmin_name_zip }}" # e.g. /opt/iiab/downloads/phpMyAdmin-5.0.4-all-languages.zip
register: phpmyadmin_dl
2021-02-24 14:02:46 +00:00
- name: Unarchive {{ phpmyadmin_dl_url }} (7+ MB) to /opt (60+ MB)
unarchive:
2021-02-24 14:02:46 +00:00
remote_src: yes # Overwrite even if "already exists on the target"
src: "{{ phpmyadmin_dl_url }}" # e.g. https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-all-languages.tar.xv
dest: /opt
2021-02-24 14:02:46 +00:00
owner: "{{ apache_user }}" # www-data on debuntu
group: "{{ apache_user }}"
#timeout: "{{ download_timeout }}" # Use get_url if timeout (100s) required
- name: Symlink /opt/phpmyadmin -> {{ phpmyadmin_name }}
file:
src: "{{ phpmyadmin_name }}"
path: /opt/phpmyadmin
2021-02-24 14:02:46 +00:00
#owner: "{{ apache_user }}" # Generally not used by Linux
#group: "{{ apache_user }}" # Generally not used by Linux
state: link
2021-02-24 14:02:46 +00:00
- name: Install /opt/phpmyadmin/config.inc.php owned by {{ apache_user }}:{{ apache_user }}, from template
template:
src: config.inc.php
dest: /opt/phpmyadmin/config.inc.php
owner: "{{ apache_user }}"
2021-02-24 14:02:46 +00:00
group: "{{ apache_user }}"
2021-02-03 19:49:17 +00:00
# Above 3 stanzas set link/tree/contents ownership to {{ apache_user }}:root
# OOPS: CHOWN BELOW CHANGED LINK ALONE (TREE/CONTENTS REMAINED root:root)
2021-02-03 19:49:17 +00:00
# - name: Change the owner of the PHP tree to Apache
# shell: "chown -R {{ apache_user }} /opt/phpmyadmin"
# #file:
# # path: "/opt/{{ phpmyadmin_name_zip }}"
# # owner: "{{ apache_user }}"
# # recurse: yes
# # state: directory
# RECORD phpMyAdmin AS INSTALLED
- name: "Set 'phpmyadmin_installed: True'"
set_fact:
phpmyadmin_installed: True
- name: "Add 'phpmyadmin_installed: True' to {{ iiab_state_file }}"
lineinfile:
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp: '^phpmyadmin_installed'
line: 'phpmyadmin_installed: True'