From 86188a20aae7a80d769444843565e81d47f43b2c Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Mon, 5 Dec 2022 18:54:55 +0100 Subject: [PATCH] Draft: Add a mariadb container --- Makefile | 4 + .../targets/setup_mysql/tasks/install.yml | 106 +++++++++--------- .../targets/setup_mysql/tasks/main.yml | 8 +- .../test_mysql_user/tasks/issue-121.yml | 2 +- 4 files changed, 62 insertions(+), 58 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..26a78ce --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.PHONY: test-integration-ansible-2-11-python-3-8-mariadb-10-5 +test-integration-ansible-2-11-python-3-8-mariadb-10-5: + podman run --detach --name mariadb105 --env MARIADB_ROOT_PASSWORD=msandbox --publish 3307:3306 mariadb:10.5 + ansible-test integration --docker --python 3.8 test_mysql_user diff --git a/tests/integration/targets/setup_mysql/tasks/install.yml b/tests/integration/targets/setup_mysql/tasks/install.yml index b64af25..0d0460b 100644 --- a/tests/integration/targets/setup_mysql/tasks/install.yml +++ b/tests/integration/targets/setup_mysql/tasks/install.yml @@ -1,36 +1,36 @@ --- -- name: "{{ role_name }} | install | add apt signing key for percona" - apt_key: - keyserver: keyserver.ubuntu.com - id: 4D1BB29D63D98E422B2113B19334A25F8507EFA5 - state: present - when: install_type == 'mysql' +# - name: "{{ role_name }} | install | add apt signing key for percona" +# apt_key: +# keyserver: keyserver.ubuntu.com +# id: 4D1BB29D63D98E422B2113B19334A25F8507EFA5 +# state: present +# when: install_type == 'mysql' -- name: "{{ role_name }} | install | add percona repositories" - apt_repository: - repo: deb http://repo.percona.com/percona/apt {{ ansible_lsb.codename }} main - state: present - when: install_type == 'mysql' +# - name: "{{ role_name }} | install | add percona repositories" +# apt_repository: +# repo: deb http://repo.percona.com/percona/apt {{ ansible_lsb.codename }} main +# state: present +# when: install_type == 'mysql' -- name: "{{ role_name }} | install | add apt signing key for mariadb" - apt_key: - keyserver: keyserver.ubuntu.com - id: F1656F24C74CD1D8 - state: present - when: install_type == 'mariadb' +# - name: "{{ role_name }} | install | add apt signing key for mariadb" +# apt_key: +# keyserver: keyserver.ubuntu.com +# id: F1656F24C74CD1D8 +# state: present +# when: install_type == 'mariadb' -- name: "{{ role_name }} | install | add mariadb repositories" - apt_repository: - repo: "deb [arch=amd64,arm64] https://downloads.mariadb.com/MariaDB/mariadb-{{ mysql_major_version }}/repo/ubuntu {{ ansible_lsb.codename }} main" - state: present - when: install_type == 'mariadb' +# - name: "{{ role_name }} | install | add mariadb repositories" +# apt_repository: +# repo: "deb [arch=amd64,arm64] https://downloads.mariadb.com/MariaDB/mariadb-{{ mysql_major_version }}/repo/ubuntu {{ ansible_lsb.codename }} main" +# state: present +# when: install_type == 'mariadb' -- name: "{{ role_name }} | install | install packages required by percona" - apt: - name: "{{ percona_mysql_packages }}" - state: present - environment: - DEBIAN_FRONTEND: noninteractive +# - name: "{{ role_name }} | install | install packages required by percona" +# apt: +# name: "{{ percona_mysql_packages }}" +# state: present +# environment: +# DEBIAN_FRONTEND: noninteractive - name: "{{ role_name }} | install | install packages required by mysql connector" apt: @@ -60,31 +60,31 @@ debug: msg: '{{ connector_ver }}' -- name: "{{ role_name }} | install | install packages required by mysql" - apt: - name: "{{ install_prereqs }}" - state: present - environment: - DEBIAN_FRONTEND: noninteractive +# - name: "{{ role_name }} | install | install packages required by mysql" +# apt: +# name: "{{ install_prereqs }}" +# state: present +# environment: +# DEBIAN_FRONTEND: noninteractive -- name: "{{ role_name }} | install | download and unpack dbdeployer" - unarchive: - remote_src: true - src: "{{ dbdeployer_src }}" - dest: "{{ dbdeployer_install_dir }}" - creates: "{{ dbdeployer_installed_file }}" - register: dbdeployer_tarball_install - notify: - - create zookeeper installed file - until: dbdeployer_tarball_install is not failed - retries: 6 - delay: 5 +# - name: "{{ role_name }} | install | download and unpack dbdeployer" +# unarchive: +# remote_src: true +# src: "{{ dbdeployer_src }}" +# dest: "{{ dbdeployer_install_dir }}" +# creates: "{{ dbdeployer_installed_file }}" +# register: dbdeployer_tarball_install +# notify: +# - create zookeeper installed file +# until: dbdeployer_tarball_install is not failed +# retries: 6 +# delay: 5 -- name: "{{ role_name }} | install | create symlink" - file: - src: "{{ dbdeployer_install_dir }}/dbdeployer-{{ dbdeployer_version }}.linux" - dest: /usr/local/bin/dbdeployer - follow: false - state: link +# - name: "{{ role_name }} | install | create symlink" +# file: +# src: "{{ dbdeployer_install_dir }}/dbdeployer-{{ dbdeployer_version }}.linux" +# dest: /usr/local/bin/dbdeployer +# follow: false +# state: link -- meta: flush_handlers +# - meta: flush_handlers diff --git a/tests/integration/targets/setup_mysql/tasks/main.yml b/tests/integration/targets/setup_mysql/tasks/main.yml index c6a8348..8b5845e 100644 --- a/tests/integration/targets/setup_mysql/tasks/main.yml +++ b/tests/integration/targets/setup_mysql/tasks/main.yml @@ -4,8 +4,8 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### -- import_tasks: setvars.yml -- import_tasks: dir.yml +# - import_tasks: setvars.yml +# - import_tasks: dir.yml - import_tasks: install.yml -- import_tasks: config.yml -- import_tasks: verify.yml +# - import_tasks: config.yml +# - import_tasks: verify.yml diff --git a/tests/integration/targets/test_mysql_user/tasks/issue-121.yml b/tests/integration/targets/test_mysql_user/tasks/issue-121.yml index 7d789ef..182a1f3 100644 --- a/tests/integration/targets/test_mysql_user/tasks/issue-121.yml +++ b/tests/integration/targets/test_mysql_user/tasks/issue-121.yml @@ -3,7 +3,7 @@ mysql_parameters: &mysql_params login_user: '{{ mysql_user }}' login_password: '{{ mysql_password }}' - login_host: 127.0.0.1 + login_host: 192.168.1.108 login_port: '{{ mysql_primary_port }}' block: