diff --git a/playbook/groups_vars/all b/playbook/groups_vars/all index 41df52fd461d6bcf5bd84486050b698154ae1279..4c738eb4385df9e96452c54f8abfcb8a52240477 100644 --- a/playbook/groups_vars/all +++ b/playbook/groups_vars/all @@ -4,6 +4,7 @@ mysql_password: "PilotGo13579!" redis_password: "PilotGo13579!" neo4j_username: neo4j neo4j_password: PilotGo13579! +pilotgo_config: /opt/PilotGo/server/config_server.yaml pilotgo_agent_config: /opt/PilotGo/agent/config_agent.yaml pilotgo_topo_config: /opt/PilotGo/plugin/topology/server/topo_server.yaml pilotgo_topo_agent_config: /opt/PilotGo/plugin/topology/agent/topo_agent.yaml \ No newline at end of file diff --git a/playbook/roles/pilotgo/tasks/main.yml b/playbook/roles/pilotgo/tasks/main.yml index 3917288159b3a20816a0af26298dffe13def5d2c..0f205e2c21ad40409c6aae64b915d3c4078e24c2 100644 --- a/playbook/roles/pilotgo/tasks/main.yml +++ b/playbook/roles/pilotgo/tasks/main.yml @@ -10,22 +10,4 @@ msg: 'dnf install PilotGo-server failed' when: pilotgo_info.rc != 0 - name: change PilotGo config - shell: sed -i '/^http_server:/,+1 s/0\.0\.0\.0/{{ groups['pilotgo'][0] }}/' /opt/PilotGo/server/config_server.yaml -- name: change PilotGo config - shell: sed -i '/^socket_server:/,+1 s/0\.0\.0\.0/{{ groups['pilotgo'][0] }}/' /opt/PilotGo/server/config_server.yaml -- name: change PilotGo config - shell: sed -i '/^mysql:/,+1 s/localhost/{{ groups['pilotgo'][0] }}/' /opt/PilotGo/server/config_server.yaml -- name: change passwd - lineinfile: - path: /opt/PilotGo/server/config_server.yaml - regexp: '^#?password' - line: ' password: {{ mysql_password }}' - backrefs: yes -- name: change PilotGo config - shell: sed -i '/^redis:/,+1 s/localhost/{{ groups['pilotgo'][0] }}/' /opt/PilotGo/server/config_server.yaml -- name: change passwd - lineinfile: - path: /opt/PilotGo/server/config_server.yaml - regexp: '^#?redis_pwd' - line: ' redis_pwd: {{ redis_password }}' - backrefs: yes \ No newline at end of file + template: src=templates/pilotgo/config_server.yaml.j2 dest={{ pilotgo_config }} \ No newline at end of file diff --git a/playbook/templates/pilotgo/config_server.yaml.j2 b/playbook/templates/pilotgo/config_server.yaml.j2 new file mode 100755 index 0000000000000000000000000000000000000000..48374a8dbfe1224cdcd2618954e6a864f9b59640 --- /dev/null +++ b/playbook/templates/pilotgo/config_server.yaml.j2 @@ -0,0 +1,39 @@ +http_server: + addr: 0.0.0.0:8888 + session_count: 100 + session_max_age: 1800 + # if true, will start pprof on :6060 + debug: false + use_https: false + cert_file: "" + key_file: "" +socket_server: + addr: 0.0.0.0:8879 +jwt: + secret_key: "" +log: + level: debug + # 可选stdout和file.stdout:输出到终端控制台;file:输出到path下的指定文件。 + driver: file + path: ./log/pilotgo_server.log + max_file: 1 + max_size: 10485760 +mysql: + host_name: {{ groups['mysql'][0] }} + # this is the username of database + user_name: root + password: "{{ mysql_password }}" + data_base: PilotGo + port: 3306 +redis: + redis_conn: {{ groups['redis'][0] }}:6379 + use_tls: false + redis_pwd: "{{ redis_password }}" + defaultDB: 0 + # redis连接超时时间.默认5s + dialTimeout: 5s + # 是否启用redis + enableRedis: true +storage: + # 文件服务存储路径 + path: "/opt/PilotGo/server/resource"