Skip to content

Commit 11918ea

Browse files
committed
Merge branch 'master' of https://github.com/stackhpc/ansible-role-openhpc into ohpc-2
2 parents 4515f3f + 9a76c34 commit 11918ea

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

.travis.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
---
22
language: python
3-
python: "2.7"
43

54
# Use the new container infrastructure
6-
sudo: false
7-
8-
# Install ansible
9-
addons:
10-
apt:
11-
packages:
12-
- python-pip
13-
5+
sudo: required
6+
services:
7+
- docker
8+
before_install:
9+
- sudo apt-get -qq update
1410
install:
15-
# Install ansible
16-
- pip install ansible ansible-lint
17-
11+
- python3 -m pip install ansible
12+
- python3 -m pip install ansible-lint
13+
- python3 -m pip install molecule
14+
- python3 -m pip install docker
15+
1816
# Check ansible version
1917
- ansible --version
2018

@@ -34,5 +32,8 @@ script:
3432
# Test the custom filters
3533
- ansible-playbook tests/filter.yml -i tests/inventory -i tests/inventory-mock-groups
3634

35+
# Run molecule tests
36+
- molecule test
37+
3738
notifications:
3839
webhooks: https://galaxy.ansible.com/api/v1/notifications/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Role Variables
1818
Otherwise, `groups` can be omitted and the following attributes can be defined in the partition object:
1919
* `name`: The name of the nodes within this group.
2020
* `cluster_name`: Optional. An override for the top-level definition `openhpc_cluster_name`.
21-
* `ram_mb`: Optional. The physical RAM available in each server of this group ([slurm.conf](https://slurm.schedmd.com/slurm.conf.html) parameter `RealMemory`).
21+
* `ram_mb`: Optional. The physical RAM available in each server of this group ([slurm.conf](https://slurm.schedmd.com/slurm.conf.html) parameter `RealMemory`). This is set to the Slurm default of `1` if not defined.
2222

23-
For each group (if used) or partition there must be an ansible inventory group `<cluster_name>-<group_name>`. All nodes in this inventory group will be added to the group/partition. Nodes may have arbitrary hostnames but these should be lowercase to avoid a mismatch between inventory and actual hostname.
23+
For each group (if used) or partition there must be an ansible inventory group `<cluster_name>_<group_name>`. All nodes in this inventory group will be added to the group/partition. Nodes may have arbitrary hostnames but these should be lowercase to avoid a mismatch between inventory and actual hostname.
2424

2525
* `default`: Optional. A boolean flag for whether this partion is the default. Valid settings are `YES` and `NO`.
2626
* `maxtime`: Optional. A partition-specific time limit in hours, minutes and seconds ([slurm.conf](https://slurm.schedmd.com/slurm.conf.html) parameter `MaxTime`). The default value is

filter_plugins/group_hosts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _group_hosts(hosts):
4545
r.append(int(suffix))
4646
else:
4747
unmatchable.append(v)
48-
return ['{}[{}]'.format(k, _group_numbers(v)) for k, v in results.iteritems()] + unmatchable
48+
return ['{}[{}]'.format(k, _group_numbers(v)) for k, v in results.items()] + unmatchable
4949

5050
def _group_numbers(numbers):
5151
units = []

molecule/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ Molecule tests for the role.
22

33
# Test Matrix
44

5-
Test options "flow down" thro table unless changed.
5+
Test options "flow down" through table unless changed.
66

7-
test | # partitions | # groups in partitions? | other
7+
Test | # Partitions | Groups in partitions? | Other
88
--- | --- | --- | ---
99
test1 | 1 | N | 2x compute node, sequential names (default test)
1010
test1b | 1 | N | 1x compute node
1111
test1c | 1 | N | 2x compute nodes, nonsequential names
1212
test2 | 2 | N | 4x compute node, sequential names
13-
test3 | 1 | Y |
13+
test3 | 1 | Y | -
1414

1515
# Local Installation & Running
1616

templates/slurm.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Epilog=/etc/slurm/slurm.epilog.clean
108108
{# If using --limit, the first host in each group may not have facts available. Find one that does. #}
109109
{% set group_hosts = groups[group_name] | intersect(play_hosts) %}
110110

111-
NodeName=DEFAULT State=UNKNOWN {% if 'ram_mb' in group %} RealMemory={{group.ram_mb}}{% endif %}{% if group_hosts | length > 0 %}\
111+
NodeName=DEFAULT State=UNKNOWN RealMemory={% if 'ram_mb' in group %}{{group.ram_mb}}{% else %}1{% endif %}{% if group_hosts | length > 0 %}\
112112
{% set first_host_hv = hostvars[group_hosts | first] %}
113113
Sockets={{first_host_hv['ansible_processor_count']}} \
114114
CoresPerSocket={{first_host_hv['ansible_processor_cores']}} \

0 commit comments

Comments
 (0)