概要 Ansible入門として,Amazon Linuxイメージを展開したDockerコンテナ上にWordPress環境を構築するplaybookを作成する. また,ローカルでのDockerコンテナ生成からplaybook適用後のDocker Imageの生成までを,Packerを用いて一括して行うようにする. 今回はAWS上に展開することを想定して各種ファイルを作成したが,実際にWordpressをAWS上に展開する場合はAWS Marketplaceを利用した方が圧倒的に楽なのでそちらを使うべきだろう. Docker amazonlinuxイメージをpullしておく. テスト環境として, % docker run -i -t -d --name aws -p 3000:80 amazonlinux としてコンテナを生成し,ここに向けてansibleを実行する. Ansible 下準備