<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Note - series - Sergey Chulanov&#39;s site</title>
        <link>https://dodcaf.ru/series/note/</link>
        <description>Note - series - Sergey Chulanov&#39;s site</description>
        <generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>tty8747@gmail.com (Sergey Chulanov)</managingEditor>
            <webMaster>tty8747@gmail.com (Sergey Chulanov)</webMaster><lastBuildDate>Sat, 31 Jul 2021 10:11:16 &#43;0300</lastBuildDate><atom:link href="https://dodcaf.ru/series/note/" rel="self" type="application/rss+xml" /><item>
    <title>Ansible. Заметка об использовании gather_facts.</title>
    <link>https://dodcaf.ru/ansible_print_all_facts/</link>
    <pubDate>Sat, 31 Jul 2021 10:11:16 &#43;0300</pubDate>
    <author>tty8747@gmail.com (Sergey Chulanov)</author>
    <guid>https://dodcaf.ru/ansible_print_all_facts/</guid>
    <description><![CDATA[<p>В <code>ansible</code> при запуске плейбука изначально выполняется модуль <code>ansible.builtin.setup</code>, который собирает факты о системе, где будет выполняться данный плейбук, если явно не указано <code>gather_facts: no</code>.
Все факты хранятся внутри переменной <code>ansible_facts</code>, выведем её:</p>
<div class="code-block code-line-numbers open" style="counter-reset: code-block 0">
    <div class="code-header language-bash">
        <button type="button" class="code-title" aria-label="Toggle code block"><i class="arrow fas fa-angle-right" aria-hidden="true"></i></button>
        <span class="ellipses" aria-hidden="true"><i class="fas fa-ellipsis-h" aria-hidden="true"></i></span>
        <button type="button" class="copy" aria-label="Copy code" title="Copy to clipboard"><i class="far fa-copy" aria-hidden="true"></i></button>
    </div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">- name: Print all available facts
</span></span><span class="line"><span class="cl">  debug:
</span></span><span class="line"><span class="cl">    var: ansible_facts</span></span></code></pre></div></div>
<p>Обычно это временная мера, чтобы подобрать переменные, для использования внутри <code>playbook</code>.  Основываясь на этом, можно получить <code>версию ОС</code> и <code>fqdn</code>:</p>]]></description>
</item>
</channel>
</rss>
