Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.
/ docker-ansible Public archive
forked from hyonsoku/docker-ansible

Dockerを使ってAnsibleのテスト環境を構築 ( Ubuntu 20.04 )

Notifications You must be signed in to change notification settings

roppi/docker-ansible

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-ansible

ディレクトリ構成

.
├── README.md
├── ansible
│   ├── hosts
│   └── sample-playbook.yml
├── docker
│   ├── ansible
│   │   └── Dockerfile
│   └── target
│       └── Dockerfile
└── docker-compose.yml

使い方

  1. Dockerコンテナを起動します。
$ docker compose up -d
  1. Ansibleコンテナに接続します。
$ docker exec -it ansible-controller /bin/ash
  1. Playbookを実行します
# ansible-playbook -i hosts sample-playbook.yml
  1. 以下ように表示されれば、成功です。
# ansible-playbook -i hosts sample-playbook.yml 

PLAY [localhost] ***********************************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************************
ok: [localhost]

TASK [hello world] *********************************************************************************************************************
ok: [localhost] => {
    "msg": "Hello World!"
}

PLAY [all] *****************************************************************************************************************************

TASK [Gathering Facts] *****************************************************************************************************************
ok: [ansible-target]

TASK [yum update] **********************************************************************************************************************
ok: [ansible-target]

PLAY RECAP *****************************************************************************************************************************
ansible-target             : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
localhost                  : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

About

Dockerを使ってAnsibleのテスト環境を構築 ( Ubuntu 20.04 )

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%