Simplify connmon install, cleanup all resources after each unmanage/restart/manage cycle, install on keystone last, move pbench to own playbook.

Change-Id: I363797e9aaf82bb892110ff9933a6dc9a85c094c
This commit is contained in:
Alex Krzos 2015-12-15 11:20:02 -05:00
parent 9a77b01e1e
commit b53b5a2e0e
11 changed files with 131 additions and 86 deletions

View File

@ -42,11 +42,18 @@ Run the check playbook to identify common performance issues:
# ansible-playbook -i hosts check/site.yml
```
## Ansible to Install connmon/pbench/shaker
## Ansible Installers:
Install connmon/shaker
```
# ansible-playbook -i hosts install/install.yml -e "pbench=true"
# ansible-playbook -i hosts install/install.yml -e "connmon=true"
# ansible-playbook -i hosts install/install.yml -e "shaker=true"
# ansible-playbook -i hosts install/install.yml -e "pbench=true connmon=true shaker=true"
# ansible-playbook -i hosts install/install.yml -e "connmon=true shaker=true"
```
Install pbench (Requires some knowledge of setting up pbench to have this functionality work completely)
```
# ansible-playbook -i hosts install/pbench.yml
```

View File

@ -1,6 +1,6 @@
---
#
# Playbook to install connmon and pbench on undercloud/overcloud
# Playbook to install connmon and shaker on undercloud/overcloud
#
- hosts: undercloud
@ -8,13 +8,11 @@
vars:
connmon: false
undercloud: true
pbench: false
shaker: false
roles:
- common
- undercloud
- connmon
- pbench
- shaker
- hosts: controller
@ -22,12 +20,10 @@
vars:
connmon: false
undercloud: false
pbench: false
shaker: false
roles:
- common
- connmon
- nova
- keystone
- neutron
- pbench
- keystone

View File

@ -0,0 +1,22 @@
---
#
# Playbook to install pbench on undercloud/overcloud
#
- hosts: undercloud
remote_user: stack
vars:
undercloud: true
roles:
- common
- pbench
- hosts: controller
remote_user: heat-admin
vars:
undercloud: false
undercloud_root_ssh_key: "{{ lookup('file', 'roles/pbench/files/undercloud_root_id_rsa.pub') }}"
undercloud_stack_ssh_key: "{{ lookup('file', 'roles/pbench/files/undercloud_stack_id_rsa.pub') }}"
roles:
- common
- pbench

View File

@ -30,3 +30,4 @@
- name: Run connmond in screen session on undercloud
command: screen -d -S connmond -m connmond
when: connmon and undercloud
changed_when: false

View File

@ -1,6 +1,6 @@
---
#
# Keystone tasks
# Keystone connmon tasks
#
- name: Determine if keystone is deployed in eventlet
@ -22,7 +22,7 @@
#
- name: Check for connmon in keystone.conf
shell: grep -q 'connection = mysql:' /etc/keystone/keystone.conf
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/keystone/keystone.conf
when: connmon
register: keystone_mysql
ignore_errors: true
@ -37,20 +37,3 @@
- restart keystone
- manage keystone
- cleanup keystone
- name: Check for connmon_service in keystone.conf
shell: grep -q 'connmon_service' /etc/keystone/keystone.conf
when: connmon
ignore_errors: true
register: keystone_connmon_service
changed_when: false
- name: Enable connmon in keystone.conf
shell: sed -i '/connection = mysql/s/$/?connmon_service=default/' /etc/keystone/keystone.conf
when: connmon and keystone_connmon_service.rc == 1
notify:
- restart httpd
- unmanage keystone
- restart keystone
- manage keystone
- cleanup keystone

View File

@ -0,0 +1,23 @@
---
#
# Neutron handlers
#
- name: unmanage neutron-server
command: pcs resource unmanage neutron-server
when: connmon
ignore_errors: true
- name: restart neutron-server
service: name=neutron-server state=restarted
when: connmon
- name: manage neutron-server
command: pcs resource manage neutron-server
when: connmon
ignore_errors: true
- name: cleanup neutron-server
command: pcs resource cleanup neutron-server
when: connmon
ignore_errors: true

View File

@ -1,29 +1,20 @@
---
#
# Neutron connmon tasks
#
- name: Check for connmon in neutron.conf
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/neutron/neutron.conf
register: neutron_mysql
when: connmon
ignore_errors: true
changed_when: no
changed_when: false
- name: Enable Connmon in neutron.conf
shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/neutron/neutron.conf
when: connmon and neutron_mysql.rc == 0
- name: Unmanage Neutron Service from pacemaker
shell: pcs resource unmanage {{ item }}
with_items:
- neutron-server
when: connmon
- name: Restart Neutron services
service: name={{ item }} state=restarted
with_items:
- neutron-server
when: connmon
- name: Manage Neutron Service from pacemaker
shell: pcs resource manage {{ item }}
with_items:
- neutron-server
when: connmon
notify:
- unmanage neutron-server
- restart neutron-server
- manage neutron-server
- cleanup neutron-server

View File

@ -0,0 +1,39 @@
---
#
# Nova handlers
#
- name: unmanage nova services
command: pcs resource unmanage {{ item }}
with_items:
- openstack-nova-conductor
- openstack-nova-api
- openstack-nova-scheduler
when: connmon
ignore_errors: true
- name: restart nova services
service: name={{ item }} state=restarted
with_items:
- openstack-nova-conductor
- openstack-nova-api
- openstack-nova-scheduler
when: connmon
- name: manage nova services
command: pcs resource manage {{ item }}
with_items:
- openstack-nova-conductor
- openstack-nova-api
- openstack-nova-scheduler
when: connmon
ignore_errors: true
- name: cleanup nova services
command: pcs resource cleanup {{ item }}
with_items:
- openstack-nova-conductor
- openstack-nova-api
- openstack-nova-scheduler
when: connmon
ignore_errors: true

View File

@ -1,35 +1,20 @@
---
#
# Nova connmon tasks
#
- name: Check for connmon in nova.conf
shell: grep -q 'connection=mysql:' /etc/nova/nova.conf
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/nova/nova.conf
register: nova_mysql
when: connmon
ignore_errors: true
changed_when: no
changed_when: false
- name: Enable Connmon in nova.conf
shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/nova/nova.conf
when: connmon and nova_mysql.rc == 0
- name: Unmanage Nova Service from pacemaker
shell: pcs resource unmanage {{ item }}
with_items:
- openstack-nova-conductor
- openstack-nova-api
- openstack-nova-scheduler
when: connmon
- name: Restart Nova services
service: name={{ item }} state=restarted
with_items:
- openstack-nova-conductor
- openstack-nova-api
- openstack-nova-scheduler
when: connmon
- name: Manage Nova Service from pacemaker
shell: pcs resource manage {{ item }}
with_items:
- openstack-nova-conductor
- openstack-nova-api
- openstack-nova-scheduler
when: connmon
notify:
- unmanage nova services
- restart nova services
- manage nova services
- cleanup nova services

View File

@ -1,51 +1,49 @@
---
#
# Tasks for pbench
# Tasks for pbench install
#
- name: Get repo file from undercloud
fetch: src=/etc/yum.repos.d/"{{ repo_name }}" dest=roles/pbench/files/el.repo flat=yes
when: pbench and undercloud
when: undercloud
changed_when: false
- name: Copy repo file to controllers/computes
copy: src=el.repo dest=/etc/yum.repos.d/
when: pbench and not undercloud
when: not undercloud
- name: Install pbench repo file
get_url: url="{{ pbench_repo_file_url }}" dest=/etc/yum.repos.d/pbench.repo
when: pbench
- name: Install pbench-agent
yum: name=pbench-agent state=latest
when: pbench
- name: Ensure pbench directory exists as stack user on undercloud
file: path=/var/lib/pbench-agent state=directory owner=stack group=stack recurse=yes
when: undercloud and pbench
when: undercloud
- name: Ensure pbench id_rsa is owned by stack
file: path=/opt/pbench-agent/id_rsa owner=stack group=stack
when: undercloud and pbench
when: undercloud
- name: Get undercloud root ssh public key
fetch: src=/root/.ssh/id_rsa.pub dest=roles/pbench/files/undercloud_root_id_rsa.pub flat=yes
when: undercloud and pbench
when: undercloud
changed_when: false
- name: Get undercloud stack ssh public key
fetch: src=/home/stack/.ssh/id_rsa.pub dest=roles/pbench/files/undercloud_stack_id_rsa.pub flat=yes
when: undercloud and pbench
when: undercloud
changed_when: false
- name: Unblock root user ssh on controllers/computes
lineinfile: dest=/root/.ssh/authorized_keys state=absent regexp="Please login as the user" mode=0600
when: not undercloud and pbench
when: not undercloud
- name: Copy undercloud root ssh public key to controllers/compute root user's authorized_keys
lineinfile: dest=/root/.ssh/authorized_keys state=present line="{{ undercloud_root_ssh_key }}"
when: not undercloud and pbench
when: not undercloud
- name: Copy undercloud stack ssh public key to controllers/compute root user's authorized_keys
lineinfile: dest=/root/.ssh/authorized_keys state=present line="{{ undercloud_stack_ssh_key }}"
when: not undercloud and pbench
when: not undercloud

View File

@ -1,6 +1,6 @@
---
#
# Tasks for Director Host to run BrowBeat with Connmon
# Tasks for undercloud to run browbeat with connmon
#
- name: check iptables