<?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>はじめに Playbook を書いていて処理のかたまりをロール化したとき、一部の処理だけ変数で挙動を変えたいときはないでしょうか。この記事ではロールを引数ありの関数のように使う方法を紹介します。 Python でいうと以下のようなコードです。 greeting は、引数 msg を持つ msg のデフォルト値は Hello, Role! def greeting(msg=&quot;Hello, Role!&quot;): print(msg) greeting(msg=&quot;Good morning!&quot;) # Good morning! を出力 greeting() # Hello, Role! を出力 動作確認環…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftekunabe.hatenablog.jp%2Fentry%2F2020%2F04%2F11%2Fansible_funcrole&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>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>2020-04-11 11:43:40</published>
  <title> [Ansible] ロールを引数ありの関数のように使う</title>
  <type>rich</type>
  <url>https://tekunabe.hatenablog.jp/entry/2020/04/11/ansible_funcrole</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
