Remove rally_host_group variable

It was duplicating the meaning/purpose of the role
variable `rally_role_project_group`

Also ensure that additional tasks are limited to only
a single host in the host group.

Change-Id: I3d5cc822cc0d3c2b0b3ba7b05a9fe1b6b9e3a839
This commit is contained in:
Travis Truman 2016-08-23 10:32:59 -04:00
parent 0c26304c64
commit c0698d207b
7 changed files with 20 additions and 26 deletions

View File

@ -54,13 +54,11 @@ rally_pip_packages:
- pymysql
- rally
# The inventory group where Rally will be installed.
# This variable is used by the repo_build process to determine
# which host group to check for members of before building the
# pip packages required by this role. The value is picked up
# by the py_pkgs lookup.
rally_role_project_group: utility_all
# The inventory group where Rally will be installed
rally_host_group: rally_all
rally_config_overrides: {}

View File

@ -22,3 +22,16 @@
command: "{{ rally_bin }}/rally-manage db create"
when:
- rally_deployment_list_result.stdout | search("Table 'rally.deployments' doesn't exist")
- name: Check for existing Rally deployment
command: "{{ rally_bin }}/rally deployment list"
ignore_errors: true
register: rally_deployment_list_result
- name: Setup the Rally deployment
shell: |
. /root/openrc
. {{ rally_bin }}/activate
{{ rally_bin }}/rally deployment create --fromenv --name=existing
when:
- rally_deployment_list_result.stdout | search("There are no deployments")

View File

@ -37,6 +37,6 @@
- include: database-setup.yml
when:
- inventory_hostname == groups[rally_host_group][0]
- inventory_hostname == groups[rally_role_project_group][0]
tags:
- rally-install

View File

@ -22,15 +22,3 @@
mode: "0644"
config_overrides: "{{ rally_config_overrides }}"
config_type: "ini"
- name: Check for existing Rally deployment
command: "{{ rally_bin }}/rally deployment list"
ignore_errors: true
register: rally_deployment_list_result
- name: Setup the Rally deployment
shell: |
. /root/openrc
{{ rally_bin }}/rally deployment create --fromenv --name=existing
when:
- rally_deployment_list_result.stdout | search("There are no deployments")

View File

@ -20,5 +20,5 @@ galera_all
[keystone_all]
infra1
[rally_all]
[utility_all]
openstack1

View File

@ -14,15 +14,10 @@
# limitations under the License.
- name: Run a Rally scenario to ensure proper install/config
hosts: rally_all
hosts: utility_all
user: root
gather_facts: false
tasks:
- name: Create the deployment
shell: |
. /root/openrc
. {{ rally_bin }}/activate
{{ rally_bin }}/rally deployment create --fromenv --name=existing
- name: Copy the rally scenario
copy:
src: "{{ playbook_dir }}/files/scenario.json"

View File

@ -14,7 +14,7 @@
# limitations under the License.
- name: Deploy Rally
hosts: rally_all
hosts: utility_all
user: root
gather_facts: true
pre_tasks:
@ -26,7 +26,7 @@
name: "{{ rally_galera_database }}"
state: "present"
delegate_to: "10.100.100.2"
when: inventory_hostname == groups['rally_all'][0]
when: inventory_hostname == groups['utility_all'][0]
- name: Grant access to the DB for the service
mysql_user:
login_user: "root"
@ -41,7 +41,7 @@
- "localhost"
- "%"
delegate_to: "10.100.100.2"
when: inventory_hostname == groups['rally_all'][0]
when: inventory_hostname == groups['utility_all'][0]
roles:
- role: "{{ rolename | basename }}"
vars_files: