Update Install work

+ Allow us to change usernames for non-ops installs. This mostly impacts
our dash/collectd work.
+ Updated browbeat, more options..
+ Removed more things pointed to the stack user
+ Remove EPEL

Change-Id: Ib6359b5dce9573a90c4c8d9f2f1853ef1d71bfec
This commit is contained in:
Joe Talerico 2016-03-04 13:06:49 -05:00
parent f0963dcd84
commit 912616634a
15 changed files with 104 additions and 73 deletions

View File

@ -4,12 +4,12 @@
#
- hosts: controller
remote_user: heat-admin
remote_user: "{{ host_remote_user }}"
roles:
- shaker-check
- hosts: undercloud
remote_user: stack
remote_user: "{{ local_remote_user }}"
vars:
results_in_httpd: true
roles:

View File

@ -4,7 +4,7 @@
#
- hosts: undercloud
remote_user: stack
remote_user: "{{ local_remote_user }}"
roles:
- { role: common, when: collectd_undercloud }
- { role: collectd, when: collectd_undercloud }
@ -15,7 +15,7 @@
when: not collectd_undercloud
- hosts: controller
remote_user: heat-admin
remote_user: "{{ host_remote_user }}"
roles:
- { role: common, when: collectd_controller }
- { role: collectd, when: collectd_controller }
@ -26,7 +26,7 @@
when: not collectd_controller
- hosts: ceph
remote_user: heat-admin
remote_user: "{{ host_remote_user }}"
roles:
- { role: common, when: collectd_ceph }
- { role: collectd, when: collectd_ceph }
@ -37,7 +37,7 @@
when: not collectd_ceph
- hosts: compute
remote_user: heat-admin
remote_user: "{{ host_remote_user }}"
roles:
- { role: common, when: collectd_compute }
- { role: collectd, when: collectd_compute }

View File

@ -4,7 +4,7 @@
#
- hosts: undercloud
remote_user: stack
remote_user: "{{ local_remote_user }}"
vars:
ansible_become: true
undercloud: true
@ -13,7 +13,7 @@
- connmon
- hosts: controller
remote_user: heat-admin
remote_user: "{{ host_remote_user }}"
vars:
ansible_become: true
undercloud: false

View File

@ -5,7 +5,7 @@
- hosts: undercloud
gather_facts: false
remote_user: stack
remote_user: "{{ local_remote_user }}"
vars:
overwrite_existing: true
roles:

View File

@ -1,9 +1,37 @@
---
browbeat_path: /home/stack/browbeat
home_dir: /home/stack
# Login user for the remote hosts
host_remote_user: heat-admin
# Login user for the local/jump machine
local_remote_user: stack
# The Overcloud RC file
overcloudrc: /home/stack/overcloudrc
# The default Shaker
shaker_venv: /home/stack/shakershaker-venv-venv/bin/activate
shaker_centos: /home/stack/shaker-venv/lib/python2.7/site-packages/shaker/resources/image_builder_templates/centos.yaml
# The default Browbeat
browbeat_venv: /home/stack/browbeat-venv
# The default Rally venv
rally_venv: /home/stack/rally-venv
# The default Shaker venv
shaker_venv: /home/stack/shaker-venv
# Guest images for the Over cloud
centos_image_url: http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
cirros_image_url: http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
# Host where connmond will be running
connmon_host: 192.0.2.1
# DNS Server to add
dns_server: 8.8.8.8
# Collectd interval (seconds)

View File

@ -23,42 +23,42 @@
become: true
- name: Create browbeat virtualenv
command: virtualenv /home/stack/browbeat-venv creates="/home/stack/browbeat-venv"
command: virtualenv "{{ browbeat_venv }}" creates=""{{ browbeat_venv }}""
- name: Create rally virtualenv
command: virtualenv /home/stack/rally-venv creates="/home/stack/rally-venv"
command: virtualenv "{{ rally_venv }}" creates=""{{ rally_venv }}""
- name: Create shaker virtualenv
command: virtualenv /home/stack/shaker-venv creates="/home/stack/shaker-venv"
command: virtualenv "{{ shaker_venv }}" creates=""{{ shaker_venv }}""
- name: Clone browbeat on undercloud
git: repo=https://github.com/jtaleric/browbeat.git dest=/home/stack/browbeat
git: repo=https://github.com/jtaleric/browbeat.git dest="{{ home_dir }}"/browbeat
when: "'localhost' not in '{{ inventory_hostname }}'"
- name: Generate hosts and ~/.ssh/config on undercloud
shell: . /home/stack/stackrc; /home/stack/browbeat/ansible/gen_hostfile.sh localhost /home/stack/.ssh/config
shell: . "{{ home_dir }}"/stackrc; "{{ home_dir }}"/browbeat/ansible/gen_hostfile.sh localhost "{{ home_dir }}"/.ssh/config
when: "'localhost' not in '{{ inventory_hostname }}'"
- name: Move hosts file to correct location
command: mv /home/stack/hosts /home/stack/browbeat/ansible/hosts
command: mv "{{ home_dir }}"/hosts "{{ home_dir }}"/browbeat/ansible/hosts
when: "'localhost' not in '{{ inventory_hostname }}'"
- name: Install requirements.txt into browbeat-venv
pip: requirements=/home/stack/browbeat/requirements.txt virtualenv=/home/stack/browbeat-venv
pip: requirements="{{ browbeat_path }}"/requirements.txt virtualenv=""{{ browbeat_venv }}""
become: true
- name: Install rally into rally-venv
pip: name=rally virtualenv=/home/stack/rally-venv
pip: name=rally virtualenv="{{ rally_venv }}"
become: true
- name: Setup rally database
shell: . /home/stack/rally-venv/bin/activate; rally-manage db recreate
shell: . "{{ rally_venv}}"/bin/activate; rally-manage db recreate
- name: Setup rally deployment
shell: . /home/stack/rally-venv/bin/activate; . /home/stack/overcloudrc; rally deployment create --fromenv --name overcloud
shell: . "{{ rally_venv }}"/bin/activate; . "{{ overcloudrc }}"; rally deployment create --fromenv --name overcloud
- name: Install shaker
pip: name=pyshaker version=0.0.10 virtualenv=/home/stack/shaker-venv
pip: name=pyshaker version=0.0.10 virtualenv=""{{ shaker_venv }}""
- name: Check for shaker port in iptables
shell: iptables -nvL | grep -q "dpt:"{{ shaker_port }}""
@ -77,8 +77,8 @@
#
- name: Setup browbeat.conf in /etc/httpd/conf.d
copy:
src: 00-browbeat.conf
template:
src: 00-browbeat.conf.j2
dest: /etc/httpd/conf.d/00-browbeat.conf
owner: root
group: root
@ -106,8 +106,8 @@
become: true
when: results_in_httpd
- name: Allow httpd to serve content in /home/stack
file: path=/home/stack state=directory mode=0755
- name: Allow httpd to serve content in "{{ home_dir }}"
file: path="{{ home_dir }}" state=directory mode=0755
when: results_in_httpd
#
@ -115,42 +115,42 @@
#
- name: Fetch cirros image
get_url: url={{ cirros_image_url }} dest=/home/stack/cirros.img
get_url: url={{ cirros_image_url }} dest="{{ home_dir }}"/cirros.img
- name: Determine is cirros image exists
shell: . /home/stack/overcloudrc; glance image-list | grep "cirros"
shell: . "{{ overcloudrc }}"; glance image-list | grep "cirros"
register: cirros_image_exists
ignore_errors: true
changed_when: false
- name: Upload cirros image into cloud (OSP8)
shell: . /home/stack/overcloudrc; glance image-create --name cirros --visibility public --disk-format=qcow2 --container-format=bare < /home/stack/cirros.img
shell: . "{{ overcloudrc }}"; glance image-create --name cirros --visibility public --disk-format=qcow2 --container-format=bare < "{{ home_dir }}"/cirros.img
when: "'cirros' not in '{{ cirros_image_exists.stdout }}'"
register: cirros_image_osp8
ignore_errors: true
- name: Upload cirros image into cloud (OSP7)
shell: . /home/stack/overcloudrc; glance image-create --name cirros --is-public true --disk-format=qcow2 --container-format=bare < /home/stack/cirros.img
shell: . "{{ overcloudrc }}"; glance image-create --name cirros --is-public true --disk-format=qcow2 --container-format=bare < "{{ home_dir }}"/cirros.img
when: "'cirros' not in '{{ cirros_image_exists.stdout }}' and not cirros_image_osp8.rc == 0"
ignore_errors: true
- name: Fetch centos7 image
get_url: url={{ centos_image_url }} dest=/home/stack/centos7.qcow2
get_url: url={{ centos_image_url }} dest="{{ home_dir }}"/centos7.qcow2
- name: Determine is centos7 image exists
shell: . /home/stack/overcloudrc; glance image-list | grep "centos7"
shell: . "{{ overcloudrc }}"; glance image-list | grep "centos7"
register: centos7_image_exists
ignore_errors: true
changed_when: false
- name: Upload centos7 image into cloud (OSP8)
shell: . /home/stack/overcloudrc; glance image-create --name centos7 --visibility public --disk-format=qcow2 --container-format=bare < /home/stack/centos7.qcow2
shell: . "{{ overcloudrc }}"; glance image-create --name centos7 --visibility public --disk-format=qcow2 --container-format=bare < "{{ home_dir }}"/centos7.qcow2
when: "'centos7' not in '{{ centos7_image_exists.stdout }}'"
register: centos7_image_osp8
ignore_errors: true
- name: Upload centos7 image into cloud (OSP7)
shell: . /home/stack/overcloudrc; glance image-create --name centos7 --is-public true --disk-format=qcow2 --container-format=bare < /home/stack/centos7.qcow2
shell: . "{{ overcloudrc }}"; glance image-create --name centos7 --is-public true --disk-format=qcow2 --container-format=bare < "{{ home_dir }}"/centos7.qcow2
when: "'centos7' not in '{{ centos7_image_exists.stdout }}' and not centos7_image_osp8.rc == 0"
ignore_errors: true

View File

@ -4,8 +4,8 @@
Listen 9000
<VirtualHost *:9000>
ServerName browbeat-results
DocumentRoot "/home/stack/browbeat/results"
<Directory "/home/stack/browbeat/results">
DocumentRoot "{{ browbeat_path }}/results"
<Directory "{{ browbeat_path }}/results">
Options Indexes FollowSymLinks
IndexOptions NameWidth=*
AllowOverride None

@ -0,0 +1 @@
Subproject commit 1f7820e845d13e824c945b58f61aaac360854171

View File

@ -87,3 +87,7 @@
- name: Setup collectd service
service: name=collectd state=restarted enabled=true
become: true
- name: Disable EPEL
yum: disablerepo=epel
become: true

View File

@ -15,13 +15,11 @@
- name: Configure Connmon Host IP Address
template:
src=connmon.cfg.j2
dest=/etc/connmon.cfg
owner=root
group=root
mode=0644
with_items:
- ip_address: "{{ connmon_host }}"
src: connmon.cfg.j2
dest: /etc/connmon.cfg
owner: root
group: root
mode: 0644
# To remove the screen session: screen -X -S connmond kill
- name: Run connmond in screen session on undercloud
@ -30,7 +28,7 @@
changed_when: false
- name: Change connmon result owner
command: chown stack:stack /tmp/connmon_results.csv
command: chown "{{ local_remote_user }}":"{{ local_remote_user }}" /tmp/connmon_results.csv
when: undercloud
changed_when: false
ignore_errors: true

View File

@ -2,4 +2,4 @@
name: default
csv_dump: /tmp/connmon_results.csv
nodes:
node1 hostname={{ item.ip_address }}:5800 bind=0.0.0.0
node1 hostname={{ connmon_host }}:5800 bind=0.0.0.0

View File

@ -6,9 +6,9 @@
- name: Generate All Nodes CPU Dashboard
template:
src: all_cpu_graphs.json.j2
dest: /home/stack/all_cpu_graphs.json
owner: stack
group: stack
dest: "{{ home_dir }}/all_cpu_graphs.json"
owner: "{{ local_remote_user }}"
group: "{{ local_remote_user }}"
mode: 0644
with_items:
- prefix: "{{ graphite_prefix }}"
@ -16,9 +16,9 @@
- name: Generate All Nodes Memory Dashboard
template:
src: all_memory_graphs.json.j2
dest: /home/stack/all_memory_graphs.json
owner: stack
group: stack
dest: "{{ home_dir }}/all_memory_graphs.json"
owner: "{{ local_remote_user }}"
group: "{{ local_remote_user }}"
mode: 0644
with_items:
- prefix: "{{ graphite_prefix }}"
@ -26,9 +26,9 @@
- name: Generate All Nodes Disk Dashboard
template:
src: all_disk_graphs.json.j2
dest: /home/stack/all_disk_graphs.json
owner: stack
group: stack
dest: "{{ home_dir }}/all_disk_graphs.json"
owner: "{{ local_remote_user }}"
group: "{{ local_remote_user }}"
mode: 0644
with_items:
- prefix: "{{ graphite_prefix }}"
@ -36,9 +36,9 @@
- name: Generate All Nodes Network Dashboard
template:
src: all_network_graphs.json.j2
dest: /home/stack/all_network_graphs.json
owner: stack
group: stack
dest: "{{ home_dir }}/all_network_graphs.json"
owner: "{{ local_remote_user }}"
group: "{{ local_remote_user }}"
mode: 0644
with_items:
- prefix: "{{ graphite_prefix }}"
@ -46,9 +46,9 @@
- name: Copy Static Openstack Dashboards
copy:
src: "{{ item }}"
dest: /home/stack/{{ item }}
owner: stack
group: stack
dest: "{{ home_dir }}/{{ item }}"
owner: "{{ local_remote_user }}"
group: "{{ local_remote_user }}"
mode: 0744
with_items:
- openstack_general_system_performance.json
@ -79,9 +79,9 @@
- name: Remove leftover json file(s)
file: path={{ item }} state=absent
with_items:
- /home/stack/all_cpu_graphs.json
- /home/stack/all_memory_graphs.json
- /home/stack/all_disk_graphs.json
- /home/stack/all_network_graphs.json
- /home/stack/openstack_general_system_performance.json
- /home/stack/openstack_cloud_system_performance_comparsion.json
- "{{ home_dir }}/all_cpu_graphs.json"
- "{{ home_dir }}/all_memory_graphs.json"
- "{{ home_dir }}/all_disk_graphs.json"
- "{{ home_dir }}/all_network_graphs.json"
- "{{ home_dir }}/openstack_general_system_performance.json"
- "{{ home_dir }}/openstack_cloud_system_performance_comparsion.json"

View File

@ -4,15 +4,15 @@
#
- name: Create shaker public network
shell: ". /home/stack/overcloudrc; neutron net-create {{shaker_network_name}} --router:external | grep -E ' id ' | awk '{print $4}'"
shell: ". {{ overcloudrc }}; neutron net-create {{shaker_network_name}} --router:external | grep -E ' id ' | awk '{print $4}'"
register: public_net_id
- name: Create shaker public subnet
shell: ". /home/stack/overcloudrc; neutron subnet-create {{public_net_id.stdout}} {{shaker_public_subnet}} --allocation-pool start={{shaker_pool_start}},end={{shaker_pool_end}} --gateway={{shaker_pool_gw}} --disable-dhcp | grep -E ' id ' | awk '{print $4}'"
shell: ". {{ overcloudrc }}; neutron subnet-create {{public_net_id.stdout}} {{shaker_public_subnet}} --allocation-pool start={{shaker_pool_start}},end={{shaker_pool_end}} --gateway={{shaker_pool_gw}} --disable-dhcp | grep -E ' id ' | awk '{print $4}'"
register: subnet_id
- name: Create shaker router
shell: ". /home/stack/overcloudrc; neutron router-create {{shaker_router_name}} | grep -E ' id ' | awk '{print $4}'"
shell: ". {{ overcloudrc }}; neutron router-create {{shaker_router_name}} | grep -E ' id ' | awk '{print $4}'"
- name: Set shaker router gateway
shell: ". /home/stack/overcloudrc; neutron router-gateway-set {{shaker_router_name}} {{shaker_network_name}}"
shell: ". {{ overcloudrc }}; neutron router-gateway-set {{shaker_router_name}} {{shaker_network_name}}"

View File

@ -4,13 +4,13 @@
#
- hosts: undercloud
remote_user: stack
remote_user: "{{ local_remote_user }}"
tasks:
- name: build shaker image
shell: >
source /home/stack/overcloudrc; source /home/stack/shaker-venv/bin/activate;
source "{{ overcloudrc }}"; source "{{ shaker_venv }}";
shaker-image-builder --flavor-name {{ shaker_flavor }} --image-builder-template
/home/stack/shaker-venv/lib/python2.7/site-packages/shaker/resources/image_builder_templates/centos.yaml
"{{ shaker_centos }}"
--os-region-name regionOne
become: true
register: image_result

View File

@ -4,6 +4,6 @@
#
- hosts: undercloud
remote_user: stack
remote_user: "{{ local_remote_user }}"
roles:
- shaker-network