Add RedHat support to system-info role

This commit is contained in:
Kenneth Benzie 2023-05-31 21:47:44 +01:00
parent 891a5dc800
commit 4c2ae6f772
3 changed files with 38 additions and 27 deletions

View File

@ -7,30 +7,4 @@
- sysstat
state: latest
- name: create systemd user unit directory
file:
state: directory
dest: ~/.config/systemd/user
- set_fact:
SYSTEM_INFO_SCRIPT_DIR: '{{ansible_env.HOME}}/.config/tmux/system-info'
- when: '"WSL" not in ansible_kernel'
set_fact:
SYSTEM_INFO_SCRIPT: '{{SYSTEM_INFO_SCRIPT_DIR}}/system-info-Linux.sh'
- when: '"WSL" in ansible_kernel'
set_fact:
SYSTEM_INFO_SCRIPT: '{{SYSTEM_INFO_SCRIPT_DIR}}/system-info-WSL.sh'
- name: install system-info systemd unit
template:
src: templates/system-info.service.j2
dest: ~/.config/systemd/user/system-info.service
notify: restart system-info
- name: enable system-info service
systemd:
name: system-info
scope: user
enabled: true
state: started
- include_tasks: Linux.yaml

View File

@ -0,0 +1,28 @@
---
- name: create systemd user unit directory
file:
state: directory
dest: ~/.config/systemd/user
- set_fact:
SYSTEM_INFO_SCRIPT_DIR: '{{ansible_env.HOME}}/.config/tmux/system-info'
- when: '"WSL" not in ansible_kernel'
set_fact:
SYSTEM_INFO_SCRIPT: '{{SYSTEM_INFO_SCRIPT_DIR}}/system-info-Linux.sh'
- when: '"WSL" in ansible_kernel'
set_fact:
SYSTEM_INFO_SCRIPT: '{{SYSTEM_INFO_SCRIPT_DIR}}/system-info-WSL.sh'
- name: install system-info systemd unit
template:
src: templates/system-info.service.j2
dest: ~/.config/systemd/user/system-info.service
notify: restart system-info
- name: enable system-info service
systemd:
name: system-info
scope: user
enabled: true
state: started

View File

@ -0,0 +1,9 @@
---
- name: install yum packages
become: true
yum:
name:
- sysstat
state: latest
- include_tasks: Linux.yaml