ansible-galaxyめも

いっつも忘れるので

  • foo-roleってディレクトリつくって、そこにansible-glaxy initする
    • cd foo-role
    • export ROLE_PATH=$(echo $(pwd) |awk 'BEGIN {FS="/";OFS="/"} {$NF="";print $0}');ansible-galaxy init foo-role e -f -p "$ROLE_PATH"
  • requirements.ymlに記述されているroleを手元のroleディレクトリに取ってきてinstall
    • ansible-galaxy install -f -r requirements.yml --roles-path=./roles