diff --git a/.travis.yml b/.travis.yml index 3b39682..7c82eab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - sudo apt-get update -qq install: - - sudo pip install docker-py + - sudo pip install docker - sudo apt-get install -y sshpass software-properties-common python-software-properties - sudo apt-add-repository -y ppa:ansible/ansible - sudo apt-get update -qq diff --git a/README.md b/README.md index a252792..4c6ca15 100644 --- a/README.md +++ b/README.md @@ -12,10 +12,9 @@ Set up [selenoid](https://github.com/aerokube/selenoid) in docker #### Variables ```yaml -selenoid_version: 1.4.0 -selenoid_cm_version: 1.3.1 -selenoid_docker_api_version: 1.24 -selenoid_limit: 4 +selenoid_version: 1.6.0 +selenoid_cm_version: 1.4.2 +selenoid_limit: 5 selenoid_tmpfs: 128 selenoid_config_dir: /etc/selenoid selenoid_listen_port: 4444 @@ -25,6 +24,8 @@ selenoid_browsers: - firefox - opera - chrome +selenoid_video_host_output_dir: /var/lib/selenoid/video +selenoid_video_container_output_dir: /opt/selenoid/video ``` #### Example diff --git a/defaults/main.yml b/defaults/main.yml index 4099900..e78fd47 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,7 @@ --- -selenoid_version: 1.4.0 # Install selenoid version -selenoid_cm_version: 1.3.1 # Install configuration manager version -selenoid_docker_api_version: 1.24 # Docker api version (for Selenoid) -selenoid_limit: 4 # Total number of simultaneously running containers http://aerokube.com/selenoid/latest/#_recommended_docker_settings +selenoid_version: 1.6.0 # Install selenoid version +selenoid_cm_version: 1.4.2 # Install configuration manager version +selenoid_limit: 5 # Total number of simultaneously running containers http://aerokube.com/selenoid/latest/#_recommended_docker_settings selenoid_tmpfs: 128 # Add in-memory filesystem (tmpfs) to container http://aerokube.com/selenoid/latest/#_other_optional_fields selenoid_config_dir: /etc/selenoid # Selenoid configuration dir selenoid_listen_port: 4444 # Listen port @@ -12,3 +11,5 @@ selenoid_browsers: # What browsers to download - firefox - opera - chrome +selenoid_video_host_output_dir: /var/lib/selenoid/video # Dir for save video in host path +selenoid_video_container_output_dir: /opt/selenoid/video # Dir for save video in container (default: /opt/selenoid/video) diff --git a/tasks/main.yml b/tasks/main.yml index e64b5b6..b2cde8a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,7 +3,7 @@ pip: name: "{{ item.name }}" with_items: - - { name: docker-py } + - { name: docker } - name: Selenoid | Check selenoid container exist shell: 'docker ps -aq --filter "name={{ item }}"' @@ -16,6 +16,12 @@ with_items: '{{ found_containers.results }}' when: item.stdout +- name: Selenoid | Create video folder + file: + path: "{{ selenoid_video_host_output_dir }}" + state: directory + mode: 0755 + - name: Selenoid | Run CM container, download browser images and run selenoid docker_container: name: cm @@ -23,17 +29,17 @@ volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "/root:/root" + - "{{ selenoid_video_host_output_dir }}:{{ selenoid_video_container_output_dir }}" env: TZ: "{{ selenoid_time_zone }}" OVERRIDE_HOME: "/root" - DOCKER_API_VERSION: "{{ selenoid_docker_api_version }}" command: > selenoid start --config-dir {{ selenoid_config_dir }} --version {{ selenoid_version }} --tmpfs {{ selenoid_tmpfs }} - --env DOCKER_API_VERSION={{ selenoid_docker_api_version }} --browsers {% for browser in selenoid_browsers -%}{{ browser }}{%- if not loop.last -%},{%- endif -%}{%- endfor %} --last-versions {{ selenoid_browsers_last_versions }} --force - --args "-limit {{ selenoid_limit }} -listen :{{ selenoid_listen_port }} -conf {{ selenoid_config_dir }}/browsers.json" + --vnc + --args "-limit {{ selenoid_limit }} -listen :{{ selenoid_listen_port }} -video-output-dir={{ selenoid_video_container_output_dir }} -conf {{ selenoid_config_dir }}/browsers.json"