From 26bea4bb88f064ffcff7cb6226cc37b33c764172 Mon Sep 17 00:00:00 2001 From: Pablo Escobar Date: Mon, 28 Jun 2021 16:59:39 +0200 Subject: [PATCH] custom tasks to Install dependencies for the ansible mysql modules --- defaults/main.yml | 6 ++---- tasks/slurm-accounting.yml | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index ad68c05..ebc41e8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -54,13 +54,11 @@ slurm_packages_master: # slurm packages we install only in slurmdbd node slurm_packages_slurmdbd: RedHat: - - mariadb-server - - MySQL-python - slurm-slurmdbd - Debian: - mariadb-server - - python3-mysqldb + Debian: - slurmdbd + - mariadb-server # slurm packages we install only in worker nodes slurm_packages_worker: diff --git a/tasks/slurm-accounting.yml b/tasks/slurm-accounting.yml index c16594d..df4227c 100644 --- a/tasks/slurm-accounting.yml +++ b/tasks/slurm-accounting.yml @@ -20,6 +20,28 @@ state: started enabled: true +- name: Install dependencies for the ansible mysql modules | RedHat7 + ansible.builtin.yum: + name: MySQL-python + state: present + when: + - ansible_os_family == "RedHat" + - ansible_distribution_major_version == "7" + +- name: Install dependencies for the ansible mysql modules | RedHat8 + ansible.builtin.yum: + name: python3-mysql + state: present + when: + - ansible_os_family == "RedHat" + - ansible_distribution_major_version == "8" + +- name: Install dependencies for the ansible mysql modules | Debian/Ubuntu + ansible.builtin.apt: + name: python3-mysqldb + state: present + when: ansible_os_family == "Debian" + - name: Create mysql db for accounting community.mysql.mysql_db: name: "{{ slurm_slurmdbd_mysql_db_name }}"