48 lines
913 B
YAML
48 lines
913 B
YAML
---
|
|
- name: pip安装supervisor
|
|
shell:
|
|
chdir: ~
|
|
cmd: pip3 install supervisor==4.2.1
|
|
|
|
- name: supervisorctl 软连接
|
|
file:
|
|
src: /usr/local/python3/bin/supervisorctl
|
|
dest: /usr/bin/supervisorctl
|
|
state: link
|
|
|
|
- name: supervisord 软连接
|
|
file:
|
|
src: /usr/local/python3/bin/supervisord
|
|
dest: /usr/bin/supervisord
|
|
state: link
|
|
|
|
- name: 创建supervisord.d文件夹
|
|
file:
|
|
path: /etc/supervisord.d
|
|
state: directory
|
|
|
|
- name: 复制配置文件
|
|
copy:
|
|
src: supervisord.conf
|
|
dest: /etc/supervisord.conf
|
|
|
|
- name: 复制supervisord
|
|
copy:
|
|
src: supervisord
|
|
dest: /etc/init.d/supervisord
|
|
mode: '0777'
|
|
|
|
- name: chkconfig add supervisord
|
|
shell:
|
|
chdir: ~
|
|
cmd: chkconfig --add supervisord
|
|
|
|
- name: 开机自启动
|
|
shell:
|
|
chdir: ~
|
|
cmd: chkconfig supervisord on
|
|
|
|
- name: 启动服务
|
|
service:
|
|
name: supervisord
|
|
state: started |