Skip to content

Instantly share code, notes, and snippets.

@agaffney
Created March 5, 2019 17:03
Show Gist options
  • Save agaffney/fe154d6045487c3019c48d6de6e7b179 to your computer and use it in GitHub Desktop.
Save agaffney/fe154d6045487c3019c48d6de6e7b179 to your computer and use it in GitHub Desktop.
- name: whatever
vars:
tmp_ports: |
- "20:20"
- "21:21"
{% for x in range(21100, 21111) %}
- "{{ x }}:{{ x }}"
{% endfor %}
docker_container:
...
exposed_ports: '{{ tmp_ports | from_yaml }}'
...
published_ports: '{{ tmp_ports | from_yaml }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment