diff --git a/roles/pgadmin4/tasks/facts.yml b/roles/pgadmin4/tasks/facts.yml index 2d1c21e..8e59b5a 100644 --- a/roles/pgadmin4/tasks/facts.yml +++ b/roles/pgadmin4/tasks/facts.yml @@ -1,16 +1,22 @@ --- +- include_vars: "{{ item }}" + with_first_found: + - vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml + - vars/{{ ansible_distribution }}.yml + - vars/{{ ansible_os_family }}.yml + tags: pgadmin4 + - name: Check if a 2.7 venv exists stat: path={{ pga_root_dir }}/lib/python2.7 register: pga_venv_27 tags: pgadmin4 -- import_tasks: ../includes/webapps_set_install_mode.yml - vars: - - root_dir: "{{ pga_root_dir }}" - - version: "{{ pga_version }}" - tags: pgadmin4 -- set_fact: pga_install_mode={{ install_mode }} - tags: pgadmin4 -- set_fact: pga_current_version={{ current_version | default('') }} +- block: + - import_tasks: ../includes/webapps_set_install_mode.yml + vars: + - root_dir: "{{ pga_root_dir }}" + - version: "{{ pga_version }}" + - set_fact: pga_install_mode={{ install_mode }} + - set_fact: pga_current_version={{ current_version | default('') }} tags: pgadmin4 diff --git a/roles/pgadmin4/tasks/install.yml b/roles/pgadmin4/tasks/install.yml index 0843a32..2f75bca 100644 --- a/roles/pgadmin4/tasks/install.yml +++ b/roles/pgadmin4/tasks/install.yml @@ -1,15 +1,7 @@ --- - name: Install packages - yum: - name: - - gcc - - postgresql - - postgresql-devel - - python3-virtualenv - - python3-pip - - python-setuptools # Needed for pip install expect - - python-pip # Also needed to install expect + yum: name={{ pgadmin4_packages }} tags: pgadmin4 - name: Install global python tools diff --git a/roles/pgadmin4/vars/CentOS-7.yml b/roles/pgadmin4/vars/CentOS-7.yml new file mode 100644 index 0000000..831936e --- /dev/null +++ b/roles/pgadmin4/vars/CentOS-7.yml @@ -0,0 +1,11 @@ +--- + +pgadmin4_packages: + - gcc + - postgresql + - postgresql-devel + - python3-virtualenv + - python3-pip + - python-setuptools # Needed for pip install expect + - python-pip # Also needed to install expect + diff --git a/roles/pgadmin4/vars/CentOS-8.yml b/roles/pgadmin4/vars/CentOS-8.yml new file mode 100644 index 0000000..c763edc --- /dev/null +++ b/roles/pgadmin4/vars/CentOS-8.yml @@ -0,0 +1,10 @@ +--- + +pgadmin4_packages: + - gcc + - postgresql + - postgresql-devel + - python3-virtualenv + - python3-pip + - python3-setuptools # Needed for pip install expect + diff --git a/roles/phpmyadmin/meta/main.yml b/roles/phpmyadmin/meta/main.yml index c05a8d3..93562c6 100644 --- a/roles/phpmyadmin/meta/main.yml +++ b/roles/phpmyadmin/meta/main.yml @@ -3,3 +3,5 @@ allow_duplicates: True dependencies: - role: httpd_php + - role: mysql_server + when: pma_db_server in ['localhost','127.0.0.1'] diff --git a/roles/phpmyadmin/tasks/main.yml b/roles/phpmyadmin/tasks/main.yml index 01d9354..17ae428 100644 --- a/roles/phpmyadmin/tasks/main.yml +++ b/roles/phpmyadmin/tasks/main.yml @@ -1,12 +1,14 @@ --- +- include_vars: "{{ item }}" + with_first_found: + - vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml + - vars/{{ ansible_distribution }}.yml + - vars/{{ ansible_os_family }}.yml + tags: pma + - name: Install dependencies - yum: - name: - - unzip - - MySQL-python - - mariadb - - acl + yum: name={{ pma_packages }} tags: pma - import_tasks: ../includes/create_system_user.yml @@ -15,14 +17,13 @@ - comment: "PHP FPM for pma {{ pma_id }}" tags: pma -- import_tasks: ../includes/webapps_set_install_mode.yml - vars: - - root_dir: "{{ pma_root_dir }}" - - version: "{{ pma_version }}" - tags: pma -- set_fact: pma_install_mode={{ (install_mode == 'upgrade' and not pma_manage_upgrade) | ternary('none',install_mode) }} - tags: pma -- set_fact: pma_current_version={{ current_version | default('') }} +- 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 diff --git a/roles/phpmyadmin/vars/CentOS-7.yml b/roles/phpmyadmin/vars/CentOS-7.yml new file mode 100644 index 0000000..f11ff63 --- /dev/null +++ b/roles/phpmyadmin/vars/CentOS-7.yml @@ -0,0 +1,7 @@ +--- + +pma_packages: + - unzip + - MySQL-python + - mariadb + - acl diff --git a/roles/phpmyadmin/vars/CentOS-8.yml b/roles/phpmyadmin/vars/CentOS-8.yml new file mode 100644 index 0000000..946bee3 --- /dev/null +++ b/roles/phpmyadmin/vars/CentOS-8.yml @@ -0,0 +1,6 @@ +--- + +pma_packages: + - unzip + - mariadb + - acl