diff --git a/.github/workflows/ansible-test-plugins.yml b/.github/workflows/ansible-test-plugins.yml index 86573b7..00e1f62 100644 --- a/.github/workflows/ansible-test-plugins.yml +++ b/.github/workflows/ansible-test-plugins.yml @@ -105,8 +105,6 @@ jobs: MYSQL_ROOT_PASSWORD: msandbox ports: - 3308:3306 - volumes: - - ${{ github.workspace }}/tests/integration/setup_mysql/replica1/:/etc/mysql/conf.d/ options: >- --health-cmd "mysqladmin ping -P 3306 -pmsandbox |grep alive || exit 1" --health-start-period 10s @@ -121,8 +119,6 @@ jobs: MYSQL_ROOT_PASSWORD: msandbox ports: - 3309:3306 - volumes: - - ${{ github.workspace }}/tests/integration/setup_mysql/replica2/:/etc/mysql/conf.d/ options: >- --health-cmd "mysqladmin ping -P 3306 -pmsandbox |grep alive || exit 1" --health-start-period 10s diff --git a/Makefile b/Makefile index d410442..370fece 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,6 @@ test-integration: --network podman \ --publish 3308:3306 \ --health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \ - --security-opt label=disable \ - --volume ./tests/integration/targets/setup_mysql/replica1/:/etc/mysql/conf.d/ \ mysql:8.0.22 podman run \ --detach \ @@ -30,8 +28,6 @@ test-integration: --network podman \ --publish 3309:3306 \ --health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \ - --security-opt label=disable \ - --volume ./tests/integration/targets/setup_mysql/replica2/:/etc/mysql/conf.d/ \ mysql:8.0.22 while ! podman healthcheck run primary && [[ "$$SECONDS" -lt 120 ]]; do sleep 1; done -set -x; ansible-test integration -v --color --coverage --retry-on-error --continue-on-error --diff --docker --docker-network podman --python 3.8; set +x diff --git a/tests/integration/targets/setup_mysql/replica1/mysql.cnf b/tests/integration/targets/setup_mysql/replica1/mysql.cnf deleted file mode 100644 index 8cb676b..0000000 --- a/tests/integration/targets/setup_mysql/replica1/mysql.cnf +++ /dev/null @@ -1,4 +0,0 @@ -[mysqld] -skip-host-cache -skip-name-resolve -server_id = 2 diff --git a/tests/integration/targets/setup_mysql/replica2/mysql.cnf b/tests/integration/targets/setup_mysql/replica2/mysql.cnf deleted file mode 100644 index c705476..0000000 --- a/tests/integration/targets/setup_mysql/replica2/mysql.cnf +++ /dev/null @@ -1,4 +0,0 @@ -[mysqld] -skip-host-cache -skip-name-resolve -server_id = 3 diff --git a/tests/integration/targets/test_mysql_replication/tasks/mysql_replication_initial.yml b/tests/integration/targets/test_mysql_replication/tasks/mysql_replication_initial.yml index 84da6d7..42d0a7e 100644 --- a/tests/integration/targets/test_mysql_replication/tasks/mysql_replication_initial.yml +++ b/tests/integration/targets/test_mysql_replication/tasks/mysql_replication_initial.yml @@ -26,13 +26,28 @@ - db_engine == 'mysql' - db_version is version('8.0.22', '>=') + # We can't pass --server-id to service containers in GHA + - name: Change replica1 server_id to 2 + mysql_variables: + <<: *mysql_params + login_port: '{{ mysql_replica1_port }}' + variable: server_id + value: 2 + + - name: Change replica2 server_id to 3 + mysql_variables: + <<: *mysql_params + login_port: '{{ mysql_replica2_port }}' + variable: server_id + value: 3 + # Preparation: - name: Create user for mysql replication - shell: "echo \"CREATE USER '{{ replication_user }}'@'{{ gateway_addr }}' IDENTIFIED WITH mysql_native_password BY '{{ replication_pass }}'; GRANT REPLICATION SLAVE ON *.* TO '{{ replication_user }}'@'{{ gateway_addr }}';\" | {{ mysql_command }}" + shell: "echo \"CREATE USER '{{ replication_user }}'@'{{ mysql_host }}' IDENTIFIED WITH mysql_native_password BY '{{ replication_pass }}'; GRANT REPLICATION SLAVE ON *.* TO '{{ replication_user }}'@'{{ mysql_host }}';\" | {{ mysql_command }}" when: db_engine == 'mysql' - name: Create user for mariadb replication - shell: "echo \"CREATE USER '{{ replication_user }}'@'{{ gateway_addr }}' IDENTIFIED BY '{{ replication_pass }}'; GRANT REPLICATION SLAVE ON *.* TO '{{ replication_user }}'@'{{ gateway_addr }}';\" | {{ mysql_command }}" + shell: "echo \"CREATE USER '{{ replication_user }}'@'{{ mysql_host }}' IDENTIFIED BY '{{ replication_pass }}'; GRANT REPLICATION SLAVE ON *.* TO '{{ replication_user }}'@'{{ mysql_host }}';\" | {{ mysql_command }}" when: db_engine == 'mariadb' - name: Create test database