Improved logging for memcached

- Moved to the right folder to get it accessed on bare metal
  when containerized
- Making it work for rsyslog and logrotation's existing
  roles
- Changed the gate tests to reflect path change

Closes-Bug: #1569171

Change-Id: I3a1c2f50ab63b55b39318ba40c0921f6b738cafb
This commit is contained in:
Jean-Philippe Evrard 2016-04-13 13:36:28 +01:00
parent 589f45d66f
commit 2d937511d6
4 changed files with 19 additions and 3 deletions

View File

@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
## Verbosity Options
debug: False
verbose: False
## APT Cache Options
cache_timeout: 600
@ -28,7 +32,7 @@ memcached_memory: "{{ base_memcached_memory | int // 4 if base_memcached_memory
memcached_port: 11211
memcached_user: memcache
memcached_listen: "127.0.0.1"
memcached_log: /var/log/memcached.log
memcached_log: /var/log/memcached/memcached.log
memcached_connections: 1024
memcached_threads: 4

View File

@ -13,6 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Ensure logging folder exists
file:
path: "{{ memcached_log | dirname }}"
state: directory
- name: Apply memcached config
template:
src: "memcached.conf"

View File

@ -1,6 +1,13 @@
# {{ ansible_managed }}
-d
{% if debug | bool %}
-vvv
{% elif verbose | bool %}
-vv
{% else %}
-v
{% endif %}
logfile {{ memcached_log }}
-m {{ memcached_memory }}
-p {{ memcached_port }}

View File

@ -28,7 +28,7 @@
memcached_file_content: "{{ memcached_file.content | b64decode }}"
- name: Open memcached log file
stat:
path: /var/log/memcached.log
path: /var/log/memcached/memcached.log
register: memcached_log
- name: Check memcache is running
shell: ps auxfww | grep 'memcache'
@ -36,7 +36,7 @@
assert:
that:
- "memcached_log.stat.exists"
- "'logfile /var/log/memcached.log' in memcached_file_content"
- "'logfile /var/log/memcached/memcached.log' in memcached_file_content"
- "'-l 127.0.0.1' in memcached_file_content"
- "'-c 1024' in memcached_file_content"
- "'-t 4' in memcached_file_content"