Refactor when: mariadb_use_official_repo in a block

This commit is contained in:
jo 2022-10-14 12:47:20 +02:00
parent f033b79f75
commit d09bc65a6d
1 changed files with 41 additions and 42 deletions

View File

@ -1,4 +1,7 @@
--- ---
- name: Install mariadb official repository
when: mariadb_use_official_repo
block:
- name: Install mariadb repo necessary packages - name: Install mariadb repo necessary packages
ansible.builtin.apt: ansible.builtin.apt:
package: package:
@ -6,7 +9,6 @@
- gnupg2 - gnupg2
state: present state: present
update_cache: true update_cache: true
when: mariadb_use_official_repo
- name: Install mariadb repository key - name: Install mariadb repository key
ansible.builtin.get_url: ansible.builtin.get_url:
@ -17,7 +19,6 @@
owner: root owner: root
group: root group: root
mode: "0644" mode: "0644"
when: mariadb_use_official_repo
- name: Determine distribution name (Debian sid pb) - name: Determine distribution name (Debian sid pb)
ansible.builtin.set_fact: ansible.builtin.set_fact:
@ -32,7 +33,6 @@
owner: root owner: root
group: root group: root
mode: "0644" mode: "0644"
when: mariadb_use_official_repo
- name: Prefer MariaDB repo over Debian repo - name: Prefer MariaDB repo over Debian repo
ansible.builtin.copy: ansible.builtin.copy:
@ -45,7 +45,6 @@
owner: root owner: root
group: root group: root
mode: "0644" mode: "0644"
when: mariadb_use_official_repo
- name: Install packages - name: Install packages
ansible.builtin.apt: ansible.builtin.apt: