mirror of
https://github.com/roles-ansible/ansible_role_i3wm.git
synced 2024-08-16 10:09:53 +02:00
Add rhel support
This commit is contained in:
parent
2aa70d66fb
commit
e32cf88125
3 changed files with 22 additions and 5 deletions
|
@ -2,11 +2,22 @@
|
|||
# register variables
|
||||
- import_tasks: variables.yml
|
||||
|
||||
# ensure i3 packages are installed.
|
||||
# ensure i3 packages are installed [Debian].
|
||||
- include_tasks: setup-Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
# ensure i3 packages are installed [RHEL].
|
||||
- include_tasks: setup-RedHat.yml
|
||||
when: ansible_os_family == 'Fedora' or ansible_os_family == 'RedHat'
|
||||
|
||||
# create i3 config file
|
||||
- name: Creates directory
|
||||
file:
|
||||
path: '~/.config/i3'
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ ansible_user }}"
|
||||
|
||||
- name: create i3 config folder
|
||||
file:
|
||||
path: ~/.config/i3/
|
||||
|
@ -16,7 +27,6 @@
|
|||
- name: register i3 config file
|
||||
action: stat path="~/.config/i3/config"
|
||||
register: "config_file"
|
||||
|
||||
- name: backup i3 config file
|
||||
block:
|
||||
|
||||
|
@ -26,10 +36,12 @@
|
|||
dest: ~/.config/i3/config.bak
|
||||
remote_src: true
|
||||
when: config_file.stat.exists
|
||||
|
||||
- name: create i3 config file
|
||||
template:
|
||||
src: config.j2
|
||||
dest: ~/.config/i3/config
|
||||
dest: "/home/{{ ansible_user }}/.config/i3/config"
|
||||
|
||||
- name: check i3 config file
|
||||
command: i3 -C
|
||||
register: check_config_response
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
---
|
||||
- name: ensure i3 packages are installed.
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
name: "{{ i3_packages }}"
|
||||
state: "present"
|
||||
with_items: "{{ i3_packages }}"
|
||||
become: true
|
||||
|
|
6
tasks/setup-RedHat.yml
Normal file
6
tasks/setup-RedHat.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: ensure i3 packages are installed.
|
||||
dnf:
|
||||
name: "{{ i3_packages }}"
|
||||
state: "latest"
|
||||
become: true
|
Loading…
Reference in a new issue