<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>akira6592</author_name>
  <author_url>https://blog.hatena.ne.jp/akira6592/</author_url>
  <blog_title>てくなべ</blog_title>
  <blog_url>https://tekunabe.hatenablog.jp/</blog_url>
  <categories>
    <anon>ansible</anon>
    <anon>jinja2</anon>
  </categories>
  <description>はじめに ~ は、文字列を連結する演算子です。 文字列の連結というと + でいいのでは？と思った方もいるかも知れません。（私もそうでした） + の場合は、型によって挙動が異なります（数字の場合は足し算）。 一方で ~ は、数字が与えられても文字列にキャストして連結する動きになります。 この記事ではかんたんなサンプルをご紹介します。 動作環境 Ansible 2.9.9 Jinja2 2.11.2 サンプル --- - hosts: localhost gather_facts: false tasks: - name: debug: msg: &quot;{{ 123 ~ 456 }}&quot; 文字列として …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftekunabe.hatenablog.jp%2Fentry%2F2020%2F09%2F01%2Fansible_jinja2_concat_string&quot; title=&quot; [Ansible] 文字列にキャストして連結する演算子 ~ - てくなべ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-09-01 22:28:57</published>
  <title> [Ansible] 文字列にキャストして連結する演算子 ~</title>
  <type>rich</type>
  <url>https://tekunabe.hatenablog.jp/entry/2020/09/01/ansible_jinja2_concat_string</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
