[오타 발생한 run.sh 파일]
#!/bin/bash
CURRENT_PID=$(pgrep -f wheet-core)
echo "$CURRENT_PID"
if [ -z $CURRENT_PID ]; then
echo "> No process"
else
echo "> kill -15 $CURRENT_PID"
kill -15 $CURRENT_PID
sleep 5
fi
chmod +x /usr/local/wheet-core-back/wheet-core.jar
nohup java -Xmx5512m -Xms5512m -XX:+UseParallelGC -jar -Dspring.profiles.active=wheet_sre /usr/local/wheet-core-back/wheet-core.jar &
run.sh 이 실행되어 오류가 발생한 상황
[Before]
[Inventory]
wheet-core1 ansible_host=172.22.3.109 ansible_ssh_pass=3w@@kWelcom ansible_user=ec2-user
[core-server]
wheet-core1
[api-core-edit-run-playbook.yml]
- name: update run.sh and execute
hosts: core-servers
tasks:
- replace:
path: /usr/local/wheet-core-back/run.sh
regexp: 'nohup java -Xmx5512m -Xms5512m'
replace: 'nohup java -Xmx512m -Xms512m'
- name: execute run.sh
shell: ./run.sh
args:
chdir: /usr/local/wheet-core-back
[Execution]
ansible-playbook api-core-edit-run-playbook.yml -i inventory
[After]