Skip to content

Commit 26cd4e3

Browse files
author
Bharat Kunwar
authored
Merge pull request #4 from stackhpc/brtknr-patch-1
Add ansible lint
2 parents cfa2d26 + 6fc6e3c commit 26cd4e3

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ addons:
1313

1414
install:
1515
# Install ansible
16-
- pip install ansible
16+
- pip install ansible ansible-lint
1717

1818
# Check ansible version
1919
- ansible --version
@@ -27,6 +27,11 @@ install:
2727
script:
2828
# Basic role syntax check
2929
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
30+
31+
# Run Ansible lint against the role
32+
- ansible-lint tasks/main.yml
33+
34+
# Test the custom filters
3035
- ansible-playbook tests/filter.yml -i tests/inventory -i tests/inventory-mock-groups
3136

3237
notifications:

tasks/runtime.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- name: Fail if slurm_control_host or slurm_cluster_name or slurm_partitions are undefined
33
fail:
44
msg: "Undefined slurm_control_host or slurm_cluster_name or slurm_partitions."
5-
when:
5+
when:
66
slurm_control_host == none or
77
slurm_cluster_name == none or
88
slurm_partitions | length == 0
@@ -40,7 +40,7 @@
4040
- name: Retrieve Munge key from Slurm control host
4141
slurp:
4242
src: "/etc/munge/munge.key"
43-
register: slurm_munge_key
43+
register: slurm_munge_key
4444
when: inventory_hostname == slurm_control_host
4545

4646
- name: Write Munge key
@@ -67,7 +67,7 @@
6767
owner: root
6868
group: root
6969
mode: 0644
70-
notify:
70+
notify:
7171
- Restart SLURM service
7272

7373
- name: Flush handlers
@@ -77,12 +77,12 @@
7777
# the handler, ensure it's running here.
7878
- name: Ensure SLURM services are running
7979
service:
80-
name: "{{slurm_service}}"
81-
state: "{{'started' if slurm_service_enabled|bool else 'stopped'}}"
80+
name: "{{ slurm_service }}"
81+
state: "{{ 'started' if slurm_service_enabled | bool else 'stopped' }}"
8282

8383
# Install OpenHPC runtime
8484
- name: Ensure selected OpenHPC packages are installed
8585
yum:
86-
name: "{{openhpc_packages}}"
86+
name: "{{ openhpc_packages }}"
8787
state: present
8888
...

0 commit comments

Comments
 (0)