-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from jabl/separate_dbdhost
Allow running slurmdbd and mysql on different node.
- Loading branch information
Showing
4 changed files
with
98 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
- name: get munge key for distribution to nodes | ||
copy: src=files/munge.key | ||
dest=/etc/munge/munge.key | ||
owner=munge | ||
group=munge | ||
mode=0400 | ||
notify: | ||
- restart munge | ||
|
||
- name: start munge | ||
service: name=munge state=started enabled=yes | ||
|
||
- name: install slurmdbd specific packages for EL6 | ||
yum: "name={{item}} state=present" | ||
with_items: | ||
- "mysql" | ||
- "mysql-server" | ||
- "mysql-devel" | ||
- "MySQL-python" | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "6" | ||
|
||
- name: start and enable mysql | ||
service: name=mysqld state=started enabled=yes | ||
register: mysql_start | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "6" | ||
|
||
- name: install slurmdbd specific packages for EL7 | ||
yum: "name={{item}} state=present" | ||
register: install_slurm_packages | ||
with_items: | ||
- "mariadb" | ||
- "mariadb-server" | ||
- "mariadb-devel" | ||
- "MySQL-python" | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "7" | ||
|
||
- name: start and enable mariadb on EL7 | ||
service: name=mariadb state=started enabled=yes | ||
register: mariadb_start | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "7" | ||
|
||
- name: restart mariadb after install | ||
service: name=mariadb state=restarted | ||
when: install_slurm_packages.changed | ||
|
||
- name: cat /etc/my.cnf | ||
command: cat /etc/my.cnf | ||
register: slurm_mariadb_cnf | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "7" | ||
changed_when: False | ||
|
||
- name: print slurm_mariadb_cnf | ||
debug: "var=slurm_mariadb_cnf" | ||
tags: debug | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "7" | ||
changed_when: False | ||
|
||
- name: systemctl status mariadb | ||
command: systemctl status mariadb | ||
register: systemctl_slurm_status | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "7" | ||
changed_when: False | ||
|
||
- name: wait for mysql in port 3306 to start | ||
wait_for: port=3306 delay=10 timeout=60 | ||
|
||
- name: create slurm acct db | ||
mysql_db: name=slurm_acct_db state=present | ||
|
||
- name: check if slurm db user exists | ||
mysql_user: "name=slurm state=present" | ||
register: mysqlslurmuser | ||
ignore_errors: yes | ||
tags: debug | ||
|
||
- name: print mysqlslurmuser | ||
debug: "var=mysqlslurmuser" | ||
tags: debug | ||
changed_when: False | ||
|
||
- name: slurm_mysql_password variable must be set | ||
assert: | ||
that: "slurm_mysql_password is defined" | ||
|
||
- name: create slurm db user if it does not exist | ||
mysql_user: "name=slurm password={{ slurm_mysql_password }} priv=slurm_acct_db.*:ALL state=present" | ||
when: mysqlslurmuser|failed | ||
|
||
- name: slurmdbd.conf | ||
template: src=slurmdbd.conf.j2 dest=/etc/slurm/slurmdbd.conf owner=root mode=0640 backup=yes | ||
|
||
- name: restart and enable slurmdbd | ||
service: name=slurmdbd state=restarted enabled=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters