phpmyadmin

Ansible role phpmyadmin

phpMyAdmin installation for Linux

GitHub Version Issues Pull Requests Downloads
github Version Issues PullRequests Ansible Role

Example Playbook

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
- name: Converge
  hosts: all
  become: true

  vars:
    php_version: "7.3"
    phpmyadmin_enablerepo: "remi,remi-php73"
    phpmyadmin_mysql_user: sp3cial_us3r
    phpmyadmin_mysql_password: s3cure_password_h3r3

  pre_tasks:
    - name: Update apt cache.
      ansible.builtin.apt: update_cache=true cache_valid_time=600
      when: ansible_os_family == 'Debian'

  roles:
    # - role: geerlingguy.repo-remi  # TODO: Rebuild
    #   when: ansible_os_family == 'RedHat'
    # - role: geerlingguy.apache
    # - role: geerlingguy.mysql
    # - role: buluma.php_versions
    # - role: geerlingguy.php
    # - role: geerlingguy.php-mysql  # TODO: Rebuild
    - role: buluma.phpmyadmin

  post_tasks:
    - name: Ensure phpMyAdmin is running.
      ansible.builtin.uri:
        url: "http://127.0.0.1/phpmyadmin/"
        status_code: 200
      register: result
      until: result.status == 200
      retries: 60
      delay: 1

The machine needs to be prepared. In CI this is done using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: buluma.bootstrap
    - role: geerlingguy.apache
    - role: geerlingguy.mysql
    - role: geerlingguy.php
    - role: geerlingguy.php-mysql
    - role: geerlingguy.repo-remi

Also see a full explanation and example on how to use these roles.

Role Variables

The default values for the variables are set in defaults/main.yml:

---
# Pass in a comma-separated list of repos to use (e.g. "remi,epel"). Used only
# for RHEL/CentOS.
phpmyadmin_enablerepo: epel

# Override if needed. This is set platform-specific in the vars dir if not set.
# phpmyadmin_config_file: /etc/phpmyadmin/config.inc.php
phpmyadmin_mysql_host: localhost
phpmyadmin_mysql_port: ""
phpmyadmin_mysql_socket: ""
phpmyadmin_mysql_connect_type: tcp
phpmyadmin_mysql_user: root
phpmyadmin_mysql_password: "{{ mysql_root_password }}"

Requirements

State of used roles

The following roles are used to prepare a system. You can prepare your system in another way.

Requirement GitHub Version
buluma.bootstrap Ansible Molecule Version
geerlingguy.repo-remi Ansible Molecule Version
geerlingguy.apache Ansible Molecule Version
geerlingguy.mysql Ansible Molecule Version
buluma.php_versions Ansible Molecule Version
geerlingguy.php Ansible Molecule Version
geerlingguy.php-mysql Ansible Molecule Version

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles:

dependencies

Compatibility

This role has been tested on these container images:

container tags
EL all
Debian all
Ubuntu all

The minimum version of Ansible required is 2.4, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

If you find issues, please register them in GitHub

Changelog

Role History

License

Apache-2.0

Author Information

Shadow Walker

Install
ansible-galaxy install buluma/ansible-role-phpmyadmin
GitHub repository
License
apache-2.0
Downloads
20802
Owner
DevOps Engineer