Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- kubernetes
- 용어정리
- 이론
- nodejs
- worker
- docker
- mysql
- Docker-compose
- 도커
- PaaS
- 실습
- network
- express
- dockerfile
- PAT
- 클라우드
- OpenStack
- node.js
- 개념
- Javascript
- Docker Swarm
- gns3
- RAID
- RAPA
- IaaS
- 명령어
- MongoDB
- git
- 쿠버네티스
- 네트워크
Archives
- Today
- Total
융융이'Blog
docker contianer에 ansible 세팅하기 본문
서버 환경 :
docker Version: 18.09.2
컨테이너 :
IMAGE => centos:7
3EA => 1EA : ansible controller(172.17.0.4) / 2EA : Client(172.17.0.2/172.17.0.3)
초기 세팅
#create container
docker run --privileged -d --name ansible_controller centos:7 init
docker run --privileged -d --name ansible_client1 centos:7 init
docker run --privileged -d --name ansible_client2 centos:7 init
#excute container
docker exec -it ansible_controller /bin/bash
docker exec -it ansible_client1 /bin/bash
docker exec -it ansible_client2 /bin/bash
ansible_controll 설치 및 세팅
docker
#controller
#도커 이미지는 아주 기본적인것만 설치되어 있기 때문에 ansible에 필요한 요소들을 설치해준다.
#ssh 접속에 필요한 패키지
yum install sudo net-tools openssh-server openssh-client -y
systemctl start sshd
netstat -lntp
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 509/sshd
tcp6 0 0 :::22 :::* LISTEN 509/sshd
#install ansible
yum install ansible -y
ansibe_client 설치 및 세팅
#client
yum install net-tools openssh-server openssh-client -y
systemctl start sshd
netstat -lntp
ansible controller to client
#client
adduser ansibleClient
vi /etc/sudoers
~~~
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
ansibleClient ALL=(ALL) ALL
~~~
#controller
ssh-keygen
ssh-copy-id ansibleClient@172.17.0.2
ssh-copy-id ansibleClient@172.17.0.3
TEST
ansible -u ansibleClinet
작성중
'2022이전 > Centos7' 카테고리의 다른 글
JDK 빠르게 설치하기 (0) | 2021.08.03 |
---|---|
라즈베리파이4에 centos7 설치 (0) | 2021.06.05 |