From a473e06e57d0c1b3095730b294308bdb3a4a25e1 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Mon, 9 Jan 2023 15:39:18 +0100 Subject: [PATCH] Enhance installation of mysql_client Initially I wanted to install mysql-client-5.7 to test mysql server 5.7 but this package is not available for Ubuntu 18+. I keep those changes because it allow us to specify the name of the package based on the Ubuntu version. --- .../targets/setup_controller/tasks/client.yml | 11 +++++++++++ .../targets/setup_controller/tasks/install.yml | 1 - .../targets/setup_controller/tasks/main.yml | 7 ++++++- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tests/integration/targets/setup_controller/tasks/client.yml diff --git a/tests/integration/targets/setup_controller/tasks/client.yml b/tests/integration/targets/setup_controller/tasks/client.yml new file mode 100644 index 0000000..5255040 --- /dev/null +++ b/tests/integration/targets/setup_controller/tasks/client.yml @@ -0,0 +1,11 @@ +--- + +# Is some tests, we use the local mysql client with the shell module. + +- name: "{{ role_name }} | client | Install mysql client" + ansible.builtin.apt: + name: + - "{{ db_engine ~ '-client' }}" + state: present + environment: + DEBIAN_FRONTEND: noninteractive diff --git a/tests/integration/targets/setup_controller/tasks/install.yml b/tests/integration/targets/setup_controller/tasks/install.yml index 6064404..59c1d37 100644 --- a/tests/integration/targets/setup_controller/tasks/install.yml +++ b/tests/integration/targets/setup_controller/tasks/install.yml @@ -3,7 +3,6 @@ - name: "{{ role_name }} | install | Required package for testing" ansible.builtin.apt: name: - - mysql-client - iproute2 - python3-cryptography # To authenticate with MySQL 8+ state: present diff --git a/tests/integration/targets/setup_controller/tasks/main.yml b/tests/integration/targets/setup_controller/tasks/main.yml index b3a4dcb..82f8537 100644 --- a/tests/integration/targets/setup_controller/tasks/main.yml +++ b/tests/integration/targets/setup_controller/tasks/main.yml @@ -8,10 +8,15 @@ ansible.builtin.import_tasks: file: install.yml +# setvars.yml requires the iproute2 package installed by install.yml - name: Set variables ansible.builtin.import_tasks: file: setvars.yml -- name: Install MySQL connector +- name: Install MySQL local client + ansible.builtin.import_tasks: + file: client.yml + +- name: Install MySQL Python connector ansible.builtin.import_tasks: file: connector.yml