Merge "Add statsd01 host"

This commit is contained in:
Zuul 2018-04-04 19:06:29 +00:00 committed by Gerrit Code Review
commit 2dd521e0b1
13 changed files with 156 additions and 0 deletions

View File

@ -10,6 +10,7 @@
- openstack/ansible-role-nodepool
- openstack/ansible-role-shade
- openstack/ansible-role-ssh
- openstack/ansible-role-statsd
- openstack/ansible-role-sudoers
- openstack/ansible-role-virtualenv
- openstack/ansible-role-zookeeper

View File

@ -25,6 +25,8 @@
name: openstack.nodepool
- zuul: openstack/ansible-role-shade
name: openstack.shade
- zuul: openstack/ansible-role-statsd
name: openstack.statsd
- zuul: openstack/ansible-role-ssh
name: openstack.ssh
- zuul: openstack/ansible-role-sudoers
@ -71,6 +73,7 @@
- gear01
- nb01
- nl01
- statsd01
- ze01
- zf01
- zk01
@ -88,6 +91,9 @@
- name: nodepool-launcher
nodes:
- nl01
- name: statsd
nodes:
- statsd01
- name: zookeeper
nodes:
- zk01
@ -117,6 +123,7 @@
- gear01
- nb01
- nl01
- statsd01
- ze01
- zf01
- zk01
@ -134,6 +141,9 @@
- name: nodepool-launcher
nodes:
- nl01
- name: statsd
nodes:
- statsd01
- name: zookeeper
nodes:
- zk01
@ -163,6 +173,7 @@
- gear01
- nb01
- nl01
- statsd01
- ze01
- zf01
- zk01
@ -180,6 +191,9 @@
- name: nodepool-launcher
nodes:
- nl01
- name: statsd
nodes:
- statsd01
- name: zookeeper
nodes:
- zk01

View File

@ -10,6 +10,9 @@ nb01 ansible_host=127.0.1.1
[nodepool-launcher]
nl01 ansible_host=127.0.7.1
[statsd]
statsd01 ansible_host=127.0.9.1
[zookeeper]
zk01 ansible_host=127.0.6.1

View File

@ -0,0 +1,27 @@
# Copyright 2016 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.
---
# windmill.statsd
statsd_file_config_js_src: statsd/etc/statsd/config.js.j2
# openstack.logrotate
logrotate_configs:
- name: statsd
log: /var/log/statsd/statsd.log
options:
- compress
- missingok
- rotate 7
- daily
- notifempty

View File

@ -0,0 +1,23 @@
# Copyright 2017 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.
---
- name: Ensure statsd is running
become: yes
shell: /usr/sbin/service statsd status
tags: skip_ansible_lint
- name: Ensure logrotate is setup
become: yes
command: logrotate -d /etc/logrotate.d/statsd
tags: skip_ansible_lint

View File

@ -13,6 +13,7 @@
# under the License.
---
- include: bootstrap.yaml
- include: statsd.yaml
- include: gear.yaml
- include: zookeeper.yaml
- include: nodepool-builder.yaml

30
playbooks/statsd.yaml Normal file
View File

@ -0,0 +1,30 @@
# Copyright 2017 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.
---
- name: Install statsd.
hosts: statsd
tasks:
- name: Setup openstack.statsd role.
include_role:
name: openstack.statsd
- name: Setup openstack.logrotate role.
include_role:
name: openstack.logrotate
post_tasks:
- name: Run statsd validation.
include_role:
name: test.statsd

View File

@ -2,4 +2,7 @@
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
[Service]
{% if ansible_host | ipv4 %}
Environment="STATSD_HOST={{ hostvars['statsd01'].ansible_host }}"
{% endif %}
Environment="PREFIX={{ nodepool_pip_virtualenv }}"

View File

@ -2,4 +2,7 @@
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
#
[Service]
{% if ansible_host | ipv4 %}
Environment="STATSD_HOST={{ hostvars['statsd01'].ansible_host }}"
{% endif %}
Environment="PREFIX={{ nodepool_pip_virtualenv }}"

View File

@ -0,0 +1,8 @@
{
{% if ansible_host | ipv6 %}
address_ipv6: true,
{% endif %}
backends: [ "./backends/console" ],
host: "{{ ansible_host }}",
port: 8125
}

View File

@ -23,6 +23,11 @@ log_config = /etc/zuul/scheduler-logging.conf
pidfile = /var/run/zuul-scheduler/zuul-scheduler.pid
state_dir = {{ zuul_user_home }}
{% if ansible_host | ipv4 %}
[statsd]
server = {{ hostvars['statsd01'].ansible_host }}
{% endif %}
[executor]
finger_port = 17979
log_config = /etc/zuul/executor-logging.conf

View File

@ -9,12 +9,47 @@
- "{{ zuul.executor.log_root }}/logs/gear01/var/log"
- "{{ zuul.executor.log_root }}/logs/nb01/var/log"
- "{{ zuul.executor.log_root }}/logs/nl01/var/log"
- "{{ zuul.executor.log_root }}/logs/statsd01/var/log"
- "{{ zuul.executor.log_root }}/logs/ze01/var/log"
- "{{ zuul.executor.log_root }}/logs/zf01/var/log"
- "{{ zuul.executor.log_root }}/logs/zm01/var/log"
- "{{ zuul.executor.log_root }}/logs/zs01/var/log"
- "{{ zuul.executor.log_root }}/logs/zw01/var/log"
- hosts: statsd01
tasks:
- name: Ensure journald logs directory exists
file:
path: "~/logs/{{ inventory_hostname }}/journal"
state: directory
- name: Collect journald logs
become: yes
shell: "journalctl -u {{ item }}.service > /home/{{ ansible_user }}/logs/{{ inventory_hostname }}/journal/{{ item }}.service.log"
args:
creates: "/home/{{ ansible_user }}/logs/{{ inventory_hostname }}/journal/{{ item }}.service.log"
with_items:
- statsd
- name: Collect journald log files
synchronize:
dest: "{{ zuul.executor.log_root }}/logs/{{ inventory_hostname }}/var/log"
mode: pull
src: "~/logs/{{ inventory_hostname }}/journal"
verify_host: true
- name: Collect statsd log files
synchronize:
dest: "{{ zuul.executor.log_root }}/logs/{{ inventory_hostname }}"
mode: pull
rsync_opts:
- "--relative"
src: "{{ item }}"
verify_host: true
with_items:
- /etc/statsd
- /var/log/statsd
- hosts: gear01
tasks:
- name: Ensure journald logs directory exists

View File

@ -16,6 +16,9 @@
- src: git+https://git.openstack.org/openstack/ansible-role-ssh
name: openstack.ssh
- src: git+https://git.openstack.org/openstack/ansible-role-statsd
name: openstack.statsd
- src: git+https://git.openstack.org/openstack/ansible-role-sudoers
name: openstack.sudoers