Newer
Older
# RedHat related OSs
- name: Yum install torque-mom
action: yum pkg=torque-mom,nfs-utils state=installed
when: "ansible_os_family == 'RedHat'"
# Debian related OSs
- name: Apt install torque-mom
action: apt pkg=torque-mom,nfs-common state=installed update_cache=yes cache_valid_time=86400
when: "ansible_os_family == 'Debian'"
- template: src=mom.layout dest={{torque_path}}/mom_priv/
- copy: content={{torque_server}} dest=/etc/torque/server_name
notify:
- restart {{mom_service}}
- lineinfile: dest="{{torque_path}}/mom_priv/config" regexp=\$clienthost line='$clienthost {{torque_server}}' create=yes
notify:
- restart {{mom_service}}
- lineinfile: dest="{{torque_path}}/mom_priv/config" regexp=\$pbsserver line='$pbsserver {{torque_server}}'
notify:
- restart {{mom_service}}
- lineinfile: dest="{{torque_path}}/mom_priv/config" regexp=/home line='$usecp *:/home /home'
notify:
- restart {{mom_service}}
- name: Wait for munge to be installed on the server
local_action: wait_for path=/usr/sbin/create-munge-key
when: "ansible_os_family == 'RedHat'"
- name: Create munge key on the server
local_action: command /usr/sbin/create-munge-key creates=/etc/munge/munge.key
when: "ansible_os_family == 'RedHat'"
- copy: src=/etc/munge/munge.key dest=/etc/munge/munge.key owner=munge group=munge mode=0400
when: "ansible_os_family == 'RedHat'"
notify:
- restart munge
- name: start {{mom_service}}
service: name={{mom_service}} state=started pattern=/usr/sbin/pbs_mom