title: How do I append to each item in a list of strings?
body: <p>I have a list of strings containing IP addresses. I want to append a port number to each of them. In python I would do it something like this:</p>
  
  <pre><code>ip_list = [(ip + ":" + port) for ip in ip_list]
  </code></pre>
  
  <p>...but Jinja doesn't support list comprehensions. At the moment I'm kludging the problem by building a new list one item at a time:</p>
  
  <pre><code>{%- set ip_list = magic() %}
  {%- set new_ip_list = [] %}
  {%- for ip in ip_list %}
    {%- do new_ip_list.append(ip + ":" + port) %}
  {%- endfor %}
  </code></pre>
  
  <p>This is ugly and irritating in the middle of a template, and it feels like there should really be a better way to get the job done. Preferably a one-liner.</p>
  
  <p>While I know this can be done with custom filters, I'm supplying a template to software I did not write (saltstack), so they are (as far as I know) unavailable to me.</p>