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 }}"