From 79d2d47c4def69742a4ea3c11d72e375981f0ad5 Mon Sep 17 00:00:00 2001 From: stratusjerry <28451941+stratusjerry@users.noreply.github.com> Date: Mon, 9 Jan 2023 12:34:34 -0500 Subject: [PATCH] style(jinja): fix unnecessary jinja indentation --- docker/compose/build.sls | 12 +- docker/compose/clean.sls | 4 +- docker/compose/get.sls | 12 +- docker/compose/kill.sls | 16 +- docker/compose/ng.sls | 160 +++++++++--------- docker/compose/pause.sls | 16 +- docker/compose/ps.sls | 12 +- docker/compose/pull.sls | 16 +- docker/compose/restart.sls | 16 +- docker/compose/rm.sls | 16 +- docker/compose/service_create.sls | 16 +- docker/compose/service_remove.sls | 14 +- docker/compose/service_set_tag.sls | 16 +- docker/compose/service_upsert.sls | 16 +- .../compose/software/alternatives/clean.sls | 8 +- .../compose/software/alternatives/install.sls | 16 +- docker/compose/software/binary/clean.sls | 18 +- docker/compose/software/binary/install.sls | 21 ++- docker/compose/software/package/clean.sls | 16 +- docker/compose/software/package/install.sls | 18 +- docker/compose/start.sls | 16 +- docker/compose/stop.sls | 16 +- docker/compose/unpause.sls | 16 +- docker/compose/up.sls | 16 +- docker/containers/absent.sls | 6 +- docker/containers/running.sls | 12 +- docker/containers/stopped.sls | 8 +- docker/init.sls | 4 +- docker/networks/clean.sls | 14 +- docker/networks/install.sls | 14 +- docker/software/alternatives/clean.sls | 8 +- docker/software/alternatives/install.sls | 16 +- docker/software/archive/clean.sls | 12 +- docker/software/archive/install.sls | 34 ++-- docker/software/config/daemon.sls | 18 +- docker/software/config/environ.sls | 16 +- docker/software/desktop/install.sls | 20 +-- docker/software/package/clean.sls | 28 +-- docker/software/package/install.sls | 44 ++--- docker/software/package/repo/clean.sls | 14 +- docker/software/service/clean.sls | 8 +- docker/software/service/running.sls | 34 ++-- docker/swarm/create_service.sls | 6 +- docker/swarm/joinswarm.sls | 6 +- docker/swarm/leaveswarm.sls | 4 +- docker/swarm/node_ls.sls | 6 +- docker/swarm/remove_node.sls | 6 +- docker/swarm/remove_service.sls | 6 +- docker/swarm/swarm_init.sls | 6 +- docker/swarm/swarm_service_info.sls | 6 +- docker/swarm/swarm_tokens.sls | 4 +- docker/swarm/update_node.sls | 6 +- 52 files changed, 434 insertions(+), 435 deletions(-) diff --git a/docker/compose/build.sls b/docker/compose/build.sls index d9a660ca..26f9d794 100644 --- a/docker/compose/build.sls +++ b/docker/compose/build.sls @@ -4,9 +4,9 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-build: module.run: @@ -16,6 +16,6 @@ docker-compose-{{ service }}-build: - service_names: {{ d.compose[service]['service_names'] }} {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/clean.sls b/docker/compose/clean.sls index a0e0bd31..82f5afe5 100644 --- a/docker/compose/clean.sls +++ b/docker/compose/clean.sls @@ -8,7 +8,7 @@ include: - {{ sls_compose_software_clean }} - {%- for name, container in d.compose.ng.items() %} +{%- for name, container in d.compose.ng.items() %} docker-compose-ng-{{ container.container_name|d(name) }}-{{ loop.index }}-stopped: docker_container.stopped: @@ -23,4 +23,4 @@ docker-compose-ng-{{ container.image }}-{{ loop.index }}-absent: - require_in: - sls: {{ sls_compose_software_clean }} - {% endfor %} +{% endfor %} diff --git a/docker/compose/get.sls b/docker/compose/get.sls index 69f557ce..56673e36 100644 --- a/docker/compose/get.sls +++ b/docker/compose/get.sls @@ -4,15 +4,15 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-get: module.run: - name: dockercompose.get - path: {{ d.compose[service]['path'] }} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/kill.sls b/docker/compose/kill.sls index 049f22e3..a3953bc9 100644 --- a/docker/compose/kill.sls +++ b/docker/compose/kill.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-kill: module.run: - name: dockercompose.kill - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/ng.sls b/docker/compose/ng.sls index f82f381e..744ce595 100644 --- a/docker/compose/ng.sls +++ b/docker/compose/ng.sls @@ -9,21 +9,21 @@ include: - docker.compose.software - docker.networks - {%- for name, container in d.compose.ng.items() %} - {%- set id = container.container_name|d(name) %} - {%- set required_containers = [] %} - {%- set required_networks = [] %} +{%- for name, container in d.compose.ng.items() %} + {%- set id = container.container_name|d(name) %} + {%- set required_containers = [] %} + {%- set required_networks = [] %} docker-compose-ng-{{ id }}-present: docker_image.present: - force: {{ d.misc.force_present }} - {%- if ':' in container.image %} - {%- set image = container.image.split(':',1) %} + {%- if ':' in container.image %} + {%- set image = container.image.split(':',1) %} - name: {{ image[0] }} - tag: {{ image[1] }} - {%- else %} + {%- else %} - name: {{ container.image }} - {%- endif %} + {%- endif %} docker-compose-ng-{{ id }}-running: docker_container.running: @@ -34,107 +34,107 @@ docker-compose-ng-{{ id }}-running: - privileged: {{ container.privileged|default(False) }} - interactive: {{ container.stdin_open|default(False) }} - tty: {{ container.tty|default(False) }} - {%- if 'command' in container %} + {%- if 'command' in container %} - command: {{ container.command }} - {%- endif %} - {%- if 'working_dir' in container %} + {%- endif %} + {%- if 'working_dir' in container %} - working_dir: {{ container.working_dir }} - {%- endif %} - {%- if 'volume_driver' in container %} + {%- endif %} + {%- if 'volume_driver' in container %} - volume_driver: {{ container.volume_driver }} - {%- endif %} - {%- if 'userns_mode' in container %} + {%- endif %} + {%- if 'userns_mode' in container %} - userns_mode: {{ container.userns_mode }} - {%- endif %} - {%- if 'user' in container %} + {%- endif %} + {%- if 'user' in container %} - user: {{ container.user }} - {%- endif %} - {%- if 'environment' in container and container.environment is iterable %} + {%- endif %} + {%- if 'environment' in container and container.environment is iterable %} - environment: - {%- for variable, value in container.environment.items() %} + {%- for variable, value in container.environment.items() %} - {{ variable }}: {{ value }} - {%- endfor %} - {%- endif %} - {%- if 'ports' in container and container.ports is iterable %} + {%- endfor %} + {%- endif %} + {%- if 'ports' in container and container.ports is iterable %} - port_bindings: - {%- for port_mapping in container.ports %} - {%- if port_mapping is string %} - {%- set mapping = port_mapping.split(':',2) %} - {%- if mapping|length < 2 %} + {%- for port_mapping in container.ports %} + {%- if port_mapping is string %} + {%- set mapping = port_mapping.split(':',2) %} + {%- if mapping|length < 2 %} - "{{ mapping[0] }}" - {%- elif mapping|length > 2 %} + {%- elif mapping|length > 2 %} - "{{ mapping[0] }}:{{ mapping[1] }}:{{ mapping[-1] }}" - {%- else %} + {%- else %} - "{{ mapping[0] }}:{{ mapping[-1] }}" - {%- endif %} - {%- elif port_mapping is mapping %} - - {{ port_mapping }} {%- endif %} - {%- endfor %} - {%- endif %} - {%- if 'volumes' in container %} + {%- elif port_mapping is mapping %} + - {{ port_mapping }} + {%- endif %} + {%- endfor %} + {%- endif %} + {%- if 'volumes' in container %} - binds: - {%- for bind in container.volumes %} - {%- set mapping = bind.rsplit(':', 1) %} - {%- if mapping|length > 1 %} + {%- for bind in container.volumes %} + {%- set mapping = bind.rsplit(':', 1) %} + {%- if mapping|length > 1 %} - "{{ mapping[0] }}:{{ mapping[-1] }}" - {%- else %} + {%- else %} - "{{ mapping[0] }}" - {%- endif %} - {%- endfor %} - {%- endif %} - {%- if 'volumes_from' in container %} + {%- endif %} + {%- endfor %} + {%- endif %} + {%- if 'volumes_from' in container %} - volumes_from: - {%- for volume in container.volumes_from %} - {%- do required_containers.append(volume) %} + {%- for volume in container.volumes_from %} + {%- do required_containers.append(volume) %} - {{ volume }} - {%- endfor %} - {%- endif %} - {%- if 'links' in container %} + {%- endfor %} + {%- endif %} + {%- if 'links' in container %} - links: - {%- for link in container.links %} - {%- set name, alias = link.split(':',1) %} - {%- do required_containers.append(name) %} + {%- for link in container.links %} + {%- set name, alias = link.split(':',1) %} + {%- do required_containers.append(name) %} {{ name }}: {{ alias }} - {%- endfor %} - {%- endif %} - {%- if 'networks' in container %} + {%- endfor %} + {%- endif %} + {%- if 'networks' in container %} - networks: - {%- for network in container.networks %} - {%- do required_networks.append(network) %} + {%- for network in container.networks %} + {%- do required_networks.append(network) %} - {{ network }} - {%- endfor %} - {%- endif %} - {%- if 'restart' in container %} - {%- set policy = container.restart.split(':',1) %} - {%- if policy|length < 2 %} + {%- endfor %} + {%- endif %} + {%- if 'restart' in container %} + {%- set policy = container.restart.split(':',1) %} + {%- if policy|length < 2 %} - restart_policy: {{ policy[0] }} - {%- else %} + {%- else %} - restart_policy: {{ policy[0] }}:{{ policy[-1] }} - {%- endif %} {%- endif %} - {%- if 'devices' in container %} + {%- endif %} + {%- if 'devices' in container %} - devices: - {%- for device in container.devices %} - {%- set mapping = device.rsplit(':', 1) %} - {%- if mapping|length > 1 %} + {%- for device in container.devices %} + {%- set mapping = device.rsplit(':', 1) %} + {%- if mapping|length > 1 %} - "{{ mapping[0] }}:{{ mapping[-1] }}" - {%- else %} + {%- else %} - "{{ mapping[0] }}" - {%- endif %} - {%- endfor %} - {%- endif %} + {%- endif %} + {%- endfor %} + {%- endif %} - require: - docker_image: docker-compose-ng-{{ id }}-present - {%- if required_containers is defined %} - {%- for containerid in required_containers %} + {%- if required_containers is defined %} + {%- for containerid in required_containers %} - docker_image: docker-compose-ng-{{ id }}-present - {%- endfor %} - {%- endif %} - {%- if required_networks is defined %} - {%- for networkid in required_networks %} + {%- endfor %} + {%- endif %} + {%- if required_networks is defined %} + {%- for networkid in required_networks %} - docker_network: docker-network-{{ networkid }}-present - {%- endfor %} - {%- endif %} + {%- endfor %} + {%- endif %} - {% endfor %} +{% endfor %} diff --git a/docker/compose/pause.sls b/docker/compose/pause.sls index a434fcaa..cb0a858d 100644 --- a/docker/compose/pause.sls +++ b/docker/compose/pause.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-pause: module.run: - name: dockercompose.pause - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/ps.sls b/docker/compose/ps.sls index 69564a6d..e8c3d2e0 100644 --- a/docker/compose/ps.sls +++ b/docker/compose/ps.sls @@ -4,15 +4,15 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-ps: module.run: - name: dockercompose.ps - path: {{ d.compose[service]['path'] }} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/pull.sls b/docker/compose/pull.sls index 192819ed..14e16e31 100644 --- a/docker/compose/pull.sls +++ b/docker/compose/pull.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-pull: module.run: - name: dockercompose.pull - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/restart.sls b/docker/compose/restart.sls index 59398b1e..595f4dbb 100644 --- a/docker/compose/restart.sls +++ b/docker/compose/restart.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-restart: module.run: - name: dockercompose.restart - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/rm.sls b/docker/compose/rm.sls index cdb958d6..f5ada8a8 100644 --- a/docker/compose/rm.sls +++ b/docker/compose/rm.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-rm: module.run: - name: dockercompose.rm - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/service_create.sls b/docker/compose/service_create.sls index dd6237e5..1bd4dbdd 100644 --- a/docker/compose/service_create.sls +++ b/docker/compose/service_create.sls @@ -4,11 +4,11 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} - {%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %} - {%- if 'definition' in d.compose[service] and d.compose[service]['definition'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} + {%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %} + {%- if 'definition' in d.compose[service] and d.compose[service]['definition'] %} docker-compose-{{ service }}-service_create: module.run: @@ -17,8 +17,8 @@ docker-compose-{{ service }}-service_create: - service_name: {{ d.compose[service]['service_name'] }} - definition: {{ d.compose[service]['definition'] }} - {% endif %} {% endif %} {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/service_remove.sls b/docker/compose/service_remove.sls index 7609e7a9..ee20417f 100644 --- a/docker/compose/service_remove.sls +++ b/docker/compose/service_remove.sls @@ -4,10 +4,10 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} - {%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} + {%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %} docker-compose-{{ service }}-service_remove: module.run: @@ -15,7 +15,7 @@ docker-compose-{{ service }}-service_remove: - path: {{ d.compose[service]['path'] }} - service_name: {{ d.compose[service]['service_name'] }} - {% endif %} {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/service_set_tag.sls b/docker/compose/service_set_tag.sls index ae95c1fd..8b76a311 100644 --- a/docker/compose/service_set_tag.sls +++ b/docker/compose/service_set_tag.sls @@ -4,11 +4,11 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} - {%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %} - {%- if 'tag' in d.compose[service] and d.compose[service]['tag'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} + {%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %} + {%- if 'tag' in d.compose[service] and d.compose[service]['tag'] %} docker-compose-{{ service }}-service_set_tag-{{ d.compose[service]['tag'] }}: module.run: @@ -17,8 +17,8 @@ docker-compose-{{ service }}-service_set_tag-{{ d.compose[service]['tag'] }}: - service_name: {{ d.compose[service]['service_name'] }} - tag: {{ d.compose[service]['tag'] }} - {% endif %} {% endif %} {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/service_upsert.sls b/docker/compose/service_upsert.sls index 8aa9f73b..48da91dc 100644 --- a/docker/compose/service_upsert.sls +++ b/docker/compose/service_upsert.sls @@ -4,11 +4,11 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} - {%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %} - {%- if 'definition' in d.compose[service] and d.compose[service]['definition'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} + {%- if 'service_name' in d.compose[service] and d.compose[service]['service_name'] %} + {%- if 'definition' in d.compose[service] and d.compose[service]['definition'] %} docker-compose-{{ service }}-service_upsert: module.run: @@ -17,8 +17,8 @@ docker-compose-{{ service }}-service_upsert: - service_name: {{ d.compose[service]['service_name'] }} - definition: {{ d.compose[service]['definition'] }} - {% endif %} {% endif %} {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/software/alternatives/clean.sls b/docker/compose/software/alternatives/clean.sls index 087ef4d2..15840973 100644 --- a/docker/compose/software/alternatives/clean.sls +++ b/docker/compose/software/alternatives/clean.sls @@ -4,8 +4,8 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %} - {%- for cmd in d.pkg.compose.commands|unique %} +{%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %} + {%- for cmd in d.pkg.compose.commands|unique %} docker-compose-alternatives-clean-{{ cmd }}: alternatives.remove: @@ -13,5 +13,5 @@ docker-compose-alternatives-clean-{{ cmd }}: - path: {{ d.pkg.compose.path }}/bin/{{ cmd }} - onlyif: update-alternatives --list |grep ^link-docker-compose-{{ cmd }} - {%- endfor %} - {%- endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/software/alternatives/install.sls b/docker/compose/software/alternatives/install.sls index 01b6a33d..5860b7db 100644 --- a/docker/compose/software/alternatives/install.sls +++ b/docker/compose/software/alternatives/install.sls @@ -4,25 +4,25 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %} - {%- set sls_binary_install = tplroot ~ '.compose.software.binary.install' %} +{%- if d.linux.altpriority|int > 0 and grains.kernel == 'Linux' and grains.os_family not in ('Arch',) %} + {%- set sls_binary_install = tplroot ~ '.compose.software.binary.install' %} include: - {{ sls_binary_install }} - {%- for cmd in d.pkg.compose.commands|unique %} + {%- for cmd in d.pkg.compose.commands|unique %} docker-compose-alternatives-install-bin-{{ cmd }}: - {%- if grains.os_family not in ('Suse', 'Arch') %} + {%- if grains.os_family not in ('Suse', 'Arch') %} alternatives.install: - name: link-docker-compose-{{ cmd }} - link: /usr/local/bin/{{ cmd }} - order: 10 - path: {{ d.pkg.compose['path'] }}/bin/{{ cmd }} - priority: {{ d.linux.altpriority }} - {%- else %} + {%- else %} cmd.run: - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-docker-compose-{{ cmd }} {{ d.pkg.compose['path'] }}/bin/{{ cmd }} {{ d.linux.altpriority }} # noqa 204 - {%- endif %} + {%- endif %} - onlyif: - test -f {{ d.pkg.compose['path'] }}/bin/{{ cmd }} @@ -39,5 +39,5 @@ docker-compose-alternatives-set-bin-{{ cmd }}: - path: {{ d.pkg.compose.path }}/bin/{{ cmd }} - onlyif: test -f {{ d.pkg.compose['path'] }}/bin/{{ cmd }} - {%- endfor %} - {%- endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/software/binary/clean.sls b/docker/compose/software/binary/clean.sls index e5c7800d..eef0c7eb 100644 --- a/docker/compose/software/binary/clean.sls +++ b/docker/compose/software/binary/clean.sls @@ -4,8 +4,8 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if grains.kernel|lower in ('linux',) and 'path' in d.pkg.compose %} - {%- set sls_alternatives_clean = tplroot ~ '.software.alternatives.clean' %} +{%- if grains.kernel|lower in ('linux',) and 'path' in d.pkg.compose %} + {%- set sls_alternatives_clean = tplroot ~ '.software.alternatives.clean' %} include: - {{ sls_alternatives_clean }} @@ -14,14 +14,14 @@ docker-compose-archive-absent: file.absent: - names: - {{ d.dir.tmp }}/docker-compose - {%- if 'path' in d.pkg.compose %} + {%- if 'path' in d.pkg.compose %} - {{ d.pkg.compose.path }} - {%- endif %} - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} - {%- if 'commands' in d.pkg.compose %} - {%- for cmd in d.pkg.compose.commands|unique %} + {%- endif %} + {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- if 'commands' in d.pkg.compose %} + {%- for cmd in d.pkg.compose.commands|unique %} - /usr/local/bin/{{ cmd }} - {%- endfor %} - {%- endif %} + {%- endfor %} {%- endif %} {%- endif %} +{%- endif %} diff --git a/docker/compose/software/binary/install.sls b/docker/compose/software/binary/install.sls index 56209bd8..e3cd0302 100644 --- a/docker/compose/software/binary/install.sls +++ b/docker/compose/software/binary/install.sls @@ -4,10 +4,10 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if grains.kernel|lower in ('linux',) %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} - {%- set composer = d.pkg.compose %} - {%- if composer.use_upstream == 'binary' and 'binary' in composer and 'path' in composer %} +{%- if grains.kernel|lower in ('linux',) %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} + {%- set composer = d.pkg.compose %} + {%- if composer.use_upstream == 'binary' and 'binary' in composer and 'path' in composer %} docker-compose-software-binary-install: {%- if 'deps' in d.pkg and d.pkg.deps %} @@ -46,8 +46,8 @@ docker-compose-software-binary-install: - group - mode - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} - {%- for cmd in composer.commands|unique %} + {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- for cmd in composer.commands|unique %} docker-compose-software-binary-install-symlink-{{ cmd }}: file.symlink: @@ -59,15 +59,14 @@ docker-compose-software-binary-install-symlink-{{ cmd }}: - require: - file: docker-compose-software-binary-install - {%- endfor %} - {%- endif %} + {%- endfor %} {%- endif %} - {%- else %} + {%- endif %} +{%- else %} docker-compose-software-binary-install-other: test.show_notification: - text: | The docker-compose binary is unavailable/unselected for {{ salt['grains.get']('finger', grains.os_family) }} - {%- endif %} - +{%- endif %} diff --git a/docker/compose/software/package/clean.sls b/docker/compose/software/package/clean.sls index 4e1fb523..2a47dc19 100644 --- a/docker/compose/software/package/clean.sls +++ b/docker/compose/software/package/clean.sls @@ -4,22 +4,22 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if d.pkg.compose.use_upstream in ('package', 'repo') %} - {%- if grains.os_family|lower in ('redhat', 'debian') %} - {%- set sls_repo_clean = tplroot ~ '.software.package.repo.clean' %} - {%- set resource_repo_clean = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} +{%- if d.pkg.compose.use_upstream in ('package', 'repo') %} + {%- if grains.os_family|lower in ('redhat', 'debian') %} + {%- set sls_repo_clean = tplroot ~ '.software.package.repo.clean' %} + {%- set resource_repo_clean = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} include: - {{ sls_repo_clean }} - {%- endif %} + {%- endif %} docker-compose-package-clean-pkgs: pkg.removed: - name: {{ d.pkg.compose.name }} - reload_modules: true - {%- if grains.os_family|lower in ('redhat', 'debian') %} + {%- if grains.os_family|lower in ('redhat', 'debian') %} - require: - {{ resource_repo_clean }}: docker-software-package-repo-absent - {%- endif %} - {%- endif %} + +{%- endif %} diff --git a/docker/compose/software/package/install.sls b/docker/compose/software/package/install.sls index 960b9056..d3178335 100644 --- a/docker/compose/software/package/install.sls +++ b/docker/compose/software/package/install.sls @@ -4,15 +4,15 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if d.pkg.compose.use_upstream in ('package', 'repo') %} - {%- if grains.os_family in ('RedHat', 'Debian') %} - {%- set sls_repo_install = tplroot ~ '.software.package.repo.install' %} - {%- set resource_repo_managed = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} +{%- if d.pkg.compose.use_upstream in ('package', 'repo') %} + {%- if grains.os_family in ('RedHat', 'Debian') %} + {%- set sls_repo_install = tplroot ~ '.software.package.repo.install' %} + {%- set resource_repo_managed = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} include: - {{ sls_repo_install }} - {%- endif %} + {%- endif %} docker-compose-package-install-deps: pkg.installed: @@ -25,17 +25,17 @@ docker-compose-package-install-pkgs: - names: {{ d.pkg.compose.commands|unique|json }} - runas: {{ d.identity.rootuser }} - reload_modules: true - {%- if grains.os_family in ('RedHat', 'Debian') %} + {%- if grains.os_family in ('RedHat', 'Debian') %} - refresh: {{ d.misc.refresh|default(true, true) }} - require: - {{ resource_repo_managed }}: docker-software-package-repo-managed - {%- endif %} + {%- endif %} - {%- else %} +{%- else %} docker-compose-package-install-other: test.show_notification: - text: | The docker compose package is unavailable/unselected for {{ salt['grains.get']('finger', grains.os_family) }} - {%- endif %} +{%- endif %} diff --git a/docker/compose/start.sls b/docker/compose/start.sls index 3feaab6d..e37b4a74 100644 --- a/docker/compose/start.sls +++ b/docker/compose/start.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-start: module.run: - name: dockercompose.start - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/stop.sls b/docker/compose/stop.sls index e74bdcf2..5e8ee900 100644 --- a/docker/compose/stop.sls +++ b/docker/compose/stop.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-stop: module.run: - name: dockercompose.stop - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/unpause.sls b/docker/compose/unpause.sls index f495c5ca..d6038ca9 100644 --- a/docker/compose/unpause.sls +++ b/docker/compose/unpause.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-unpause: module.run: - name: dockercompose.unpause - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/compose/up.sls b/docker/compose/up.sls index 291507e1..6f6fb4e9 100644 --- a/docker/compose/up.sls +++ b/docker/compose/up.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'applications' in d.compose and d.compose.applications %} - {%- for service in d.compose.applications|unique %} - {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} +{%- if 'applications' in d.compose and d.compose.applications %} + {%- for service in d.compose.applications|unique %} + {%- if 'path' in d.compose[service] and d.compose[service]['path'] %} docker-compose-{{ service }}-up: module.run: - name: dockercompose.up - path: {{ d.compose[service]['path'] }} - {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} + {%- if 'services_names' in d.compose[service] and d.compose[service]['service_names'] is iterable %} - service_names: {{ d.compose[service]['service_names'] }} - {%- endif %} + {%- endif %} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/containers/absent.sls b/docker/containers/absent.sls index ea5dd699..c1206b62 100644 --- a/docker/containers/absent.sls +++ b/docker/containers/absent.sls @@ -5,8 +5,8 @@ {%- from tplroot ~ "/map.jinja" import data as d with context %} {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} - {%- if 'running' in d.containers and d.containers.running %} - {%- set sls_stopped = tplroot ~ '.containers.stopped' %} +{%- if 'running' in d.containers and d.containers.running %} + {%- set sls_stopped = tplroot ~ '.containers.stopped' %} include: - {{ sls_stopped }} @@ -18,4 +18,4 @@ docker-containers-absent: - require: - sls: {{ sls_stopped }} - {%- endif %} +{%- endif %} diff --git a/docker/containers/running.sls b/docker/containers/running.sls index c9dd13e1..885d9f02 100644 --- a/docker/containers/running.sls +++ b/docker/containers/running.sls @@ -5,15 +5,15 @@ {%- from tplroot ~ "/map.jinja" import data as d with context %} {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} - {%- if 'running' in d.containers and d.containers.running %} - {%- for c in d.containers.running|unique %} - {%- if c in d.containers and d.containers[c] %} +{%- if 'running' in d.containers and d.containers.running %} + {%- for c in d.containers.running|unique %} + {%- if c in d.containers and d.containers[c] %} docker-containers-{{ c }}-running: docker_container.running: - name: {{ c if 'name' not in d.containers[c] else d.containers[c]['name'] }} {{- format_kwargs(d.containers[c]) }} - {% endif %} - {%- endfor %} - {%- endif %} + {% endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/containers/stopped.sls b/docker/containers/stopped.sls index 11b6a098..84b08208 100644 --- a/docker/containers/stopped.sls +++ b/docker/containers/stopped.sls @@ -4,13 +4,13 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'running' in d.containers and d.containers.running %} - {%- for c in d.containers.running|unique %} +{%- if 'running' in d.containers and d.containers.running %} + {%- for c in d.containers.running|unique %} docker-containers-{{ c }}-stopped: docker_container.stopped: - name: {{ c }} - onlyif: docker container inspect {{ c }} - {%- endfor %} - {%- endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/init.sls b/docker/init.sls index 49532293..77ff1276 100644 --- a/docker/init.sls +++ b/docker/init.sls @@ -3,7 +3,7 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if d.wanted is iterable %} +{%- if d.wanted is iterable %} include: {{ '- .software' if 'docker' in d.wanted else '' }} @@ -11,4 +11,4 @@ include: # .networks # .containers - {%- endif %} +{%- endif %} diff --git a/docker/networks/clean.sls b/docker/networks/clean.sls index a3ad6297..2a2d5d6a 100644 --- a/docker/networks/clean.sls +++ b/docker/networks/clean.sls @@ -4,19 +4,19 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'networks' in d and d.networks %} - {%- set sls_archive = tplroot ~ '.software.archive.install' %} - {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} - {%- set sls_package = tplroot ~ '.software.package.install' %} +{%- if 'networks' in d and d.networks %} + {%- set sls_archive = tplroot ~ '.software.archive.install' %} + {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} + {%- set sls_package = tplroot ~ '.software.package.install' %} include: - {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} - {%- for name in d.networks %} + {%- for name in d.networks %} docker-network-{{ name }}-absent: docker_network.absent: - name: {{ name }} - {%- endfor %} - {%- endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/networks/install.sls b/docker/networks/install.sls index 9e23b4d8..e91f4b10 100644 --- a/docker/networks/install.sls +++ b/docker/networks/install.sls @@ -4,20 +4,20 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'networks' in d and d.networks %} - {%- set sls_archive = tplroot ~ '.software.archive.install' %} - {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} - {%- set sls_package = tplroot ~ '.software.package.install' %} +{%- if 'networks' in d and d.networks %} + {%- set sls_archive = tplroot ~ '.software.archive.install' %} + {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} + {%- set sls_package = tplroot ~ '.software.package.install' %} include: - {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} - {%- for name in d.networks %} + {%- for name in d.networks %} docker-network-{{ name }}-present: docker_network.present: - name: {{ name }} - unless: docker network ls | grep ' {{ name }} ' - {%- endfor %} - {%- endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/software/alternatives/clean.sls b/docker/software/alternatives/clean.sls index c4aaca6a..c2f27b2c 100644 --- a/docker/software/alternatives/clean.sls +++ b/docker/software/alternatives/clean.sls @@ -4,8 +4,8 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if grains.kernel == 'Linux' and d.linux.altpriority|int > 0 and grains.os_family not in ('Arch',) %} - {%- for cmd in d.pkg.docker.commands|unique %} +{%- if grains.kernel == 'Linux' and d.linux.altpriority|int > 0 and grains.os_family not in ('Arch',) %} + {%- for cmd in d.pkg.docker.commands|unique %} docker-alternatives-clean-{{ cmd }}: alternatives.remove: @@ -13,5 +13,5 @@ docker-alternatives-clean-{{ cmd }}: - path: {{ d.pkg.docker.path }}/bin/{{ cmd }} - onlyif: update-alternatives --list |grep ^link-docker-{{ cmd }} - {%- endfor %} - {%- endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/software/alternatives/install.sls b/docker/software/alternatives/install.sls index dfc80781..ee16f586 100644 --- a/docker/software/alternatives/install.sls +++ b/docker/software/alternatives/install.sls @@ -4,25 +4,25 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if grains.kernel == 'Linux' and d.linux.altpriority|int > 0 and grains.os_family not in ('Arch',) %} - {%- set sls_archive_install = tplroot ~ '.docker.archive.install' %} +{%- if grains.kernel == 'Linux' and d.linux.altpriority|int > 0 and grains.os_family not in ('Arch',) %} + {%- set sls_archive_install = tplroot ~ '.docker.archive.install' %} include: - {{ sls_archive_install }} - {%- for cmd in d.pkg.docker.commands|unique %} + {%- for cmd in d.pkg.docker.commands|unique %} docker-alternatives-install-bin-{{ cmd }}: - {%- if grains.os_family not in ('Suse', 'Arch') %} + {%- if grains.os_family not in ('Suse', 'Arch') %} alternatives.install: - name: link-docker-{{ cmd }} - link: /usr/local/bin/{{ cmd }} - order: 10 - path: {{ d.pkg.docker['path'] }}/{{ cmd }} - priority: {{ d.linux.altpriority }} - {%- else %} + {%- else %} cmd.run: - name: update-alternatives --install /usr/local/bin/{{ cmd }} link-docker-{{ cmd }} {{ d.pkg.docker['path'] }}/{{ cmd }} {{ d.linux.altpriority }} # noqa 204 - {%- endif %} + {%- endif %} - onlyif: - test -f {{ d.pkg.docker['path'] }}/{{ cmd }} @@ -39,5 +39,5 @@ docker-alternatives-set-bin-{{ cmd }}: - path: {{ d.pkg.docker.path }}/{{ cmd }} - onlyif: test -f {{ d.pkg.docker['path'] }}/{{ cmd }} - {%- endfor %} - {%- endif %} + {%- endfor %} +{%- endif %} diff --git a/docker/software/archive/clean.sls b/docker/software/archive/clean.sls index b0a96690..193e84bd 100644 --- a/docker/software/archive/clean.sls +++ b/docker/software/archive/clean.sls @@ -4,8 +4,8 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if grains.kernel|lower in ('linux',) %} - {%- set sls_alternatives_clean = tplroot ~ '.software.alternatives.clean' %} +{%- if grains.kernel|lower in ('linux',) %} + {%- set sls_alternatives_clean = tplroot ~ '.software.alternatives.clean' %} include: - {{ sls_alternatives_clean }} @@ -15,10 +15,10 @@ docker-archive-absent: - names: - {{ d.dir.tmp }}/docker - {{ d.pkg.docker.path }} - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} - {%- for cmd in d.pkg.docker.commands|unique %} + {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- for cmd in d.pkg.docker.commands|unique %} - /usr/local/bin/{{ cmd }} - {%- endfor %} + {%- endfor %} - {%- endif %} {%- endif %} +{%- endif %} diff --git a/docker/software/archive/install.sls b/docker/software/archive/install.sls index b1c0ab60..e103bc47 100644 --- a/docker/software/archive/install.sls +++ b/docker/software/archive/install.sls @@ -4,27 +4,27 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if grains.kernel|lower == 'linux' and d.pkg.docker.use_upstream == 'archive' and 'archive' in d.pkg.docker %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} - {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} +{%- if grains.kernel|lower == 'linux' and d.pkg.docker.use_upstream == 'archive' and 'archive' in d.pkg.docker %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} + {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} docker-software-docker-archive-install: - {%- if 'deps' in d.pkg and d.pkg.deps %} - {%- if grains.os|lower in ('redhat', 'centos') %} - # python-docker package is not available or too old on CentOS, RedHat - # https://github.com/saltstack/salt/issues/58920 + {%- if 'deps' in d.pkg and d.pkg.deps %} + {%- if grains.os|lower in ('redhat', 'centos') %} + # python-docker package is not available or too old on CentOS, RedHat + # https://github.com/saltstack/salt/issues/58920 pip.installed: - name: docker - reload_modules: {{ d.misc.reload or true }} - require: - pkg: docker-software-docker-archive-install - {%- endif %} + {%- endif %} pkg.installed: - names: {{ d.pkg.deps|json }} - reload_modules: {{ d.misc.reload or true }} - require_in: - file: docker-software-docker-archive-install - {%- endif %} + {%- endif %} file.directory: - name: {{ d.pkg.docker.path }} - makedirs: True @@ -52,8 +52,8 @@ docker-software-docker-archive-install: - require: - file: docker-software-docker-archive-install - {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} - {%- for cmd in d.pkg.docker.commands|unique %} + {%- if d.linux.altpriority|int == 0 or grains.os_family in ('Arch', 'MacOS') %} + {%- for cmd in d.pkg.docker.commands|unique %} docker-software-docker-archive-install-symlink-{{ cmd }}: file.symlink: @@ -65,9 +65,9 @@ docker-software-docker-archive-install-symlink-{{ cmd }}: - require: - archive: docker-software-docker-archive-install - {%- endfor %} - {%- endif %} - {%- if 'service' in d.pkg.docker and d.pkg.docker.service is mapping %} + {%- endfor %} + {%- endif %} + {%- if 'service' in d.pkg.docker and d.pkg.docker.service is mapping %} docker-software-docker-archive-install-file-directory: file.directory: @@ -104,12 +104,12 @@ docker-software-docker-archive-install-managed-service: - require: - archive: docker-software-docker-archive-install - {%- endif %} - {%- else %} + {%- endif %} +{%- else %} docker-software-docker-archive-install-other: test.show_notification: - text: | The docker archive is unavailable/unselected for {{ salt['grains.get']('finger', grains.os_family) }} - {%- endif %} +{%- endif %} diff --git a/docker/software/config/daemon.sls b/docker/software/config/daemon.sls index 5164095c..9a15ec41 100644 --- a/docker/software/config/daemon.sls +++ b/docker/software/config/daemon.sls @@ -4,11 +4,11 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'daemon_config' in d.pkg.docker and d.pkg.docker.daemon_config %} - {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} - {%- set sls_archive = tplroot ~ '.software.archive.install' %} - {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} - {%- set sls_package = tplroot ~ '.software.package.install' %} +{%- if 'daemon_config' in d.pkg.docker and d.pkg.docker.daemon_config %} + {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} + {%- set sls_archive = tplroot ~ '.software.archive.install' %} + {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} + {%- set sls_package = tplroot ~ '.software.package.install' %} include: - {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} @@ -21,21 +21,21 @@ docker-software-daemon-file-managed-daemon_file: ) }} - makedirs: True - {%- if grains.os != 'Windows' %} + {%- if grains.os != 'Windows' %} - mode: '0640' - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} - {%- endif %} + {%- endif %} - template: jinja - context: config: {{ d.pkg.docker.daemon_config|json }} - require: - sls: {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} - {%- else %} +{%- else %} docker-software-daemon-file-managed-daemon_file: file.absent: - name: {{ d.pkg.docker.daemon_config_file }} - {%- endif %} +{%- endif %} diff --git a/docker/software/config/environ.sls b/docker/software/config/environ.sls index 95264954..a405cebd 100644 --- a/docker/software/config/environ.sls +++ b/docker/software/config/environ.sls @@ -4,11 +4,11 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'environ' in d.pkg.docker and d.pkg.docker.environ %} - {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} - {%- set sls_archive = tplroot ~ '.software.archive.install' %} - {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} - {%- set sls_package = tplroot ~ '.software.package.install' %} +{%- if 'environ' in d.pkg.docker and d.pkg.docker.environ %} + {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} + {%- set sls_archive = tplroot ~ '.software.archive.install' %} + {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} + {%- set sls_package = tplroot ~ '.software.package.install' %} include: - {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} @@ -21,15 +21,15 @@ docker-software-environ-file-managed-environ_file: ) }} - makedirs: True - {%- if grains.os != 'Windows' %} + {%- if grains.os != 'Windows' %} - mode: '0640' - user: {{ d.identity.rootuser }} - group: {{ d.identity.rootgroup }} - {%- endif %} + {%- endif %} - template: jinja - context: environ: {{ d.pkg.docker.environ|json }} - require: - sls: {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} - {%- endif %} +{%- endif %} diff --git a/docker/software/desktop/install.sls b/docker/software/desktop/install.sls index 43978cdc..c58e4377 100644 --- a/docker/software/desktop/install.sls +++ b/docker/software/desktop/install.sls @@ -4,18 +4,18 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if grains.os|lower in ('darwin', 'windows') %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} - {%- if d.pkg.docker.use_upstream == 'desktop' and 'desktop' in d.pkg.docker %} +{%- if grains.os|lower in ('darwin', 'windows') %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} + {%- if d.pkg.docker.use_upstream == 'desktop' and 'desktop' in d.pkg.docker %} - {%- if grains.os == 'MacOS' %} + {%- if grains.os == 'MacOS' %} docker-software-desktop-download-tmpdir: file.directory: - name: {{ d.dir.tmp }} - makedirs: true - require_in: - pkg: docker-macos-app-install-cmd-run - {%- endif %} + {%- endif %} docker-software-desktop-download: file.managed: @@ -28,7 +28,7 @@ docker-software-desktop-download: docker-software-desktop-install: - {%- if grains.os|lower == 'windows' %} + {%- if grains.os|lower == 'windows' %} pip.installed: - name: docker - runas: {{ d.identity.rootuser }} @@ -37,7 +37,7 @@ docker-software-desktop-install: - require: - file: docker-software-desktop-download - {%- elif grains.os|lower == 'macos' %} + {%- elif grains.os|lower == 'macos' %} macpackage.installed: - name: {{ d.dir.tmp }}/Docker-Desktop{{ d.pkg.docker.suffix }} - store: True @@ -53,13 +53,13 @@ docker-software-desktop-install: - require: - macpackage: docker-software-desktop-install - {%- endif %} {%- endif %} - {%- else %} + {%- endif %} +{%- else %} docker-software-desktop-install-other: test.show_notification: - text: | The docker desktop is unavailable/unselected for {{ salt['grains.get']('finger', grains.os_family) }} - {%- endif %} +{%- endif %} diff --git a/docker/software/package/clean.sls b/docker/software/package/clean.sls index ec126276..b792ad25 100644 --- a/docker/software/package/clean.sls +++ b/docker/software/package/clean.sls @@ -4,28 +4,28 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if d.pkg.docker.use_upstream in ('package', 'repo') %} - {%- set enable_repo = grains.os_family in ('RedHat', 'Debian') and d.pkg.docker.get('repo') %} - {%- if enable_repo %} - {%- set sls_repo_clean = tplroot ~ '.software.package.repo.clean' %} - {%- set resource_repo_clean = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} +{%- if d.pkg.docker.use_upstream in ('package', 'repo') %} + {%- set enable_repo = grains.os_family in ('RedHat', 'Debian') and d.pkg.docker.get('repo') %} + {%- if enable_repo %} + {%- set sls_repo_clean = tplroot ~ '.software.package.repo.clean' %} + {%- set resource_repo_clean = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} include: - {{ sls_repo_clean }} - {%- endif %} + {%- endif %} - {%- if grains.kernel|lower in ('linux', 'darwin') %} + {%- if grains.kernel|lower in ('linux', 'darwin') %} docker-software-package-clean-pkg: pkg.removed: - names: - {{ d.pkg.docker.name }} - python3-docker - reload_modules: {{ d.misc.reload|default(true, true) }} - {%- if enable_repo %} + {%- if enable_repo %} - require: - {{ resource_repo_clean }}: docker-software-package-repo-absent - {%- endif %} + {%- endif %} - {%- elif grains.os_family == 'MacOS' %} + {%- elif grains.os_family == 'MacOS' %} docker-software-package-clean-brew: cmd.run: @@ -34,18 +34,18 @@ docker-software-package-clean-brew: - onlyif: - brew list | grep ^docker-machine$ - {%- elif grains.os_family == 'Windows' %} + {%- elif grains.os_family == 'Windows' %} docker-software-package-clean-choco: chocolatey.uninstalled: - name: {{ d.pkg.docker.name }} - {%- endif %} - {%- else %} + {%- endif %} +{%- else %} docker-software-package-clean-other: test.show_notification: - text: | The docker package is unavailable/unselected for {{ salt['grains.get']('finger', grains.os_family) }} - {%- endif %} +{%- endif %} diff --git a/docker/software/package/install.sls b/docker/software/package/install.sls index 9b995df9..26e723de 100644 --- a/docker/software/package/install.sls +++ b/docker/software/package/install.sls @@ -4,35 +4,35 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if d.pkg.docker.use_upstream in ('package', 'repo') %} - {%- set enable_repo = grains.os_family in ('RedHat', 'Debian') and d.pkg.docker.get('repo') %} - {%- set docker_pkg_version = d.version | default(d.pkg.version, true) %} - {%- if enable_repo %} - {%- set sls_repo_install = tplroot ~ '.software.package.repo.install' %} - {%- set resource_repo_managed = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} +{%- if d.pkg.docker.use_upstream in ('package', 'repo') %} + {%- set enable_repo = grains.os_family in ('RedHat', 'Debian') and d.pkg.docker.get('repo') %} + {%- set docker_pkg_version = d.version | default(d.pkg.version, true) %} + {%- if enable_repo %} + {%- set sls_repo_install = tplroot ~ '.software.package.repo.install' %} + {%- set resource_repo_managed = 'file' if grains.os_family == 'Debian' else 'pkgrepo' %} include: - {{ sls_repo_install }} - {%- endif %} + {%- endif %} - {%- if grains.kernel|lower in ('linux', 'darwin') %} - {%- if 'deps' in d.pkg and d.pkg.deps %} + {%- if grains.kernel|lower in ('linux', 'darwin') %} + {%- if 'deps' in d.pkg and d.pkg.deps %} docker-software-package-install-deps: - {%- if grains.os|lower in ('centos', 'redhat') %} - # python-docker package is not available or too old on CentOS, RedHat - # https://github.com/saltstack/salt/issues/58920 + {%- if grains.os|lower in ('centos', 'redhat') %} + # python-docker package is not available or too old on CentOS, RedHat + # https://github.com/saltstack/salt/issues/58920 pip.installed: - name: docker - reload_modules: {{ d.misc.reload or true }} - require: - pkg: docker-software-package-install-deps - {%- endif %} + {%- endif %} pkg.installed: - names: {{ d.pkg.deps|json }} - require_in: - pkg: docker-software-package-install-pkg - {%- endif %} + {%- endif %} docker-software-package-install-pkg: pkg.installed: @@ -41,15 +41,15 @@ docker-software-package-install-pkg: - runas: {{ d.identity.rootuser }} - reload_modules: {{ d.misc.reload|default(true, true) }} - refresh: {{ d.misc.refresh|default(true, true) }} - {%- if grains.os|lower not in ('suse',) %} + {%- if grains.os|lower not in ('suse',) %} - hold: {{ d.misc.hold|default(false, true) }} - {%- endif %} - {%- if enable_repo %} + {%- endif %} + {%- if enable_repo %} - require: - {{ resource_repo_managed }}: docker-software-package-repo-managed - {%- endif %} + {%- endif %} - {%- elif grains.kernel|lower in ('windows',) %} + {%- elif grains.kernel|lower in ('windows',) %} docker-software-package-install-deps: chocolatey.installed: @@ -61,12 +61,12 @@ docker-software-package-install-choco: - name: docker-machine - force: True - {%- endif %} - {%- else %} + {%- endif %} +{%- else %} docker-software-package-install-other: test.show_notification: - text: | The docker package is unavailable/unselected for {{ salt['grains.get']('finger', grains.os_family) }} - {%- endif %} +{%- endif %} diff --git a/docker/software/package/repo/clean.sls b/docker/software/package/repo/clean.sls index e23c24c8..67f00c7e 100644 --- a/docker/software/package/repo/clean.sls +++ b/docker/software/package/repo/clean.sls @@ -4,22 +4,22 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'repo' in d.pkg.docker and d.pkg.docker.repo %} +{%- if 'repo' in d.pkg.docker and d.pkg.docker.repo %} docker-software-package-repo-absent: - {%- if grains.os_family != 'Debian' %} + {%- if grains.os_family != 'Debian' %} pkgrepo.absent: - name: {{ d.pkg.docker.repo.name | yaml_dquote }} - {%- else %} - # Due to this bug https://github.com/saltstack/salt/issues/51656#issuecomment-1032882625 - # we should delete the repo file using other method + {%- else %} + # Due to this bug https://github.com/saltstack/salt/issues/51656#issuecomment-1032882625 + # we should delete the repo file using other method file.absent: - name: {{ d.pkg.docker.repo.file }} docker-software-package-repo-keyring-absent: file.absent: - name: {{ d.pkg.docker.repo_keyring }} - {%- endif %} - {%- endif %} + +{%- endif %} diff --git a/docker/software/service/clean.sls b/docker/software/service/clean.sls index b739a7ab..a346ff6f 100644 --- a/docker/software/service/clean.sls +++ b/docker/software/service/clean.sls @@ -4,13 +4,13 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'service' in d.pkg.docker and d.pkg.docker.service and grains.os != 'Windows' %} +{%- if 'service' in d.pkg.docker and d.pkg.docker.service and grains.os != 'Windows' %} docker-software-service-clean-docker: service.dead: - name: {{ d.pkg.docker.service.name }} - enable: False - {%- if grains.kernel|lower == 'linux' %} + {%- if grains.kernel|lower == 'linux' %} - onlyif: systemctl list-units | grep {{ d.pkg.docker.service.name }} >/dev/null 2>&1 file.absent: - name: {{ d.dir.service }}{{ d.div }}docker.service @@ -20,6 +20,6 @@ docker-software-service-clean-docker: - name: systemctl daemon-reload - require: - file: docker-software-service-clean-docker - {%- endif %} - {%- endif %} + +{%- endif %} diff --git a/docker/software/service/running.sls b/docker/software/service/running.sls index 411c6cfe..67c3157f 100644 --- a/docker/software/service/running.sls +++ b/docker/software/service/running.sls @@ -4,19 +4,19 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'service' in d.pkg.docker and d.pkg.docker.service and grains.os != 'Windows' %} - {%- set sls_config_daemon = tplroot ~ '.software.config.daemon' %} - {%- set sls_environ = tplroot ~ '.software.config.environ' %} - {%- set sls_archive = tplroot ~ '.software.archive.install' %} - {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} - {%- set sls_package = tplroot ~ '.software.package.install' %} +{%- if 'service' in d.pkg.docker and d.pkg.docker.service and grains.os != 'Windows' %} + {%- set sls_config_daemon = tplroot ~ '.software.config.daemon' %} + {%- set sls_environ = tplroot ~ '.software.config.environ' %} + {%- set sls_archive = tplroot ~ '.software.archive.install' %} + {%- set sls_desktop = tplroot ~ '.software.desktop.install' %} + {%- set sls_package = tplroot ~ '.software.package.install' %} include: - {{ sls_archive if d.pkg.docker.use_upstream == 'archive' else sls_desktop if d.pkg.docker.use_upstream == 'desktop' else sls_package }} - {{ sls_environ }} - {{ sls_config_daemon }} - {%- if grains.kernel|lower == 'linux' %} + {%- if grains.kernel|lower == 'linux' %} docker-software-service-running-unmasked: service.unmasked: @@ -26,30 +26,30 @@ docker-software-service-running-unmasked: - service: docker-software-service-running-docker - require: - sls: {{ sls_config_daemon }} - {%- if 'environ' in d.pkg.docker and d.pkg.docker.environ %} + {%- if 'environ' in d.pkg.docker and d.pkg.docker.environ %} - sls: {{ sls_environ }} - {%- endif %} - {%- if d.misc.firewall %} + {%- endif %} + {%- if d.misc.firewall %} pkg.installed: - name: firewalld - reload_modules: true - {%- endif %} - {%- endif %} + {%- endif %} + docker-software-service-running-docker: service.running: - name: {{ d.pkg.docker.service.name }} - require: - sls: {{ sls_config_daemon }} - {%- if 'environ' in d.pkg.docker and d.pkg.docker.environ %} + {%- if 'environ' in d.pkg.docker and d.pkg.docker.environ %} - sls: {{ sls_environ }} - {%- endif %} + {%- endif %} - enable: True - watch: - file: docker-software-daemon-file-managed-daemon_file - {%- if grains.kernel|lower == 'linux' %} + {%- if grains.kernel|lower == 'linux' %} docker-software-service-running-docker-fail-notify: test.fail_without_changes: @@ -69,7 +69,7 @@ docker-software-service-running-docker-fail-notify: - onfail: - service: docker-software-service-running-docker - {%- if d.misc.firewall and d.pkg.docker.firewall.ports %} + {%- if d.misc.firewall and d.pkg.docker.firewall.ports %} docker-software-service-running-docker: service.running: @@ -80,6 +80,6 @@ docker-software-service-running-docker: - require: - service: docker-software-service-running-docker - {%- endif %} {%- endif %} {%- endif %} +{%- endif %} diff --git a/docker/swarm/create_service.sls b/docker/swarm/create_service.sls index ceac6682..f4bec14f 100644 --- a/docker/swarm/create_service.sls +++ b/docker/swarm/create_service.sls @@ -4,12 +4,12 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'service_create' in d.swarm and d.swarm.service_create is mapping %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} +{%- if 'service_create' in d.swarm and d.swarm.service_create is mapping %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} docker-swarm-service_create: module.run: - name: swarm.service_create {{- format_kwargs(d.swarm.service_create) }} - {%- endif %} +{%- endif %} diff --git a/docker/swarm/joinswarm.sls b/docker/swarm/joinswarm.sls index e0baff28..a0c64ae5 100644 --- a/docker/swarm/joinswarm.sls +++ b/docker/swarm/joinswarm.sls @@ -4,12 +4,12 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'joinswarm' in d.swarm and d.swarm.joinswarm is mapping %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} +{%- if 'joinswarm' in d.swarm and d.swarm.joinswarm is mapping %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} docker-swarm-joinswarm: module.run: - name: swarm.joinswarm {{- format_kwargs(d.swarm.joinswarm) }} - {%- endif %} +{%- endif %} diff --git a/docker/swarm/leaveswarm.sls b/docker/swarm/leaveswarm.sls index 95bd7d54..72cde406 100644 --- a/docker/swarm/leaveswarm.sls +++ b/docker/swarm/leaveswarm.sls @@ -4,11 +4,11 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'leave_swarm' in d.swarm and d.swarm.leave_swarm %} +{%- if 'leave_swarm' in d.swarm and d.swarm.leave_swarm %} docker-swarm-leave_swarm: module.run: - name: swarm.leave_swarm - force: true - {%- endif %} +{%- endif %} diff --git a/docker/swarm/node_ls.sls b/docker/swarm/node_ls.sls index e46ad03d..0314abe9 100644 --- a/docker/swarm/node_ls.sls +++ b/docker/swarm/node_ls.sls @@ -4,12 +4,12 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'node_ls' in d.swarm and d.swarm.node_ls is mapping %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} +{%- if 'node_ls' in d.swarm and d.swarm.node_ls is mapping %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} docker-swarm-node_ls: module.run: - name: swarm.node_ls {{- format_kwargs(d.swarm.node_ls) }} - {%- endif %} +{%- endif %} diff --git a/docker/swarm/remove_node.sls b/docker/swarm/remove_node.sls index 6f3adb7d..d66e71ea 100644 --- a/docker/swarm/remove_node.sls +++ b/docker/swarm/remove_node.sls @@ -4,12 +4,12 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'remove_node' in d.swarm and d.swarm.remove_node is mapping %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} +{%- if 'remove_node' in d.swarm and d.swarm.remove_node is mapping %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} docker-swarm-remove_node: module.run: - name: swarm.remove_node {{- format_kwargs(d.swarm.remove_node) }} - {%- endif %} +{%- endif %} diff --git a/docker/swarm/remove_service.sls b/docker/swarm/remove_service.sls index ed47cc67..1684351a 100644 --- a/docker/swarm/remove_service.sls +++ b/docker/swarm/remove_service.sls @@ -4,12 +4,12 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'remove_service' in d.swarm and d.swarm.remove_service is mapping %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} +{%- if 'remove_service' in d.swarm and d.swarm.remove_service is mapping %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} docker-swarm-remove_service: module.run: - name: swarm.remove_service {{- format_kwargs(d.swarm.remove_service) }} - {%- endif %} +{%- endif %} diff --git a/docker/swarm/swarm_init.sls b/docker/swarm/swarm_init.sls index 668474c6..7446a10f 100644 --- a/docker/swarm/swarm_init.sls +++ b/docker/swarm/swarm_init.sls @@ -4,12 +4,12 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'swarm_init' in d.swarm and d.swarm.swarm_init is mapping %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} +{%- if 'swarm_init' in d.swarm and d.swarm.swarm_init is mapping %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} docker-swarm-swarm_init: module.run: - name: swarm.swarm_init {{- format_kwargs(d.swarm.swarm_init) }} - {%- endif %} +{%- endif %} diff --git a/docker/swarm/swarm_service_info.sls b/docker/swarm/swarm_service_info.sls index 48dd3f00..9c0f6ed6 100644 --- a/docker/swarm/swarm_service_info.sls +++ b/docker/swarm/swarm_service_info.sls @@ -4,12 +4,12 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'swarm_service_info' in d.swarm and d.swarm.swarm_service_info is mapping %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} +{%- if 'swarm_service_info' in d.swarm and d.swarm.swarm_service_info is mapping %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} docker-swarm-swarm_service_info: module.run: - name: swarm.swarm_service_info {{- format_kwargs(d.swarm.swarm_service_info) }} - {%- endif %} +{%- endif %} diff --git a/docker/swarm/swarm_tokens.sls b/docker/swarm/swarm_tokens.sls index ac06d627..b3e3b5ae 100644 --- a/docker/swarm/swarm_tokens.sls +++ b/docker/swarm/swarm_tokens.sls @@ -4,10 +4,10 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'swarm_tokens' in d.swarm and d.swarm.swarm_tokens %} +{%- if 'swarm_tokens' in d.swarm and d.swarm.swarm_tokens %} docker-swarm-swarm_tokens: module.run: - name: swarm.swarm_tokens - {%- endif %} +{%- endif %} diff --git a/docker/swarm/update_node.sls b/docker/swarm/update_node.sls index 53c0b7fb..382766e3 100644 --- a/docker/swarm/update_node.sls +++ b/docker/swarm/update_node.sls @@ -4,12 +4,12 @@ {%- set tplroot = tpldir.split('/')[0] %} {%- from tplroot ~ "/map.jinja" import data as d with context %} - {%- if 'update_node' in d.swarm and d.swarm.update_node is mapping %} - {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} +{%- if 'update_node' in d.swarm and d.swarm.update_node is mapping %} + {%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %} docker-swarm-update_node: module.run: - name: swarm.update_node {{- format_kwargs(d.swarm.update_node) }} - {%- endif %} +{%- endif %}