かりっと揚げたらフライドポテト

㍋出る迄頑張るぞい

ansibleのexpectモジュールについて

  • expectモジュールとは
    ansibleのexpectモジュールは、commandモジュールを使用したときの対話を自動化してくれるモジュールだ。
    expect - Executes a command and responds to prompts — Ansible Documentation
    Requirementsは
    python 2.6以上
    ・pexpect 3.3以上
    となっている。pexpectとはpythonが提供するモジュールで、expectモジュールと同じような機能をもつ。
  • pexpectのインストール
    $wget 
    https://bootstrap.pypa.io/get-pip.py 
    $
     python get-pip.py
    $ pip install pexpect
    これでexpect moduleが成功するはず。
  • 注意
    commandに<>|などを使うときは、
    command: /bin/bash -c "本来実行したいcommand"
    のようにすることに注意。