memcached: add tasks for phpmemcachedadmin

samba
Victor LABORIE 6 years ago
parent 3721f83819
commit 5d7a38e959
  1. 6
      memcached/defaults/main.yml
  2. 26
      memcached/tasks/phpmemcachedadmin.yml
  3. 32
      memcached/templates/Memcache.php.j2

@ -5,3 +5,9 @@ memcached_user: 'nobody'
memcached_bind_interface: '127.0.0.1'
memcached_connections: 1024
memcached_port: 11211
phpmemcachedadmin_clusters:
- { name: 'Default',
servers: [
{ name: 'localhost', hostname: '127.0.0.1', port: 11211 }
]
}

@ -0,0 +1,26 @@
---
- name: Create phpMemcachedAdmin root dir
file:
path: /var/www/phpmemcachedadmin/
state: directory
mode: "0755"
tags:
- memcached
- name: Install phpMemcachedAdmin
unarchive:
src: 'https://github.com/elijaa/phpmemcachedadmin/archive/1.3.0.tar.gz'
dest: /var/www/phpmemcachedadmin/
remote_src: True
extra_opts: --strip-components=1
mode: "0755"
tags:
- memcached
- name: Copy phpMemcachedAdmin config
template:
src: Memcache.php.j2
dest: /var/www/phpmemcachedadmin/Config/Memcache.php
mode: "0755"
tags:
- memcached

@ -0,0 +1,32 @@
<?php
return array (
'stats_api' => 'Server',
'slabs_api' => 'Server',
'items_api' => 'Server',
'get_api' => 'Server',
'set_api' => 'Server',
'delete_api' => 'Server',
'flush_all_api' => 'Server',
'connection_timeout' => '1',
'max_item_dump' => '100',
'refresh_rate' => 2,
'memory_alert' => '80',
'hit_rate_alert' => '90',
'eviction_alert' => '0',
'file_path' => 'Temp/',
'servers' =>
array (
{% for cluster in phpmemcachedadmin_clusters %}
'{{ cluster.name }}' =>
array (
{% for server in cluster.servers %}
'{{ server.name }}' =>
array (
'hostname' => '{{ server.hostname }}',
'port' => '{{ server.port }}',
),
{% endfor %}
),
{% endfor %}
),
);
Loading…
Cancel
Save