0
나는 호스트에서 바람둥이를 다운로드하고 시작할 수있는 게임 플레이 북을 작업 해왔다.가능 - 호스트에서 시작 바람둥이
---
ansible_ssh_user: user
ansible_ssh_pass: pass
ansible_sudo_pass: passp
내 각본은 다음과 같습니다 :
---
- hosts: group1
sudo: yes
tasks:
- name: Update all packages to the latest version
apt:
upgrade: dist
- name: Download tomcat
get_url: url=http://mirrors.up.pt/pub/apache/tomcat/tomcat-9/v9.0.1/bin/apache-tomcat-9.0.1-fulldocs.tar.gz dest=/opt/apache-tomcat-9.0.1.tar.gz
- name: Unarchive a file that is already on the remote machine
unarchive:
src: /opt/apache-tomcat-9.0.1.tar.gz
dest: /opt/
remote_src: yes
- name: Run Tomcat
shell: ./startup.sh
args:
chdir: /opt/apache-tomcat-9.0.1/bin
내가 실행하려고 내 group_vars에서 group1.yml 파일이
[group1]
machine1 ansible_host=10.40.0.168
:
이
내 재고 호스트 파일입니다./startup.sh
in
/opt/apache-tomcat-9.0.1/bin
폴더를 열면 tomcat이 시작됩니다. 나는 그것이 잘 작동 호스트 시스템에
./startup.sh
를 실행하면
ansible-playbook playbookname.yml
,하지만 난 제어 시스템에서 실행할 때 얻을 :
나는 다음과 같은 명령을 실행
PLAY [group1] **********************************************************************************************************
TASK [Gathering Facts] *************************************************************************************************
ok: [myname]
TASK [Update all packages to the latest version] ***********************************************************************
ok: [myname]
TASK [Download tomcat] *************************************************************************************************
ok: [myname]
TASK [Unarchive a file that is already on the remote machine] **********************************************************
ok: [myname]
TASK [Run Tomcat] ******************************************************************************************************
changed: [myname]
PLAY RECAP *************************************************************************************************************
myname : ok=5 changed=1 unreachable=0 failed=0
를 이후 나는 바람둥이를 열려고하지만, 그것은 호스트에서 실행되지 않습니다.
어떻게 할 수 있습니까?