Skip to content
Snippets Groups Projects
Commit c86b9114 authored by Chris Hines's avatar Chris Hines
Browse files

Merge pull request #72 from CVL-GitHub/m2cvlbranch

fix slurm cpus
parents 5f5e7b43 61e2e6bd
No related branches found
No related tags found
No related merge requests found
--- ---
extraFiles: extraFiles:
- {src: '/usr/local/etc/sshfs_default_sites.cfg', dest: '/etc/sshfs_default_sites.cfg', type: 'link'}
- {src: '/usr/local/etc/vnc/turbovncserver-auth.conf', dest: '/etc/turbovncserver-auth.conf', type: 'link'} - {src: '/usr/local/etc/vnc/turbovncserver-auth.conf', dest: '/etc/turbovncserver-auth.conf', type: 'link'}
- {src: '/usr/local/etc/vnc/turbovncserver.conf', dest: '/etc/turbovncserver.conf', type: 'link'} - {src: '/usr/local/etc/vnc/turbovncserver.conf', dest: '/etc/turbovncserver.conf', type: 'link'}
- {src: '/usr/local/etc/profile.d/modules.sh', dest: '/etc/profile.d/modules.sh', type: 'link'} - {src: '/usr/local/etc/profile.d/modules.sh', dest: '/etc/profile.d/modules.sh', type: 'link'}
......
- name: "Templating /etc/ssh/known_hosts" - name: "Templating /etc/ssh/known_hosts"
template: src=known_hosts.j2 dest=/etc/ssh/known_hosts owner=root group=root mode=600 template: src=known_hosts.j2 dest=/etc/ssh/known_hosts owner=root group=root mode=600
delegate_to: "{{ slurmlogin }}"
run_once: true
sudo: true sudo: true
register: sshknowhost register: sshknowhost
- name: ecrypt the hosts file - name: ecrypt the hosts file
shell: ssh-keygen -H -f /etc/ssh/known_hosts shell: ssh-keygen -H -f /etc/ssh/known_hosts
sudo: true sudo: true
run_once: true
when: sshknowhost.changed when: sshknowhost.changed
{% set nodelist = [] %} {% set nodelist = [] %}
{% for desktop in desktopNodeList %} {% for node in groups['all'] %}
{% for node in groups[desktop.name] %} {% for interface in hostvars[node]['ansible_interfaces'] %}
{% if hostvars[node]['ansible_'+desktop.interface] is defined %} {% if interface != "lo" %}
{% set host = {'name': node, 'ip': hostvars[node]['ansible_'+desktop.interface]['ipv4']['address'], 'rsa': hostvars[node]['ansible_ssh_host_key_rsa_public']} %} {% set host = {'name': node, 'ip': hostvars[node]['ansible_'+interface]['ipv4']['address'], 'rsa': hostvars[node]['ansible_ssh_host_key_rsa_public']} %}
{% if nodelist.append(host) %} {% if nodelist.append(host) %}
{% endif %} {% endif %}
{% endif %} {% endif %}
...@@ -10,5 +10,6 @@ ...@@ -10,5 +10,6 @@
{% endfor %} {% endfor %}
{% for host in nodelist|unique %} {% for host in nodelist|unique %}
{{ host.ip }} {{ host.name }} {{ host.rsa }} {{ host.ip }} ssh-rsa {{ host.rsa }}
{{ host.name }} ssh-rsa {{ host.rsa }}
{% endfor %} {% endfor %}
{% set nodelist = [] %}
{% for desktop in desktopNodeList %}
{% for node in groups[desktop.name] %}
{% if hostvars[node]['ansible_'+desktop.interface] is defined %}
{% if not ssh-keygen -F hostvars[node] -f /etc/ssh/known_hosts and not ssh-keygen -F hostvars[node]['ansible_'+desktop.interface] -f /etc/ssh/known_hosts %}
{% set host = {name: node, ip: hostvars[node]['ansible_'+desktop.interface]} %}
{% if nodelist.append(host) %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% for host in nodelist|unique %}
ssh-keyscan -t rsa {{ host.name }} >> /etc/ssh/known_hosts
ssh-keyscan -t rsa {{ host.ip }} >> /etc/ssh/known_hosts
{% endfor %}
{% set nodelist = [] %}
{% for desktop in desktopNodeList %}
{% for node in groups[desktop.name] %}
{% if hostvars[node]['ansible_'+desktop.interface] is defined %}
{% if not ssh-keygen -F node -f /etc/ssh/known_hosts and not ssh-keygen -F hostvars[node]['ansible_'+desktop.interface]['ipv4']['address'] -f /etc/ssh/known_hosts %}
{% set host = {name: node, ip: hostvars[node]['ansible_'+desktop.interface]['ipv4']['address']} %}
{% if nodelist.append(host) %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% for host in nodelist|unique %}
echo "{{ host.name }} {{ host.ip }}"
#ssh-keyscan -t rsa {{ host.name }} >> /etc/ssh/known_hosts
#ssh-keyscan -t rsa {{ host.ip }} >> /etc/ssh/known_hosts
{% endfor %}
{% set nodelist = [] %}
{% for desktop in desktopNodeList %}
{% for node in groups[desktop.name] %}
{% if hostvars[node]['ansible_'+desktop.interface] is defined %}
{% set host = {'name': node, 'ip': hostvars[node]['ansible_'+desktop.interface]['ipv4']['address']} %}
{% if nodelist.append(host) %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% for host in nodelist|unique %}
echo "{{ host.name }} {{ host.ip }}"
#ssh-keyscan -t rsa {{ host.name }} >> /etc/ssh/known_hosts
#ssh-keyscan -t rsa {{ host.ip }} >> /etc/ssh/known_hosts
{% endfor %}
...@@ -128,7 +128,7 @@ MpiParams=ports=12000-12999 ...@@ -128,7 +128,7 @@ MpiParams=ports=12000-12999
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% for node in nodelist|unique %} {% for node in nodelist|unique %}
NodeName={{ node }} Procs={{ hostvars[node]['ansible_processor_vcpus'] }} State=UNKNOWN NodeName={{ node }} Procs={{ hostvars[node]['ansible_processor_vcpus'] }}
{% endfor %} {% endfor %}
{% for queue in slurmqueues %} {% for queue in slurmqueues %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment