option for docker host access to cluster
This commit is contained in:
31
roles/slurm/tasks/host-config.yml
Normal file
31
roles/slurm/tasks/host-config.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
- name: "get addresses from docker network"
|
||||
docker_network_info:
|
||||
name: "{{ docker_network }}"
|
||||
register: slurm_network_data
|
||||
|
||||
- name: link host slurm config
|
||||
file:
|
||||
path: "/etc/slurm/slurm.conf"
|
||||
src: "/container/volumes/slurm/slurm.conf"
|
||||
force: True
|
||||
state: link
|
||||
backup: True
|
||||
|
||||
- name: create slurm user
|
||||
user:
|
||||
name: slurm
|
||||
system: True
|
||||
|
||||
- name: place entry of slurm-ctl in host /etc/hosts
|
||||
lineinfile:
|
||||
line: "{{slurm_network_data.network.Containers | dict2items
|
||||
| json_query('[?value.Name==`slurm-ctl`].value.IPv4Address') | first
|
||||
| ipaddr('address') }}\tslurm-ctl"
|
||||
regexp: "^(\\S*)(\\s*)slurm-ctl$"
|
||||
path: /etc/hosts
|
||||
backup: True
|
||||
|
||||
- name: start munge locally
|
||||
service:
|
||||
name: munge
|
||||
state: started
|
Reference in New Issue
Block a user