Skip to content

Commit

Permalink
custom tasks to Install dependencies for the ansible mysql modules
Browse files Browse the repository at this point in the history
  • Loading branch information
pescobar committed Jun 28, 2021
1 parent 4004386 commit 26bea4b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
6 changes: 2 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
22 changes: 22 additions & 0 deletions tasks/slurm-accounting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit 26bea4b

Please sign in to comment.