Skip to content

Commit 1788947

Browse files
author
Jerry Jones gajone3
committed
Fix unnecessary JINJA indentation in State files
1 parent c962c55 commit 1788947

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+434
-435
lines changed

docker/compose/build.sls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
66
7-
{%- if 'applications' in d.compose and d.compose.applications %}
8-
{%- for service in d.compose.applications|unique %}
9-
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
7+
{%- if 'applications' in d.compose and d.compose.applications %}
8+
{%- for service in d.compose.applications|unique %}
9+
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1010
1111
docker-compose-{{ service }}-build:
1212
module.run:
@@ -16,6 +16,6 @@ docker-compose-{{ service }}-build:
1616
- service_names: {{ d.compose[service]['service_names'] }}
1717
{%- endif %}
1818
19-
{% endif %}
20-
{%- endfor %}
21-
{%- endif %}
19+
{% endif %}
20+
{%- endfor %}
21+
{%- endif %}

docker/compose/clean.sls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
include:
99
- {{ sls_compose_software_clean }}
1010
11-
{%- for name, container in d.compose.ng.items() %}
11+
{%- for name, container in d.compose.ng.items() %}
1212
1313
docker-compose-ng-{{ container.container_name|d(name) }}-{{ loop.index }}-stopped:
1414
docker_container.stopped:
@@ -23,4 +23,4 @@ docker-compose-ng-{{ container.image }}-{{ loop.index }}-absent:
2323
- require_in:
2424
- sls: {{ sls_compose_software_clean }}
2525
26-
{% endfor %}
26+
{% endfor %}

docker/compose/get.sls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
66
7-
{%- if 'applications' in d.compose and d.compose.applications %}
8-
{%- for service in d.compose.applications|unique %}
9-
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
7+
{%- if 'applications' in d.compose and d.compose.applications %}
8+
{%- for service in d.compose.applications|unique %}
9+
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1010
1111
docker-compose-{{ service }}-get:
1212
module.run:
1313
- name: dockercompose.get
1414
- path: {{ d.compose[service]['path'] }}
1515
16-
{% endif %}
17-
{%- endfor %}
18-
{%- endif %}
16+
{% endif %}
17+
{%- endfor %}
18+
{%- endif %}

docker/compose/kill.sls

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
66
7-
{%- if 'applications' in d.compose and d.compose.applications %}
8-
{%- for service in d.compose.applications|unique %}
9-
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
7+
{%- if 'applications' in d.compose and d.compose.applications %}
8+
{%- for service in d.compose.applications|unique %}
9+
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1010
1111
docker-compose-{{ service }}-kill:
1212
module.run:
1313
- name: dockercompose.kill
1414
- path: {{ d.compose[service]['path'] }}
15-
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
15+
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
1616
- service_names: {{ d.compose[service]['service_names'] }}
17-
{%- endif %}
17+
{%- endif %}
1818
19-
{% endif %}
20-
{%- endfor %}
21-
{%- endif %}
19+
{% endif %}
20+
{%- endfor %}
21+
{%- endif %}

docker/compose/ng.sls

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ include:
99
- docker.compose.software
1010
- docker.networks
1111
12-
{%- for name, container in d.compose.ng.items() %}
13-
{%- set id = container.container_name|d(name) %}
14-
{%- set required_containers = [] %}
15-
{%- set required_networks = [] %}
12+
{%- for name, container in d.compose.ng.items() %}
13+
{%- set id = container.container_name|d(name) %}
14+
{%- set required_containers = [] %}
15+
{%- set required_networks = [] %}
1616
1717
docker-compose-ng-{{ id }}-present:
1818
docker_image.present:
1919
- force: {{ d.misc.force_present }}
20-
{%- if ':' in container.image %}
21-
{%- set image = container.image.split(':',1) %}
20+
{%- if ':' in container.image %}
21+
{%- set image = container.image.split(':',1) %}
2222
- name: {{ image[0] }}
2323
- tag: {{ image[1] }}
24-
{%- else %}
24+
{%- else %}
2525
- name: {{ container.image }}
26-
{%- endif %}
26+
{%- endif %}
2727
2828
docker-compose-ng-{{ id }}-running:
2929
docker_container.running:
@@ -34,107 +34,107 @@ docker-compose-ng-{{ id }}-running:
3434
- privileged: {{ container.privileged|default(False) }}
3535
- interactive: {{ container.stdin_open|default(False) }}
3636
- tty: {{ container.tty|default(False) }}
37-
{%- if 'command' in container %}
37+
{%- if 'command' in container %}
3838
- command: {{ container.command }}
39-
{%- endif %}
40-
{%- if 'working_dir' in container %}
39+
{%- endif %}
40+
{%- if 'working_dir' in container %}
4141
- working_dir: {{ container.working_dir }}
42-
{%- endif %}
43-
{%- if 'volume_driver' in container %}
42+
{%- endif %}
43+
{%- if 'volume_driver' in container %}
4444
- volume_driver: {{ container.volume_driver }}
45-
{%- endif %}
46-
{%- if 'userns_mode' in container %}
45+
{%- endif %}
46+
{%- if 'userns_mode' in container %}
4747
- userns_mode: {{ container.userns_mode }}
48-
{%- endif %}
49-
{%- if 'user' in container %}
48+
{%- endif %}
49+
{%- if 'user' in container %}
5050
- user: {{ container.user }}
51-
{%- endif %}
52-
{%- if 'environment' in container and container.environment is iterable %}
51+
{%- endif %}
52+
{%- if 'environment' in container and container.environment is iterable %}
5353
- environment:
54-
{%- for variable, value in container.environment.items() %}
54+
{%- for variable, value in container.environment.items() %}
5555
- {{ variable }}: {{ value }}
56-
{%- endfor %}
57-
{%- endif %}
58-
{%- if 'ports' in container and container.ports is iterable %}
56+
{%- endfor %}
57+
{%- endif %}
58+
{%- if 'ports' in container and container.ports is iterable %}
5959
- port_bindings:
60-
{%- for port_mapping in container.ports %}
61-
{%- if port_mapping is string %}
62-
{%- set mapping = port_mapping.split(':',2) %}
63-
{%- if mapping|length < 2 %}
60+
{%- for port_mapping in container.ports %}
61+
{%- if port_mapping is string %}
62+
{%- set mapping = port_mapping.split(':',2) %}
63+
{%- if mapping|length < 2 %}
6464
- "{{ mapping[0] }}"
65-
{%- elif mapping|length > 2 %}
65+
{%- elif mapping|length > 2 %}
6666
- "{{ mapping[0] }}:{{ mapping[1] }}:{{ mapping[-1] }}"
67-
{%- else %}
67+
{%- else %}
6868
- "{{ mapping[0] }}:{{ mapping[-1] }}"
69-
{%- endif %}
70-
{%- elif port_mapping is mapping %}
71-
- {{ port_mapping }}
7269
{%- endif %}
73-
{%- endfor %}
74-
{%- endif %}
75-
{%- if 'volumes' in container %}
70+
{%- elif port_mapping is mapping %}
71+
- {{ port_mapping }}
72+
{%- endif %}
73+
{%- endfor %}
74+
{%- endif %}
75+
{%- if 'volumes' in container %}
7676
- binds:
77-
{%- for bind in container.volumes %}
78-
{%- set mapping = bind.rsplit(':', 1) %}
79-
{%- if mapping|length > 1 %}
77+
{%- for bind in container.volumes %}
78+
{%- set mapping = bind.rsplit(':', 1) %}
79+
{%- if mapping|length > 1 %}
8080
- "{{ mapping[0] }}:{{ mapping[-1] }}"
81-
{%- else %}
81+
{%- else %}
8282
- "{{ mapping[0] }}"
83-
{%- endif %}
84-
{%- endfor %}
85-
{%- endif %}
86-
{%- if 'volumes_from' in container %}
83+
{%- endif %}
84+
{%- endfor %}
85+
{%- endif %}
86+
{%- if 'volumes_from' in container %}
8787
- volumes_from:
88-
{%- for volume in container.volumes_from %}
89-
{%- do required_containers.append(volume) %}
88+
{%- for volume in container.volumes_from %}
89+
{%- do required_containers.append(volume) %}
9090
- {{ volume }}
91-
{%- endfor %}
92-
{%- endif %}
93-
{%- if 'links' in container %}
91+
{%- endfor %}
92+
{%- endif %}
93+
{%- if 'links' in container %}
9494
- links:
95-
{%- for link in container.links %}
96-
{%- set name, alias = link.split(':',1) %}
97-
{%- do required_containers.append(name) %}
95+
{%- for link in container.links %}
96+
{%- set name, alias = link.split(':',1) %}
97+
{%- do required_containers.append(name) %}
9898
{{ name }}: {{ alias }}
99-
{%- endfor %}
100-
{%- endif %}
101-
{%- if 'networks' in container %}
99+
{%- endfor %}
100+
{%- endif %}
101+
{%- if 'networks' in container %}
102102
- networks:
103-
{%- for network in container.networks %}
104-
{%- do required_networks.append(network) %}
103+
{%- for network in container.networks %}
104+
{%- do required_networks.append(network) %}
105105
- {{ network }}
106-
{%- endfor %}
107-
{%- endif %}
108-
{%- if 'restart' in container %}
109-
{%- set policy = container.restart.split(':',1) %}
110-
{%- if policy|length < 2 %}
106+
{%- endfor %}
107+
{%- endif %}
108+
{%- if 'restart' in container %}
109+
{%- set policy = container.restart.split(':',1) %}
110+
{%- if policy|length < 2 %}
111111
- restart_policy: {{ policy[0] }}
112-
{%- else %}
112+
{%- else %}
113113
- restart_policy: {{ policy[0] }}:{{ policy[-1] }}
114-
{%- endif %}
115114
{%- endif %}
116-
{%- if 'devices' in container %}
115+
{%- endif %}
116+
{%- if 'devices' in container %}
117117
- devices:
118-
{%- for device in container.devices %}
119-
{%- set mapping = device.rsplit(':', 1) %}
120-
{%- if mapping|length > 1 %}
118+
{%- for device in container.devices %}
119+
{%- set mapping = device.rsplit(':', 1) %}
120+
{%- if mapping|length > 1 %}
121121
- "{{ mapping[0] }}:{{ mapping[-1] }}"
122-
{%- else %}
122+
{%- else %}
123123
- "{{ mapping[0] }}"
124-
{%- endif %}
125-
{%- endfor %}
126-
{%- endif %}
124+
{%- endif %}
125+
{%- endfor %}
126+
{%- endif %}
127127
- require:
128128
- docker_image: docker-compose-ng-{{ id }}-present
129-
{%- if required_containers is defined %}
130-
{%- for containerid in required_containers %}
129+
{%- if required_containers is defined %}
130+
{%- for containerid in required_containers %}
131131
- docker_image: docker-compose-ng-{{ id }}-present
132-
{%- endfor %}
133-
{%- endif %}
134-
{%- if required_networks is defined %}
135-
{%- for networkid in required_networks %}
132+
{%- endfor %}
133+
{%- endif %}
134+
{%- if required_networks is defined %}
135+
{%- for networkid in required_networks %}
136136
- docker_network: docker-network-{{ networkid }}-present
137-
{%- endfor %}
138-
{%- endif %}
137+
{%- endfor %}
138+
{%- endif %}
139139
140-
{% endfor %}
140+
{% endfor %}

docker/compose/pause.sls

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
66
7-
{%- if 'applications' in d.compose and d.compose.applications %}
8-
{%- for service in d.compose.applications|unique %}
9-
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
7+
{%- if 'applications' in d.compose and d.compose.applications %}
8+
{%- for service in d.compose.applications|unique %}
9+
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1010
1111
docker-compose-{{ service }}-pause:
1212
module.run:
1313
- name: dockercompose.pause
1414
- path: {{ d.compose[service]['path'] }}
15-
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
15+
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
1616
- service_names: {{ d.compose[service]['service_names'] }}
17-
{%- endif %}
17+
{%- endif %}
1818
19-
{% endif %}
20-
{%- endfor %}
21-
{%- endif %}
19+
{% endif %}
20+
{%- endfor %}
21+
{%- endif %}

docker/compose/ps.sls

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
66
7-
{%- if 'applications' in d.compose and d.compose.applications %}
8-
{%- for service in d.compose.applications|unique %}
9-
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
7+
{%- if 'applications' in d.compose and d.compose.applications %}
8+
{%- for service in d.compose.applications|unique %}
9+
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1010
1111
docker-compose-{{ service }}-ps:
1212
module.run:
1313
- name: dockercompose.ps
1414
- path: {{ d.compose[service]['path'] }}
1515
16-
{% endif %}
17-
{%- endfor %}
18-
{%- endif %}
16+
{% endif %}
17+
{%- endfor %}
18+
{%- endif %}

docker/compose/pull.sls

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
66
7-
{%- if 'applications' in d.compose and d.compose.applications %}
8-
{%- for service in d.compose.applications|unique %}
9-
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
7+
{%- if 'applications' in d.compose and d.compose.applications %}
8+
{%- for service in d.compose.applications|unique %}
9+
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1010
1111
docker-compose-{{ service }}-pull:
1212
module.run:
1313
- name: dockercompose.pull
1414
- path: {{ d.compose[service]['path'] }}
15-
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
15+
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
1616
- service_names: {{ d.compose[service]['service_names'] }}
17-
{%- endif %}
17+
{%- endif %}
1818
19-
{% endif %}
20-
{%- endfor %}
21-
{%- endif %}
19+
{% endif %}
20+
{%- endfor %}
21+
{%- endif %}

docker/compose/restart.sls

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
66
7-
{%- if 'applications' in d.compose and d.compose.applications %}
8-
{%- for service in d.compose.applications|unique %}
9-
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
7+
{%- if 'applications' in d.compose and d.compose.applications %}
8+
{%- for service in d.compose.applications|unique %}
9+
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1010
1111
docker-compose-{{ service }}-restart:
1212
module.run:
1313
- name: dockercompose.restart
1414
- path: {{ d.compose[service]['path'] }}
15-
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
15+
{%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %}
1616
- service_names: {{ d.compose[service]['service_names'] }}
17-
{%- endif %}
17+
{%- endif %}
1818
19-
{% endif %}
20-
{%- endfor %}
21-
{%- endif %}
19+
{% endif %}
20+
{%- endfor %}
21+
{%- endif %}

0 commit comments

Comments
 (0)