Skip to content

Commit

Permalink
Merge pull request #14 from SergeyPirogov/master
Browse files Browse the repository at this point in the history
support for multihosts
  • Loading branch information
arslanbekov authored Jan 23, 2018
2 parents e5f434b + 6b3f6b0 commit 0c5a60a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ grid_router_port: 4444 # GridRouter port
grid_router_sctl_version: 1.2.0 # sctl version — https://github.com/seleniumkit/sctl/releases
grid_router_docker_api_version: 1.24 # Docker api version (for GridRouter)
grid_router_host_list: group # Host list for selenoid.xml
grid_router_region: region # Region for selenoid.xml
grid_router_host_name: selenoid[01:10].example.com # Host selenoid for selenoid.xml

grid_router_regions: # Hosts list per region
- name: "region-1"
hosts:
- name: localhost
port: 4444
browser_count: 4


grid_router_browsers: # Browser list usage selenoid
- name: "firefox"
defaultVersion: "54.0"
Expand Down Expand Up @@ -72,8 +79,29 @@ Ggr is [using](http://aerokube.com/ggr/latest/#_creating_users_file) htpasswd fi
```yaml
---
- hosts: all
vars:
grid_router_path: "{{ ansible_env.HOME }}/grid-router"
grid_router_qouta_path: "{{ ansible_env.HOME }}/grid-router/quota"
grid_router_port: 4445
grid_router_regions:
- name: "region-1"
hosts:
- name: 192.168.1.1
port: 4444
browser_count: 4
- name: 192.168.1.2
port: 4445
browser_count: 4
grid_router_browsers:
- name: "chrome"
defaultVersion: "62.0"
versions:
- "62.0"
- "63.0"
roles:
- gridrouter
- gridrouter-docker
```

## Dependencies
Expand Down
11 changes: 8 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ grid_router_port: 4444 # GridRouter port
grid_router_sctl_version: 1.2.0 # sctl version — https://github.com/seleniumkit/sctl/releases
grid_router_docker_api_version: 1.24 # Docker api version (for GridRouter)
grid_router_host_list: group # Host list for selenoid.xml
grid_router_region: region # Region for selenoid.xml
grid_router_host_name: selenoid[01:10].example.com # Host selenoid for selenoid.xml
grid_router_browser_count: 1 # number of browsers per host

grid_router_regions: # Hosts list per region
- name: "region-1"
hosts:
- name: localhost
port: 4444
browser_count: 4

grid_router_browsers: # Browser list usage selenoid
- name: "firefox"
defaultVersion: "54.0"
Expand Down
22 changes: 13 additions & 9 deletions templates/quota_template.json.j2
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"hosts": {
"{{ grid_router_host_list }}": {
"{{ grid_router_region }}": {
"{{ grid_router_host_name }}": {
"port": {{ grid_router_port }},
"count": {{ grid_router_browser_count }}
}
}
}
"hosts": {
"{{ grid_router_host_list }}": {
{% for region in grid_router_regions -%}
"{{ region.name }}": {
{% for host in region.hosts -%}
"{{ host.name }}": {
"port": {{ host.port }},
"count": {{ host.browser_count }}
}{%- if not loop.last -%},{%- endif -%}
{%- endfor %}
}
{%- endfor %}
}
},
"quota": {
"selenoid": {
Expand Down

0 comments on commit 0c5a60a

Please sign in to comment.