해결됨
Jenkins를 이용한 CI/CD Pipeline 구축
windows에서 ansible playbook으로 kubernetes script 실행하기가 안됩니다.
windows 에서 docker를 설치 해서 실습중입니다.세션4.Ansible playbook으로 Kubernetes Script 실행하기에서 막혀서 질문을 남깁니다.ansible에서 windows로 ping 하는 것은 성공했는데 ansible-playbook을 실행하는것은 되지 않습니다.제가 설정을 잘못 한게 있을까요?windows ping 설정[root@7a7d20fbb691 ~]# ansible windows -m win_ping
192.168.0.100 | SUCCESS => {
"changed": false,
"ping": "pong"
}2. k8s-cicd-deployment-playbook.ymlcommand를 win_command로 변경 [root@7a7d20fbb691 ~]# cat k8s-cicd-deployment-playbook.yml
- name: Create pods using deployment
hosts: kubernetes
# become: true
# user: ubuntu
tasks:
- name: delete the previous deployment
win_command: kubectl delete deployment.apps/cicd-deployment
- name: create a deployment
win_command: kubectl apply -f cicd-devops-deployment.ymlansible-playbook 실행[root@7a7d20fbb691 ~]# ansible-playbook -i ./k8s/hosts k8s-cicd-deployment-playbook.yml -u lsh
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
PLAY [Create pods using deployment] **************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************
fatal: [www.iptime.org]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: lsh@www.iptime.org: Permission denied (publickey,password,keyboard-interactive).", "unreachable": true}
PLAY RECAP ***************************************************************************************************************************
www.iptime.org : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0
[root@7a7d20fbb691 ~]# ansible-playbook -i ./k8s/hosts k8s-cicd-deployment-playbook.yml
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
PLAY [Create pods using deployment] **************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************
fatal: [www.iptime.org]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: root@www.iptime.org: Permission denied (publickey,password,keyboard-interactive).", "unreachable": true}
PLAY RECAP ***************************************************************************************************************************
www.iptime.org : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=04. /etc/ansible/hosts[devops]
172.17.0.3
172.17.0.4
[windows]
192.168.0.100
[windows:vars]
ansible_password='xxxx'
ansible_connection=winrm
ansible_winrm_server_cert_validation=ignore
ansible_user=lsh
ansible_port=5986