Skip to content

Latest commit

 

History

History
45 lines (43 loc) · 966 Bytes

README.md

File metadata and controls

45 lines (43 loc) · 966 Bytes

docker-ansible

ディレクトリ構成

.
├── README.md
├── docker
│   ├── ansible
│   │   └── Dockerfile      ansibleのDocerfile
│   └── target
│       └── Dockerfile      targetのDockerfile
├── docker-compose.yml      docker-composeファイル
├── inventry.ini            hostsファイル
└── playbook.yml            playbookファイル

使い方

  1. Dockerコンテナの起動
docker-compose up -d
  1. Ansibleコンテナに接続
docker exec -it ansible sh
  1. target01, target02に対し、sshの接続確認
ssh target01    # yesで接続
exit
ssh target02    # yesで接続
exit
  1. target01, target02に対し、ansibleコマンドを実行
ansible-playbook -i inventry.ini playbook.yml
  1. target01, target02に再接続し、hogeが追加されていることを確認
ssh target01
ls
exit
ssh target02
ls

setup_web_arch