2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

M1Macでもansible-playbookでcowsayしたい

Last updated at Posted at 2022-07-13

チームでAnsible勉強中、僕の牛だけずっと鳴いてくれなかったので、なんとしても解決したかった

原因

  • M1Macが私だけだったこと

原因の詳細

  • M1の場合brewでインストールされるパスが/usr/local/ではなく/opt/homebrew/配下になるので、Ansibleから見た時にcowsayはインストールされていないと扱われてしまう
/opt/homebrew/

解決策

  • ansibleがcowsayの存在を確認するpathを確認
# ansible/lib/ansible/utils/display.py 
b_COW_PATHS = (
    b"/usr/bin/cowsay",
    b"/usr/games/cowsay",
    b"/usr/local/bin/cowsay",  # BSD path for cowsay
    b"/opt/local/bin/cowsay",  # MacPorts path for cowsay
)

該当コード:

  • シンボリックリンクを作成
cd /usr/local/bin/
sudo ln -s /opt/homebrew/bin/cowsay cowsay

鳴いた(喜)

 ____________
< PLAY [all] >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

参考記事:
https://qiita.com/zaki-lknr/items/5de3f11389090f38bf6e

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?