mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
[PR #6396/c411e125 backport][stable-6] Setup docker (#6466)
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
(cherry picked from commit c411e12555)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
@@ -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 }}"
|
||||
|
||||
Reference in New Issue
Block a user