From 919ece6d95faf02007259471b5747af1d08e6f80 Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 7 Apr 2019 17:07:15 +0200 Subject: [PATCH] Add user --- README.md | 3 +++ defaults/main.yml | 1 + tasks/main.yml | 10 +++++----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index adc41fd..a492aad 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,9 @@ Role Variables i3_applications: [] +*ansible user* +i3wm_user: "{{ user }}" + Example Playbook ---------------- diff --git a/defaults/main.yml b/defaults/main.yml index 1d7d1c3..9accb71 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -37,3 +37,4 @@ i3_desktop_env: i3_packages_extra: - ranger +i3wm_user: "{{ user }}" diff --git a/tasks/main.yml b/tasks/main.yml index dbe7182..9141e8a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -18,17 +18,17 @@ # create i3 config file - name: Creates directory file: - path: '/home/{{ ansible_user }}/.config' + path: '/home/{{ iw3m_user }}/.config' state: directory mode: 0750 - owner: "{{ ansible_user }}" + owner: "{{ iw3m_user }}" - name: create i3 config folder file: - path: '/home/{{ ansible_user }}/.config/i3/' + path: '/home/{{ iw3m_user }}/.config/i3/' state: directory mode: 0755 - owner: "{{ ansible_user }}" + owner: "{{ iw3m_user }}" - name: register i3 config file action: stat path="~/.config/i3/config" @@ -46,7 +46,7 @@ - name: create i3 config file template: src: config.j2 - dest: "/home/{{ ansible_user }}/.config/i3/config" + dest: "/home/{{ iw3m_user }}/.config/i3/config" - name: check i3 config file command: i3 -C