Setup docker (#6396)

* setup-docker: install and run docker inside integration test VMs

* must pip install requests to satisfy community.docker requirements

* add Ubuntu configuration to setup_docker

* Update tests/integration/targets/mssql_script/tasks/main.yml

* Update tests/integration/targets/mssql_script/tasks/main.yml

* docker_pacakges variable non-existent by default

* add setup_docker to keycloak_groups

* add setup_docker to keycloak_groups

* removed unused file tasks/nothing.yml

* add README

* add copyright notice to readme file

* Update tests/integration/targets/setup_docker/README.md

* rolled back the boilerplate disclaimer to mssql_script tasks/main.yml
This commit is contained in:
Alexei Znamensky 2023-05-01 20:31:34 +12:00 committed by GitHub
commit c411e12555
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 313 additions and 8 deletions

View file

@ -7,3 +7,4 @@ skip/macos
skip/freebsd
skip/rhel
disabled
destructive

View file

@ -4,6 +4,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
mssql_host: localhost
mssql_port: 14330
mssql_port: 1433
mssql_login_user: sa
mssql_login_password: "yourStrong(!)Password"
mssql_login_password: "Abcd!234"

View file

@ -0,0 +1,7 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
dependencies:
- setup_docker

View file

@ -13,13 +13,33 @@
# docker run --name mssql-test -e "ACCEPT_EULA=Y" -e 'SA_PASSWORD={{ mssql_login_password }}' -p "{ mssql_port }"0:"{ mssql_port }" -d mcr.microsoft.com/mssql/server:2019-latest
# ansible-test integration mssql_script -v --allow-disabled
- name: Install pymssql
ansible.builtin.pip:
name:
- pymssql
state: present
- name: Start container
community.docker.docker_container:
name: mssql-test
image: "mcr.microsoft.com/mssql/server:2019-latest"
env:
ACCEPT_EULA: "Y"
SA_PASSWORD: "{{ mssql_login_password }}"
MSSQL_PID: Developer
ports:
- "{{ mssql_port }}:1433"
detach: true
auto_remove: true
memory: 2200M
- name: Check default ports
wait_for:
ansible.builtin.wait_for:
host: "{{ mssql_host }}"
port: "{{ mssql_port }}"
state: started # Port should be open
delay: 0 # No wait before first check (sec)
timeout: 3 # Stop checking after timeout (sec)
delay: 10 # Wait 10 secs before first check
timeout: 30 # Stop checking after timeout (sec)
- name: Check DB connection
community.general.mssql_script:
@ -41,7 +61,7 @@
GO
SELECT 'Batch 1 - Select 0'
register: result_batches
# "result_batches.query_results":
# "result_batches.query_results":
# [ # batches
# [ # selects
# [ # Rows
@ -115,8 +135,6 @@
- result_batches_dict.query_results_dict[0][0] | length == 1 # one row in first select
- result_batches_dict.query_results_dict[0][0][0]['b0s0'] == 'Batch 0 - Select 0' # column 'b0s0' of first row
- name: Stored procedure may return multiple result sets
community.general.mssql_script:
login_user: "{{ mssql_login_user }}"