This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tsg-tsg-os-buildimage/ansible/roles/exporter/tasks/main.yml
songyanchao b6ecdf3b72 🎈 perf(TSG-9140): 移除ipmi-exporter软件
移除TSG-9140设备中ipmi-exporter软件安装步骤
2021-07-29 13:22:47 +08:00

110 lines
3.1 KiB
YAML

- name: "Install freeipmi rpm package"
yum:
name: freeipmi
conf_file: "{{ rpm_repo_config_path }}"
state: latest
- name: "mkdir /opt/exporter/"
file:
path: /opt/exporter/
state: directory
- name: "copy node_exporter"
copy:
src: '{{ role_path }}/files/node_exporter'
dest: /opt/exporter/node_exporter
mode: 0755
- name: "copy systemd_exporter"
copy:
src: '{{ role_path }}/files/systemd_exporter'
dest: /opt/exporter/systemd_exporter
mode: 0755
- name: "copy ipmi_exporter"
copy:
src: '{{ role_path }}/files/ipmi_exporter'
dest: /opt/exporter/ipmi_exporter
mode: 0755
when: PROFILE_ID != '9000-NPB-P01R01'
- name: "templates atca-exporter-node.service"
template:
src: "{{role_path}}/templates/exporter-node.service.j2"
dest: /usr/lib/systemd/system/exporter-node.service
tags: template
- name: "templates atca-exporter-systemd.service"
template:
src: "{{role_path}}/templates/exporter-systemd.service.j2"
dest: /usr/lib/systemd/system/exporter-systemd.service
tags: template
- name: "templates atca-exporter-ipmi.service"
template:
src: "{{role_path}}/templates/exporter-ipmi.service.j2"
dest: /usr/lib/systemd/system/exporter-ipmi.service
tags: template
when: PROFILE_ID != '9000-NPB-P01R01'
- name: "Create /usr/lib/systemd/system/exporter-node.service.d directory if it does not exist"
file:
path: "{{ item }}"
state: directory
mode: '0755'
with_items:
- /usr/lib/systemd/system/exporter-node.service.d
- name: "Create /usr/lib/systemd/system/exporter-systemd.service.d directory if it does not exist"
file:
path: "{{ item }}"
state: directory
mode: '0755'
with_items:
- /usr/lib/systemd/system/exporter-systemd.service.d
- name: "Create /usr/lib/systemd/system/exporter-ipmi.service.d directory if it does not exist"
file:
path: "{{ item }}"
state: directory
mode: '0755'
with_items:
- /usr/lib/systemd/system/exporter-ipmi.service.d
when: PROFILE_ID != '9000-NPB-P01R01'
- name: "copy slice file to exporter-node.service.d"
copy:
src: "{{ role_path }}/templates/service_override_slice.conf.j2"
dest: /usr/lib/systemd/system/exporter-node.service.d/service_override_slice.conf
mode: 0644
- name: "copy slice file to exporter-systemd.service.d"
copy:
src: "{{ role_path }}/templates/service_override_slice.conf.j2"
dest: /usr/lib/systemd/system/exporter-systemd.service.d/service_override_slice.conf
mode: 0644
- name: "copy slice file to exporter-ipmi.service.d"
copy:
src: "{{ role_path }}/templates/service_override_slice.conf.j2"
dest: /usr/lib/systemd/system/exporter-ipmi.service.d/service_override_slice.conf
mode: 0644
when: PROFILE_ID != '9000-NPB-P01R01'
##################### exporter #####################
- name: 'exporter-node service start'
systemd:
name: exporter-node
enabled: yes
- name: 'exporter-systemd service start'
systemd:
name: exporter-systemd
enabled: yes
- name: 'exporter-ipmi service start'
systemd:
name: exporter-ipmi
enabled: yes
when: PROFILE_ID != '9000-NPB-P01R01'