From fc2910c52a14fab4078acc062acb26996c96d383 Mon Sep 17 00:00:00 2001 From: Mikhail Konyakhin Date: Wed, 26 Dec 2018 11:17:59 +0300 Subject: [PATCH 1/5] Add support Percona Client 8.0. --- vars/main.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/vars/main.yml b/vars/main.yml index e0efe9a..034ab46 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -4,8 +4,9 @@ percona_client_versions_supported: - '5.5' - '5.6' - '5.7' + - '8.0' -percona_client_repositories: +percona_client_repositories_5: - type: deb url: "http://repo.percona.com/apt {{ ansible_lsb.codename }}" component: main @@ -13,5 +14,18 @@ percona_client_repositories: url: "http://repo.percona.com/apt {{ ansible_lsb.codename }}" component: main +percona_client_repositories_8: + - type: deb + url: "http://repo.percona.com/ps-80/apt {{ ansible_lsb.codename }}" + component: main + - type: deb-src + url: "http://repo.percona.com/ps-80/apt {{ ansible_lsb.codename }}" + component: main + +percona_client_repositories: "{{ percona_client_repositories_8 if percona_client_version == 8.0 else percona_client_repositories_5 }}" + +percona_client_version_deb_prefix: "-{{ percona_client_version }}" +percona_client_version_deb: "{{ '' if percona_client_version == 8.0 else percona_client_version_deb_prefix }}" + percona_client_dependencies: - - "percona-server-client-{{ percona_client_version }}" + - "percona-server-client{{ percona_client_version_deb }}" From 55fa736dd53e20c92125a2be1a25ba80465d0f7b Mon Sep 17 00:00:00 2001 From: Mikhail Konyakhin Date: Fri, 11 Jan 2019 16:21:41 +0300 Subject: [PATCH 2/5] Add in condition version filter. --- vars/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vars/main.yml b/vars/main.yml index 034ab46..3bb05f9 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -22,10 +22,10 @@ percona_client_repositories_8: url: "http://repo.percona.com/ps-80/apt {{ ansible_lsb.codename }}" component: main -percona_client_repositories: "{{ percona_client_repositories_8 if percona_client_version == 8.0 else percona_client_repositories_5 }}" +percona_client_repositories: "{{ percona_client_repositories_8 if percona_client_version is version('8.0', '==') else percona_client_repositories_5 }}" percona_client_version_deb_prefix: "-{{ percona_client_version }}" -percona_client_version_deb: "{{ '' if percona_client_version == 8.0 else percona_client_version_deb_prefix }}" +percona_client_version_deb: "{{ '' if percona_client_version is version('8.0', '==') else percona_client_version_deb_prefix }}" percona_client_dependencies: - "percona-server-client{{ percona_client_version_deb }}" From 34db781a920ddefe4853e9073aca5b3b5ccab12a Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Tue, 21 Mar 2023 18:18:09 +0100 Subject: [PATCH 3/5] Cs fixes --- tasks/configure.yml | 4 ++-- tasks/install.yml | 4 ++-- tasks/main.yml | 8 ++++---- tasks/repository.yml | 8 ++++---- tasks/version-support.yml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 5aea675..32dc1e8 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -1,7 +1,7 @@ # tasks file --- - name: configure | copy certificate files - copy: + ansible.builtin.copy: src: "{{ item.value.src }}" dest: "{{ item.value.dest }}" owner: "{{ item.value.owner | default('root') }}" @@ -12,7 +12,7 @@ - percona-client-configure-copy-certificate-files - name: configure | update (user) configuration file(s) - template: + ansible.builtin.template: src: root/.my.cnf.j2 dest: "{{ item.dest | default('~' + item.owner + '/.my.cnf') }}" owner: "{{ item.owner }}" diff --git a/tasks/install.yml b/tasks/install.yml index bf8b17d..3c643cc 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,14 +1,14 @@ # tasks file --- - name: install | dependencies - apt: + ansible.builtin.apt: name: "{{ percona_client_dependencies }}" state: "{{ apt_install_state | default('latest') }}" tags: - percona-client-install-dependencies - name: install | additional - apt: + ansible.builtin.apt: name: "{{ percona_client_install }}" state: "{{ apt_install_state | default('latest') }}" tags: diff --git a/tasks/main.yml b/tasks/main.yml index 5cfeb3a..3e63cf8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,24 +1,24 @@ # tasks file --- -- include: version-support.yml +- ansible.builtin.import_tasks: version-support.yml tags: - configuration - percona-client - percona-client-version-support -- include: repository.yml +- ansible.builtin.import_tasks: repository.yml tags: - configuration - percona-client - percona-client-repository -- include: install.yml +- ansible.builtin.import_tasks: install.yml tags: - configuration - percona-client - percona-client-install -- include: configure.yml +- ansible.builtin.import_tasks: configure.yml tags: - configuration - percona-client diff --git a/tasks/repository.yml b/tasks/repository.yml index 68eb0ab..e41fecd 100644 --- a/tasks/repository.yml +++ b/tasks/repository.yml @@ -1,7 +1,7 @@ # tasks file --- - name: repository | install | dependencies (pre) - apt: + ansible.builtin.apt: name: "{{ percona_client_dependencies_pre }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true @@ -11,7 +11,7 @@ - percona-client-repository-install-dependencies - name: repository | add public key - apt_key: + ansible.builtin.apt_key: id: 9334A25F8507EFA5 keyserver: keyserver.ubuntu.com state: present @@ -19,7 +19,7 @@ - percona-client-repository-public-key - name: repository | add - apt_repository: + ansible.builtin.apt_repository: repo: "{{ item.type }} {{ item.url }} {{ item.component }}" state: present update_cache: true @@ -28,7 +28,7 @@ - percona-client-repository-add - name: repository | apt-pin packages - copy: + ansible.builtin.copy: src: etc/apt/preferences.d/00percona.pref dest: /etc/apt/preferences.d/00percona.pref owner: root diff --git a/tasks/version-support.yml b/tasks/version-support.yml index 09e6436..207ed8e 100644 --- a/tasks/version-support.yml +++ b/tasks/version-support.yml @@ -1,7 +1,7 @@ # tasks file --- - name: version support | check - fail: + ansible.builtin.fail: msg: "Percona client version {{ percona_client_version }} is not supported" when: percona_client_version | string not in percona_client_versions_supported tags: From 2ab6c7fa8a85f5af27070de608dbbe439c9ae33a Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Tue, 21 Mar 2023 18:20:13 +0100 Subject: [PATCH 4/5] Cs fixes --- tasks/main.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 3e63cf8..cfebe4c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,24 +1,28 @@ # tasks file --- -- ansible.builtin.import_tasks: version-support.yml +- name: version support + ansible.builtin.import_tasks: version-support.yml tags: - configuration - percona-client - percona-client-version-support -- ansible.builtin.import_tasks: repository.yml +- name: repository + ansible.builtin.import_tasks: repository.yml tags: - configuration - percona-client - percona-client-repository -- ansible.builtin.import_tasks: install.yml +- name: install + ansible.builtin.import_tasks: install.yml tags: - configuration - percona-client - percona-client-install -- ansible.builtin.import_tasks: configure.yml +- name: configure + ansible.builtin.import_tasks: configure.yml tags: - configuration - percona-client From a40a4275993ddb25638785b740b64567fe25547e Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Tue, 21 Mar 2023 18:21:59 +0100 Subject: [PATCH 5/5] Add ignore --- .ansible-lint | 1 + .github/workflows/ci.yml | 7 +++---- molecule/default/molecule.yml | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 7e0172a..b04781e 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,4 +1,5 @@ --- warn_list: - role-name + - name[play] - name[casing] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 292e437..1f7278a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,9 @@ jobs: python-version: '3.x' - name: Install test dependencies - run: pip install ansible-lint[community,yamllint] + run: | + pip install ansible-lint + ansible-galaxy install -r requirements.yml - name: Lint code run: | @@ -43,11 +45,8 @@ jobs: matrix: include: - distro: debian8 - ansible-version: '<2.10' - distro: debian9 - distro: debian10 - - distro: ubuntu1604 - ansible-version: '>=2.9, <2.10' - distro: ubuntu1604 ansible-version: '>=2.10, <2.11' - distro: ubuntu1604 diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index fbb7120..8841165 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -8,7 +8,9 @@ platforms: image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + - /var/lib/containerd + cgroupns_mode: host privileged: true pre_build_image: true provisioner: