Skip to content

Commit a79f8d3

Browse files
refactor(jinja2): remove excessive jinja, not useful pattern (#303)
1 parent c070b81 commit a79f8d3

55 files changed

Lines changed: 127 additions & 182 deletions

Some content is hidden

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

docker/compose/build.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
12-
{{ formula }}-compose-{{ service }}-build:
11+
docker-compose-{{ service }}-build:
1312
module.run:
1413
- name: dockercompose.build
1514
- path: {{ d.compose[service]['path'] }}

docker/compose/get.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
12-
{{ formula }}-compose-{{ service }}-get:
11+
docker-compose-{{ service }}-get:
1312
module.run:
1413
- name: dockercompose.get
1514
- path: {{ d.compose[service]['path'] }}

docker/compose/kill.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
12-
{{ formula }}-compose-{{ service }}-kill:
11+
docker-compose-{{ service }}-kill:
1312
module.run:
1413
- name: dockercompose.kill
1514
- path: {{ d.compose[service]['path'] }}

docker/compose/ng.sls

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@
44

55
{%- set tplroot = tpldir.split('/')[0] %}
66
{%- from tplroot ~ "/map.jinja" import data as d with context %}
7-
{%- set formula = d.formula %}
87
98
include:
10-
- {{ formula }}.compose.software
11-
- {{ formula }}.networks
9+
- docker.compose.software
10+
- docker.networks
1211
1312
{%- for name, container in d.compose.ng.items() %}
1413
{%- set id = container.container_name|d(name) %}
1514
{%- set required_containers = [] %}
1615
{%- set required_networks = [] %}
1716
18-
{{ formula }}-compose-ng-{{ id }}-present:
17+
docker-compose-ng-{{ id }}-present:
1918
docker_image.present:
2019
- force: {{ d.misc.force_present }}
2120
{%- if ':' in container.image %}
@@ -26,7 +25,7 @@ include:
2625
- name: {{ container.image }}
2726
{%- endif %}
2827
29-
{{ formula }}-compose-ng-{{ id }}-running:
28+
docker-compose-ng-{{ id }}-running:
3029
docker_container.running:
3130
- name: {{ id }}
3231
- image: {{ container.image }}
@@ -126,15 +125,15 @@ include:
126125
{%- endfor %}
127126
{%- endif %}
128127
- require:
129-
- docker_image: {{ formula }}-compose-ng-{{ id }}-present
128+
- docker_image: docker-compose-ng-{{ id }}-present
130129
{%- if required_containers is defined %}
131130
{%- for containerid in required_containers %}
132-
- docker_image: {{ formula }}-compose-ng-{{ id }}-present
131+
- docker_image: docker-compose-ng-{{ id }}-present
133132
{%- endfor %}
134133
{%- endif %}
135134
{%- if required_networks is defined %}
136135
{%- for networkid in required_networks %}
137-
- docker_network: {{ formula }}-network-{{ networkid }}-present
136+
- docker_network: docker-network-{{ networkid }}-present
138137
{%- endfor %}
139138
{%- endif %}
140139

docker/compose/pause.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
12-
{{ formula }}-compose-{{ service }}-pause:
11+
docker-compose-{{ service }}-pause:
1312
module.run:
1413
- name: dockercompose.pause
1514
- path: {{ d.compose[service]['path'] }}

docker/compose/ps.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
12-
{{ formula }}-compose-{{ service }}-ps:
11+
docker-compose-{{ service }}-ps:
1312
module.run:
1413
- name: dockercompose.ps
1514
- path: {{ d.compose[service]['path'] }}

docker/compose/pull.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
12-
{{ formula }}-compose-{{ service }}-pull:
11+
docker-compose-{{ service }}-pull:
1312
module.run:
1413
- name: dockercompose.pull
1514
- path: {{ d.compose[service]['path'] }}

docker/compose/restart.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
12-
{{ formula }}-compose-{{ service }}-restart:
11+
docker-compose-{{ service }}-restart:
1312
module.run:
1413
- name: dockercompose.restart
1514
- path: {{ d.compose[service]['path'] }}

docker/compose/rm.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
12-
{{ formula }}-compose-{{ service }}-rm:
11+
docker-compose-{{ service }}-rm:
1312
module.run:
1413
- name: dockercompose.rm
1514
- path: {{ d.compose[service]['path'] }}

docker/compose/service_create.sls

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33

44
{%- set tplroot = tpldir.split('/')[0] %}
55
{%- from tplroot ~ "/map.jinja" import data as d with context %}
6-
{%- set formula = d.formula %}
76
87
{%- if 'applications' in d.compose and d.compose.applications %}
98
{%- for service in d.compose.applications|unique %}
109
{%- if 'path' in d.compose[service] and d.compose[service]['path'] %}
1110
{%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %}
1211
{%- if 'definition' in d.compose[service] and d.compose[service]['definition'] %}
1312
14-
{{ formula }}-compose-{{ service }}-service_create:
13+
docker-compose-{{ service }}-service_create:
1514
module.run:
1615
- name: dockercompose.service_create
1716
- path: {{ d.compose[service]['path'] }}

0 commit comments

Comments
 (0)