Add RedHat support to system-info role
This commit is contained in:
parent
891a5dc800
commit
4c2ae6f772
@ -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
|
||||
|
28
roles/system-info/tasks/Linux.yaml
Normal file
28
roles/system-info/tasks/Linux.yaml
Normal 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
|
9
roles/system-info/tasks/RedHat.yaml
Normal file
9
roles/system-info/tasks/RedHat.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: install yum packages
|
||||
become: true
|
||||
yum:
|
||||
name:
|
||||
- sysstat
|
||||
state: latest
|
||||
|
||||
- include_tasks: Linux.yaml
|
Loading…
x
Reference in New Issue
Block a user