ansible-role-carbon/tests/playbooks/run.yaml

69 lines
2.4 KiB
YAML

# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- hosts: all
vars:
rolename: ansible-role-carbon
roles:
- ansible-role-whisper
- "{{ rolename }}"
post_tasks:
- name: Register carbon_git_dest_stat.
stat:
path: /home/zuul/src/github.com/graphite-project/carbon
register: carbon_git_dest_stat
when: carbon_install_method == 'git'
- name: Assert carbon_git_dest tests.
assert:
that:
- carbon_git_dest_stat.stat.exists
- carbon_git_dest_stat.stat.isdir
when: carbon_install_method == 'git'
- name: Register /etc/systemd/system/carbon-cache.service
stat:
path: /etc/systemd/system/carbon-cache.service
register: _carbon_cache_service_systemd_stat
- name: Assert _carbon_cache_service_systemd_stat tests.
assert:
that:
- _carbon_cache_service_systemd_stat.stat.exists
- _carbon_cache_service_systemd_stat.stat.isreg
- _carbon_cache_service_systemd_stat.stat.pw_name == 'root'
- _carbon_cache_service_systemd_stat.stat.gr_name == 'root'
- _carbon_cache_service_systemd_stat.stat.mode == '0644'
- name: Register /etc/systemd/system/carbon.cache.service.d/override.conf
stat:
path: /etc/systemd/system/carbon-cache.service.d/override.conf
register: _carbon_cache_service_config_stat
- name: Assert _carbon_cache_service_config_stat tests.
assert:
that:
- _carbon_cache_service_config_stat.stat.exists
- _carbon_cache_service_config_stat.stat.isreg
- _carbon_cache_service_config_stat.stat.pw_name == 'root'
- _carbon_cache_service_config_stat.stat.gr_name == 'root'
- _carbon_cache_service_config_stat.stat.mode == '0644'
- name: Ensure carbon-cache is running.
become: yes
shell: /usr/sbin/service carbon-cache status
tags: skip_ansible_lint