<?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>
  </categories>
  <description>■ はじめに ファイルの内容や変数に改行が含まれている場合、1行ごとにリストにしてループなどの処理をしたい場合があります。そんなときに利用できるのが、 splitlines() です。split() が引数で指定した文字で分割するのに対して、splitlines() は改行で分割します。 Python をご存知の方であれば、str.splitlines()をイメージしていただけるとわかりやすいと思います。 この記事では簡単な例をもとに使い方をご紹介します。 動作確認環境: Ansible 2.3.0, 2.7.8 準備 読み込む利用するテキストファイル 今回は、以下のテキストファイルを利用しま…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftekunabe.hatenablog.jp%2Fentry%2F2019%2F03%2F29%2Fansible_splitlines&quot; title=&quot; [Ansible] ファイルや変数内の改行ごとに分割してリストにする splitlines() の使い方 - てくなべ&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>https://cdn-ak.f.st-hatena.com/images/fotolife/a/akira6592/20170902/20170902221811.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-03-29 10:18:14</published>
  <title> [Ansible] ファイルや変数内の改行ごとに分割してリストにする splitlines() の使い方</title>
  <type>rich</type>
  <url>https://tekunabe.hatenablog.jp/entry/2019/03/29/ansible_splitlines</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
