使用ansible 编译并部署 fluent-bit 请注意 需要部署的主机上没有依赖软件与编译软件需要使用 管理主机上的 fluent-bit软件包 使用yum安装依赖以cmake3 作为编译器 烦请列出两种代码示例
时间: 2024-05-19 21:15:38 浏览: 150
示例1:
- name: Install dependencies
yum:
name:
- gcc
- gcc-c++
- cmake3
state: present
- name: Copy fluent-bit package to remote host
copy:
src: /path/to/fluent-bit.rpm
dest: /tmp/fluent-bit.rpm
- name: Install fluent-bit package
yum:
name: /tmp/fluent-bit.rpm
state: present
- name: Compile fluent-bit from source
shell: |
cd /path/to/fluent-bit/source
cmake3 .
make
make install
示例2:
- name: Install dependencies
yum:
name:
- gcc
- gcc-c++
- cmake3
state: present
- name: Copy fluent-bit source code to remote host
copy:
src: /path/to/fluent-bit/source
dest: /tmp/fluent-bit
- name: Compile fluent-bit from source
shell: |
cd /tmp/fluent-bit
cmake3 .
make
make install
阅读全文