parent
fec23325d9
commit
ce633b5ebb
190 changed files with 224 additions and 150 deletions
@ -0,0 +1,8 @@ |
||||
--- |
||||
|
||||
- import_tasks: ../includes/webapps_compress_archive.yml |
||||
vars: |
||||
- root_dir: "{{ pma_root_dir }}" |
||||
- version: "{{ pma_current_version }}" |
||||
tags: pma |
||||
|
@ -0,0 +1,8 @@ |
||||
--- |
||||
|
||||
- import_tasks: ../includes/webapps_archive.yml |
||||
vars: |
||||
- root_dir: "{{ pma_root_dir }}" |
||||
- version: "{{ pma_current_version }}" |
||||
- db_name: "{{ pma_db_name }}" |
||||
tags: pma |
@ -0,0 +1,9 @@ |
||||
--- |
||||
|
||||
- name: Remove temp files |
||||
file: path={{ item }} state=absent |
||||
with_items: |
||||
- "{{ pma_root_dir }}/tmp/phpMyAdmin-{{ pma_version }}-all-languages.zip" |
||||
- "{{ pma_root_dir }}/tmp/phpMyAdmin-{{ pma_version }}-all-languages" |
||||
tags: pma |
||||
|
@ -0,0 +1,17 @@ |
||||
--- |
||||
|
||||
- import_tasks: ../includes/webapps_webconf.yml |
||||
vars: |
||||
- app_id: pma_{{ pma_id }} |
||||
- php_version: "{{ pma_php_version }}" |
||||
- php_fpm_pool: "{{ pma_php_fpm_pool | default('') }}" |
||||
tags: pma |
||||
|
||||
- name: Deploy sso scripts |
||||
template: src=sso.php.j2 dest={{ pma_root_dir }}/web/sso.php group={{ pma_php_user }} mode=640 |
||||
tags: pma |
||||
|
||||
- name: Deploy phpMyAdmin config |
||||
template: src=config.inc.php.j2 dest={{ pma_root_dir }}/web/config.inc.php group={{ pma_php_user }} mode=640 |
||||
tags: pma |
||||
|
@ -0,0 +1,14 @@ |
||||
--- |
||||
|
||||
- name: Create directory structure |
||||
file: path={{ item.dir }} state=directory mode={{ item.mode | default(omit) }} |
||||
loop: |
||||
- dir: "{{ pma_root_dir }}" |
||||
- dir: "{{ pma_root_dir }}/web" |
||||
- dir: "{{ pma_root_dir }}/tmp" |
||||
- dir: "{{ pma_root_dir }}/sessions" |
||||
- dir: "{{ pma_root_dir }}/cache" |
||||
- dir: "{{ pma_root_dir }}/meta" |
||||
mode: 700 |
||||
- dir: "{{ pma_root_dir }}/data" |
||||
tags: pma |
@ -0,0 +1,37 @@ |
||||
--- |
||||
|
||||
# Load distribution specific variables |
||||
- include_vars: "{{ item }}" |
||||
with_first_found: |
||||
- vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml |
||||
- vars/{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml |
||||
- vars/{{ ansible_distribution }}.yml |
||||
- vars/{{ ansible_os_family }}.yml |
||||
tags: pma |
||||
|
||||
# Detect current version (if any) and set install_mode (to none, upgrade or install) |
||||
- block: |
||||
- import_tasks: ../includes/webapps_set_install_mode.yml |
||||
vars: |
||||
- root_dir: "{{ pma_root_dir }}" |
||||
- version: "{{ pma_version }}" |
||||
- set_fact: pma_install_mode={{ (install_mode == 'upgrade' and not pma_manage_upgrade) | ternary('none',install_mode) }} |
||||
- set_fact: pma_current_version={{ current_version | default('') }} |
||||
tags: pma |
||||
|
||||
# Generate a random key for cookie signing |
||||
- block: |
||||
- import_tasks: ../includes/get_rand_pass.yml |
||||
vars: |
||||
- pass_file: "{{ pma_root_dir }}/meta/key.txt" |
||||
- set_fact: pma_key={{ rand_pass }} |
||||
tags: pma |
||||
|
||||
# Generate a DB password if not defined |
||||
- when: pma_db_pass is not defined |
||||
block: |
||||
- import_tasks: ../includes/get_rand_pass.yml |
||||
vars: |
||||
- pass_file: "{{pma_root_dir }}/meta/ansible_dbpass" |
||||
- set_fact: pma_db_pass={{ rand_pass }} |
||||
tags: pma |
@ -0,0 +1,54 @@ |
||||
--- |
||||
|
||||
- name: Install dependencies |
||||
yum: name={{ pma_packages }} |
||||
tags: pma |
||||
|
||||
- when: pma_install_mode != 'none' |
||||
block: |
||||
|
||||
- name: Download phpMyAdmin |
||||
get_url: |
||||
url: "{{ pma_archive_url }}" |
||||
dest: "{{ pma_root_dir }}/tmp/" |
||||
checksum: "sha256:{{ pma_archive_sha256 }}" |
||||
|
||||
- name: Extract pma archive |
||||
unarchive: |
||||
src: "{{ pma_root_dir }}/tmp/phpMyAdmin-{{ pma_version }}-all-languages.zip" |
||||
dest: "{{ pma_root_dir }}/tmp" |
||||
remote_src: yes |
||||
|
||||
- name: Move files to the correct directory |
||||
synchronize: |
||||
src: "{{ pma_root_dir }}/tmp/phpMyAdmin-{{ pma_version }}-all-languages/" |
||||
dest: "{{ pma_root_dir }}/web/" |
||||
compress: False |
||||
delete: True |
||||
delegate_to: "{{ inventory_hostname }}" |
||||
|
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/webapps_create_mysql_db.yml |
||||
vars: |
||||
- db_name: "{{ pma_db_name }}" |
||||
- db_user: "{{ pma_db_user }}" |
||||
- db_server: "{{ pma_db_server }}" |
||||
- db_pass: "{{ pma_db_pass }}" |
||||
tags: pma |
||||
|
||||
- name: Prepare SQL file to create tables |
||||
replace: path={{ pma_root_dir }}/web/sql/create_tables.sql regexp='phpmyadmin' replace={{ pma_db_name }} |
||||
tags: pma |
||||
|
||||
- name: Create tables |
||||
mysql_db: |
||||
name: "{{ pma_db_name }}" |
||||
state: import |
||||
target: "{{ pma_root_dir }}/web/sql/create_tables.sql" |
||||
login_host: "{{ pma_db_server }}" |
||||
login_user: sqladmin |
||||
login_password: "{{ mysql_admin_pass }}" |
||||
when: db_created.changed |
||||
tags: pma |
||||
|
@ -1,149 +1,14 @@ |
||||
--- |
||||
|
||||
- include_vars: "{{ item }}" |
||||
with_first_found: |
||||
- vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml |
||||
- vars/{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml |
||||
- vars/{{ ansible_distribution }}.yml |
||||
- vars/{{ ansible_os_family }}.yml |
||||
tags: pma |
||||
|
||||
- name: Install dependencies |
||||
yum: name={{ pma_packages }} |
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/create_system_user.yml |
||||
vars: |
||||
- user: "{{ pma_php_user }}" |
||||
- comment: "PHP FPM for pma {{ pma_id }}" |
||||
tags: pma |
||||
|
||||
- block: |
||||
- import_tasks: ../includes/webapps_set_install_mode.yml |
||||
vars: |
||||
- root_dir: "{{ pma_root_dir }}" |
||||
- version: "{{ pma_version }}" |
||||
- set_fact: pma_install_mode={{ (install_mode == 'upgrade' and not pma_manage_upgrade) | ternary('none',install_mode) }} |
||||
- set_fact: pma_current_version={{ current_version | default('') }} |
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/webapps_archive.yml |
||||
vars: |
||||
- root_dir: "{{ pma_root_dir }}" |
||||
- version: "{{ pma_current_version }}" |
||||
- db_name: "{{ pma_db_name }}" |
||||
- include: user.yml |
||||
- include: directories.yml |
||||
- include: facts.yml |
||||
- include: archive_pre.yml |
||||
when: pma_install_mode == 'upgrade' |
||||
tags: pma |
||||
|
||||
- name: Create directory structure |
||||
file: path={{ item }} state=directory |
||||
with_items: |
||||
- "{{ pma_root_dir }}" |
||||
- "{{ pma_root_dir }}/web" |
||||
- "{{ pma_root_dir }}/tmp" |
||||
- "{{ pma_root_dir }}/sessions" |
||||
- "{{ pma_root_dir }}/cache" |
||||
- "{{ pma_root_dir }}/meta" |
||||
- "{{ pma_root_dir }}/data" |
||||
tags: pma |
||||
|
||||
- name: Download phpMyAdmin |
||||
get_url: |
||||
url: "{{ pma_archive_url }}" |
||||
dest: "{{ pma_root_dir }}/tmp/" |
||||
checksum: "sha256:{{ pma_archive_sha256 }}" |
||||
when: pma_install_mode != 'none' |
||||
tags: pma |
||||
|
||||
- name: Extract pma archive |
||||
unarchive: |
||||
src: "{{ pma_root_dir }}/tmp/phpMyAdmin-{{ pma_version }}-all-languages.zip" |
||||
dest: "{{ pma_root_dir }}/tmp" |
||||
remote_src: yes |
||||
when: pma_install_mode != 'none' |
||||
tags: pma |
||||
|
||||
- name: Move files to the correct directory |
||||
synchronize: |
||||
src: "{{ pma_root_dir }}/tmp/phpMyAdmin-{{ pma_version }}-all-languages/" |
||||
dest: "{{ pma_root_dir }}/web/" |
||||
compress: False |
||||
delete: True |
||||
delegate_to: "{{ inventory_hostname }}" |
||||
when: pma_install_mode != 'none' |
||||
tags: pma |
||||
|
||||
- name: Remove temp files |
||||
file: path={{ item }} state=absent |
||||
with_items: |
||||
- "{{ pma_root_dir }}/tmp/phpMyAdmin-{{ pma_version }}-all-languages.zip" |
||||
- "{{ pma_root_dir }}/tmp/phpMyAdmin-{{ pma_version }}-all-languages" |
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/get_rand_pass.yml |
||||
vars: |
||||
- pass_file: "{{ pma_root_dir }}/meta/key.txt" |
||||
tags: pma |
||||
- set_fact: pma_key={{ rand_pass }} |
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/get_rand_pass.yml |
||||
vars: |
||||
- pass_file: "{{pma_root_dir }}/meta/ansible_dbpass" |
||||
when: pma_db_pass is not defined |
||||
tags: pma |
||||
- set_fact: pma_db_pass={{ rand_pass }} |
||||
when: pma_db_pass is not defined |
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/webapps_create_mysql_db.yml |
||||
vars: |
||||
- db_name: "{{ pma_db_name }}" |
||||
- db_user: "{{ pma_db_user }}" |
||||
- db_server: "{{ pma_db_server }}" |
||||
- db_pass: "{{ pma_db_pass }}" |
||||
tags: pma |
||||
|
||||
- name: Prepare SQL file to create tables |
||||
replace: path={{ pma_root_dir }}/web/sql/create_tables.sql regexp='phpmyadmin' replace={{ pma_db_name }} |
||||
tags: pma |
||||
|
||||
- name: Create tables |
||||
mysql_db: |
||||
name: "{{ pma_db_name }}" |
||||
state: import |
||||
target: "{{ pma_root_dir }}/web/sql/create_tables.sql" |
||||
login_host: "{{ pma_db_server }}" |
||||
login_user: sqladmin |
||||
login_password: "{{ mysql_admin_pass }}" |
||||
when: db_created.changed |
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/webapps_webconf.yml |
||||
vars: |
||||
- app_id: pma_{{ pma_id }} |
||||
- php_version: "{{ pma_php_version }}" |
||||
- php_fpm_pool: "{{ pma_php_fpm_pool | default('') }}" |
||||
tags: pma |
||||
|
||||
- name: Deploy sso scripts |
||||
template: src=sso.php.j2 dest={{ pma_root_dir }}/web/sso.php group={{ pma_php_user }} mode=640 |
||||
tags: pma |
||||
|
||||
- name: Deploy phpMyAdmin config |
||||
template: src=config.inc.php.j2 dest={{ pma_root_dir }}/web/config.inc.php group={{ pma_php_user }} mode=640 |
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/webapps_compress_archive.yml |
||||
vars: |
||||
- root_dir: "{{ pma_root_dir }}" |
||||
- version: "{{ pma_current_version }}" |
||||
- include: install.yml |
||||
- include: conf.yml |
||||
- include: archive_post.yml |
||||
when: pma_install_mode == 'upgrade' |
||||
tags: pma |
||||
|
||||
- import_tasks: ../includes/webapps_post.yml |
||||
vars: |
||||
- root_dir: "{{ pma_root_dir }}" |
||||
- version: "{{ pma_version }}" |
||||
tags: pma |
||||
- include: cleanup.yml |
||||
- include: write_version.yml |
||||
|
||||
|
@ -0,0 +1,8 @@ |
||||
--- |
||||
|
||||
- import_tasks: ../includes/create_system_user.yml |
||||
vars: |
||||
- user: "{{ pma_php_user }}" |
||||
- comment: "PHP FPM for pma {{ pma_id }}" |
||||
tags: pma |
||||
|
@ -0,0 +1,7 @@ |
||||
--- |
||||
|
||||
- import_tasks: ../includes/webapps_post.yml |
||||
vars: |
||||
- root_dir: "{{ pma_root_dir }}" |
||||
- version: "{{ pma_version }}" |
||||
tags: pma |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue