--- - hosts: slurm, cobald vars: container_privileged: True slurm_num_nodes: 10 tasks: - name: "setup docker" import_role: name=docker tags: docker - name: "get facts from existing cobald instance (i.e. hostname)" include_role: name: cobald tasks_from: facts apply: tags: slurm, cobald, slurm-config tags: slurm, cobald, slurm-config vars: container_name: cobald - name: "setup slurm test environment in docker containers" include_role: name: slurm apply: tags: slurm vars: slurm_user: slurm # or root slurm_user_accounts: - name: cobald dir: /var/lib/cobald num_nodes: "{{slurm_num_nodes}}" extra_nodes: - name: cobald hostname: "{{cobald_container_hostname}}" # from cobald/facts.yml above # hostname is used as NodeHostname, which is used slurms "networking # code" (https://bugs.schedmd.com/show_bug.cgi?id=8615). # It works either way around, but one of NodeName or NodeHostname has # to match the container name (-n flag, not --hostname) since when # submitting tasks to the slurm controller, it matches access # permissions against a reverse lookup of the submitting ip address. # Docker always and unconfigureably resolves the container ip in any # network to containername.netname, where containername is the # containers runtime name (not hostname supplied!) and netname is # the network name in host environment. We should run our own dns... docker_network: slurm when: '"slurm" in group_names' tags: slurm, cobald, influxdb, slurm-config # tags: cobald requires some slurm facts, so cobald tag is included here - name: "install cobald" include_role: name: cobald apply: tags: cobald vars: cobald_slurm: True container_name: cobald # docker_network: slurm # overriden by vars/slurm.yml when: '"cobald" in group_names' tags: cobald, influxdb