<?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>はじめに Ansible で他のホストのホスト変数を参照、設定したりする方法ご紹介します。 ■ 他のホスト変数を参照する 他のホスト変数を参照するには hostvars を利用します。 Playbook サンプル Playbook です。 localhost、rt1 が実行対象で、rt1 のタスクの中で localhost のホスト変数 msg の値を参照します。 他のホスト変数を参照する --- - hosts: - rt1 - localhost gather_facts: false tasks: # 各ホストが自分のインベントリ名を含む msg1 をセット - name: (task1…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftekunabe.hatenablog.jp%2Fentry%2F2020%2F04%2F17%2Fansible_beyond_host_vars&quot; title=&quot; [Ansible] 他のホスト変数を参照、設定する（hostvars、delegate_to/delegate_facts） - てくなべ&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-17 21:05:31</published>
  <title> [Ansible] 他のホスト変数を参照、設定する（hostvars、delegate_to/delegate_facts）</title>
  <type>rich</type>
  <url>https://tekunabe.hatenablog.jp/entry/2020/04/17/ansible_beyond_host_vars</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
