diff --git a/playbook/group_vars/all b/playbook/group_vars/all index 3cbac5ed2f7cd54a66bc4e90bba45765f39a2550..1a42c0df197a29f101b471f651d465663a9e7d2c 100644 --- a/playbook/group_vars/all +++ b/playbook/group_vars/all @@ -3,4 +3,7 @@ password_for_all_es_users: Kylinmanager13579! needSSL: true kibana_ssl_crt_file: /opt/kibana/config/certs/kibana-server/kibana-server.crt kibana_ssl_key_file: /opt/kibana/config/certs/kibana-server/kibana-server.key -kibana_elastic_ca_file: /opt/kibana/config/certs/kibana/elasticsearch-ca.pem \ No newline at end of file +kibana_elastic_ca_file: /opt/kibana/config/certs/kibana/elasticsearch-ca.pem +redis_password: "PilotGo13579!" +mysql_password: "PilotGo13579!" +pilotgo_config: /opt/PilotGo/server/config_server.yaml \ No newline at end of file diff --git a/playbook/host-multi-machine b/playbook/host-multi-machine index e39d92586980d758a3984ca7bc1c6fcd65e6ea19..8256666e06827f149f3ce377b2d9ee9e893e3428 100644 --- a/playbook/host-multi-machine +++ b/playbook/host-multi-machine @@ -1,11 +1,23 @@ [elasticsearch] -10.41.160.165 +1.1.1.1 [kibana] -10.41.160.165 +2.2.2.2 [fleet] -10.41.160.164 +3.3.3.3 [filebeat] -10.41.160.165 \ No newline at end of file +4.4.4.4 + +[pilotgo] +5.5.5.5 + +[pilotgo-agent] +5.5.6.6 + +[elk] +6.6.6.6 + +[elk-agent] +6.6.7.7 \ No newline at end of file diff --git a/playbook/multi-machine.yml b/playbook/multi-machine.yml index b8fd15ebbd83594558d53bfb1f78e82b7b6079c1..853212fc5a7df5d7d7509cb4e6df95a2380bd81a 100644 --- a/playbook/multi-machine.yml +++ b/playbook/multi-machine.yml @@ -120,3 +120,10 @@ roles: - filebeat + +- name: pilotgo install + hosts: pilotgo + remote_user: root + + roles: + - pilotgo \ No newline at end of file diff --git a/playbook/roles/pilotgo/tasks/main.yml b/playbook/roles/pilotgo/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..0f205e2c21ad40409c6aae64b915d3c4078e24c2 --- /dev/null +++ b/playbook/roles/pilotgo/tasks/main.yml @@ -0,0 +1,13 @@ +--- +- name: install pilotgo-server + dnf: + name: PilotGo-server + state: present + register: pilotgo_info + ignore_errors: yes +- name: exit when pilotgo-server fail install + fail: + msg: 'dnf install PilotGo-server failed' + when: pilotgo_info.rc != 0 +- name: change PilotGo config + template: src=templates/pilotgo/config_server.yaml.j2 dest={{ pilotgo_config }} \ No newline at end of file diff --git a/playbook/standalone.yml b/playbook/standalone.yml index eb5096433b52271c3cce308a8fb19ccb89c5cd4b..d32ff4759e99644d8378b7d1d3a539dee88ff07b 100644 --- a/playbook/standalone.yml +++ b/playbook/standalone.yml @@ -3,6 +3,7 @@ remote_user: root roles: + - pilotgo - elasticsearch - kibana - fleet diff --git a/playbook/templates/pilotgo/config_server.yaml.j2 b/playbook/templates/pilotgo/config_server.yaml.j2 new file mode 100755 index 0000000000000000000000000000000000000000..b852c53fccfff44636fbd31eb7423ca8ec506fae --- /dev/null +++ b/playbook/templates/pilotgo/config_server.yaml.j2 @@ -0,0 +1,51 @@ +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: + {% if groups | length == 1 %} + + host_name: {{ groups['standalone'][0] }} + {% else %} + + host_name: {{ groups['mysql'][0] }} + {% endif %} + # this is the username of database + user_name: root + password: "{{ mysql_password }}" + data_base: PilotGo + port: 3306 +redis: + {% if groups | length == 1 %} + + redis_conn: {{ groups['standalone'][0] }}:6379 + {% else %} + + redis_conn: {{ groups['redis'][0] }}:6379 + {% endif %} + use_tls: false + redis_pwd: "{{ redis_password }}" + defaultDB: 0 + # redis连接超时时间.默认5s + dialTimeout: 5s + # 是否启用redis + enableRedis: true +storage: + # 文件服务存储路径 + path: "/opt/PilotGo/server/resource"