0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

isucon練習記録3

Last updated at Posted at 2025-02-13

状況

dockerコンテナ削除するたびに less などが使えなくなるのが面倒

対策

ansibleでミドルウェア管理するようにする

手順

1. ローカルへのansibleインストール

基本方針:公式通りに進める

1-1. pythonコマンド事前準備

  1. python --version すると zsh: command not found: python となる
  2. brew install python すると Warning: python@3.13 3.13.2 is already installed and up-to-date. となるのでパス通っていない
  3. brew reinstall python@3.13 するとインストール成功
  4. brew info python@3.13 すると
    Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
    `python3`, `python3-config`, `pip3` etc., respectively, are installed into
      /opt/homebrew/opt/python@3.13/libexec/bin
    
    となっているのでここにパスを通す
  5. vi ~/.zshrcexport PATH="/opt/homebrew/opt/python@3.13/libexec/bin:$PATH" 追記
  6. source ~/.zshrc
  7. python --versionPython 3.13.2 表示されるようになった

1-2. pipコマンド確認

  1. pip --version とやると pip 25.0 from /opt/homebrew/lib/python3.13/site-packages/pip (python 3.13) になる

1-3. ansibleインストール

  1. 公式通り pip install --user ansible とやると error: externally-managed-environment になって仮想環境用意しろと言われるので諦める
  2. brew install ansible
  3. ansible --version が使えるようになったので入った

2. playbook作成

ansible_connection=docker にすることでsshを使わずに接続する

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?