{
    "componentChunkName": "component---src-templates-blog-post-js",
    "path": "/2022-09-02_ansible_interpreter_warning/",
    "result": {"data":{"site":{"siteMetadata":{"title":"365"}},"markdownRemark":{"id":"2d387ddf-767f-5b8e-be89-2b28d14911bd","excerpt":"Ansible を実行すると下記のような警告が出力される Python のインタプリタを別でインストールすると意味が変わる可能性があるとのこと 対応方法  を追加する 明示的に Python のインタプリタを指定してあげる Ansible…","html":"<p>Ansible を実行すると下記のような警告が出力される<br>\nPython のインタプリタを別でインストールすると意味が変わる可能性があるとのこと</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"language-sh\"><code class=\"language-sh\">$ ansible-playbook -i hosts/localhost mac.yml\n\nPLAY [mac setup] ***************************************************************\n\nTASK [homebrew : homebrew install] *********************************************\nok: [127.0.0.1] =&gt; (item={&#39;name&#39;: &#39;jq&#39;, &#39;state&#39;: &#39;installed&#39;})\nok: [127.0.0.1] =&gt; (item={&#39;name&#39;: &#39;peco&#39;, &#39;state&#39;: &#39;installed&#39;})\n[WARNING]: Platform darwin on host 127.0.0.1 is using the discovered Python\ninterpreter at /usr/local/bin/python3.10, but future installation of another\nPython interpreter could change the meaning of that path. See\nhttps://docs.ansible.com/ansible-\ncore/2.13/reference_appendices/interpreter_discovery.html for more information.</code></pre></div>\n<h2>対応方法</h2>\n<p><code class=\"language-text\">ansible.cfg</code> を追加する<br>\n明示的に Python のインタプリタを指定してあげる<br>\nAnsible 実行時はここで指定したパスが使用される</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">[defaults]\ninterpreter_python=/usr/bin/python3</code></pre></div>\n<h2>確認</h2>\n<p>警告がでなくなったことを確認した</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"language-sh\"><code class=\"language-sh\">$ ansible-playbook -i hosts/localhost mac.yml\n\nPLAY [mac setup] ***************************************************************\n\nTASK [homebrew : homebrew install] *********************************************\nok: [127.0.0.1] =&gt; (item={&#39;name&#39;: &#39;jq&#39;, &#39;state&#39;: &#39;installed&#39;})\nok: [127.0.0.1] =&gt; (item={&#39;name&#39;: &#39;peco&#39;, &#39;state&#39;: &#39;installed&#39;})\n\nPLAY RECAP *********************************************************************\n127.0.0.1                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0</code></pre></div>\n<h2>参考</h2>\n<ul>\n<li><a href=\"https://dev.classmethod.jp/articles/ansible-interpreter-warning/\">[小ネタ] Pythonのバージョンを指定してAnsible実行時に表示される警告を消す | DevelopersIO</a></li>\n</ul>","frontmatter":{"title":"Ansible 実行時に warning が出力されるので対応する","date":"2022/09/02","description":"Ansible を実行すると下記のような警告が出力される"}},"previous":{"fields":{"slug":"/2022-09-01_change_git-init-default-branch/"},"frontmatter":{"title":"git init 時のデフォルトブランチを変更する"}},"next":{"fields":{"slug":"/2022-09-06_github-actions_schedule_utc/"},"frontmatter":{"title":"GitHub Actions の cron で指定できるスケジュールのタイムゾーンはUTC"}}},"pageContext":{"id":"2d387ddf-767f-5b8e-be89-2b28d14911bd","previousPostId":"d0751a99-1256-5fed-a5a3-be9422eb6889","nextPostId":"37cefc8d-db3f-5b0c-b799-34dee1d39ea0"}},
    "staticQueryHashes": ["2841359383","3257411868"]}