From 99114a14ed8d95e25a8d7105a30ad3b5d1ae3c9d Mon Sep 17 00:00:00 2001 From: HACKERMD Date: Tue, 4 Jul 2017 00:53:48 +0200 Subject: [PATCH] Ensure value of ``tm_compute_nodes`` has integer type --- tmdeploy/share/playbooks/tissuemaps/postconfig.yml | 2 +- .../tissuemaps/roles/app-server/templates/gc3pie.conf.j2 | 4 ++-- tmdeploy/share/playbooks/tissuemaps/server.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tmdeploy/share/playbooks/tissuemaps/postconfig.yml b/tmdeploy/share/playbooks/tissuemaps/postconfig.yml index 679f294..7e9c332 100644 --- a/tmdeploy/share/playbooks/tissuemaps/postconfig.yml +++ b/tmdeploy/share/playbooks/tissuemaps/postconfig.yml @@ -20,7 +20,7 @@ vars: db_host_master: "{{ hostvars[groups['tissuemaps_db_master'][0]].ansible_host }}" db_hosts_workers: "{{ groups['tissuemaps_db_worker']|map('extract', hostvars, ['ansible_host'])|list }}" - db_nodes: "{{ groups['tissuemaps_db_worker']|length }}" + db_nodes: "{{ groups['tissuemaps_db_worker']|length|int }}" roles: - database-client diff --git a/tmdeploy/share/playbooks/tissuemaps/roles/app-server/templates/gc3pie.conf.j2 b/tmdeploy/share/playbooks/tissuemaps/roles/app-server/templates/gc3pie.conf.j2 index 55cc04f..936d032 100644 --- a/tmdeploy/share/playbooks/tissuemaps/roles/app-server/templates/gc3pie.conf.j2 +++ b/tmdeploy/share/playbooks/tissuemaps/roles/app-server/templates/gc3pie.conf.j2 @@ -21,8 +21,8 @@ frontend={{ ansible_hostname }} transport=local auth=noauth architecture=x86_64 -max_cores={{ tm_compute_cores * tm_compute_nodes }} +max_cores={{ tm_compute_cores|int * tm_compute_nodes|int }} max_cores_per_job={{ tm_compute_cores }} -max_memory_per_core={{ (tm_compute_memory / tm_compute_cores)|round(0, 'floor')|int }} MB +max_memory_per_core={{ (tm_compute_memory|int / tm_compute_cores|int)|round(0, 'floor')|int }} MB max_walltime=10 days diff --git a/tmdeploy/share/playbooks/tissuemaps/server.yml b/tmdeploy/share/playbooks/tissuemaps/server.yml index 4a0ce66..e91b6c1 100644 --- a/tmdeploy/share/playbooks/tissuemaps/server.yml +++ b/tmdeploy/share/playbooks/tissuemaps/server.yml @@ -20,7 +20,7 @@ vars: app_host: unix # 127.0.0.1 app_port: /var/run/uwsgi/tissuemaps.sock # 5002 - tm_compute_nodes: "{{ groups['tissuemaps_compute']|length if 'tissuemaps_compute' in groups else 1 }}" + tm_compute_nodes: "{{ groups['tissuemaps_compute']|length|int if 'tissuemaps_compute' in groups else 1 }}" roles: - web-server - app-server