community.mysql/tests/integration/targets/setup_mysql/tasks/install.yml
Laurent Indermühle 85a63511b6
Backport/stable 1/pr 452 (#464)
* Sync GHA workflow w/ the collection template (#452)

* Sync GHA workflow w/ the collection template

* Drop the trailing pre-cmd semicolon

* Recover missing `-e` flag of `sed`

* Use relative paths for version configs

* Unquote `env.connector_version_file`

* Use string formatting to fix the substitution problem

(cherry picked from commit 8107530744)
(cherry picked from commit 704a0cea6a)

* Backport mysql_version_parts variable assignation

(cherry picked from commit 79046a88cb)
(cherry picked from commit a59d95501e)

* Add changelog fragment

(cherry picked from commit 26ecd68801)

* Backport flags and variables to differentiate MariaDB from MySQL setup

(cherry picked from commit b4303511d5)

* Backport issue-28 check for tls support

(cherry picked from commit efde607d25)

* Backport tls_requirements simplified and deduplified tests

(cherry picked from commit ac5a339644)

Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2022-11-10 15:00:42 +01:00

90 lines
2.6 KiB
YAML

---
- 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 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 | 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:
name: "{{ install_python_prereqs }}"
state: present
environment:
DEBIAN_FRONTEND: noninteractive
- name: "{{ role_name }} | install | install python packages"
pip:
name: "{{ python_packages }}"
register: connector
- name: Extract connector.name.0 content
set_fact:
connector_name: "{{ connector.name.0 }}"
- name: Debug connector_name content
debug:
msg: '{{ connector_name }}'
- name: Extract connector version
set_fact:
connector_ver: "{{ connector_name.split('=')[2].strip() }}"
- name: Debug connector_ver var content
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 | 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
- meta: flush_handlers