Skip to content

Commit

Permalink
improve ansible workflow for more than one devices
Browse files Browse the repository at this point in the history
  • Loading branch information
DO1JLR committed Apr 24, 2019
1 parent e853e36 commit 5f57bce
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
2 changes: 2 additions & 0 deletions host_vars/desk_minni.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ accounts:
- lilian

akku_user: "lilian"

copy_to_user: "{{ akku_user }}"
4 changes: 4 additions & 0 deletions host_vars/l460.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ admins_ssh_root_prefix:

accounts:
- lilian

akku_user: "lilian"

copy_to_user: "{{ akku_user }}"
2 changes: 2 additions & 0 deletions host_vars/t460p.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ accounts:
- l3d

akku_user: "l3d"

copy_to_user: "{{ akku_user }}"
2 changes: 2 additions & 0 deletions roles/copy_files/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
copy_to_user: "{{ ansible_user_id }}"
6 changes: 3 additions & 3 deletions roles/copy_files/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: 'files/background.png', dest: "/home/{{ user }}/.config/background.png" }
- { src: 'files/lockscreen.png', dest: '/home/{{ user }}/.config/lockscreen.png' }
- { src: 'files/xinitrc', dest: '/home/{{ user }}/.xinitrc' }
- { src: 'files/background.png', dest: "/home/{{ copy_to_user }}/.config/background.png" }
- { src: 'files/lockscreen.png', dest: '/home/{{ copy_to_user }}/.config/lockscreen.png' }
- { src: 'files/xinitrc', dest: '/home/{{ copy_to_user }}/.xinitrc' }

2 changes: 1 addition & 1 deletion roles/i3wm
Submodule i3wm updated from a70923 to 612f33
4 changes: 2 additions & 2 deletions roles/networkmanager/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
dnf:
name: NetworkManager
state: present
when: ansible_distribution == Fedora
when: ansible_distribution == 'Fedora'

- name: install NetworkManager
become: yes
apt:
name: networkmanager
state: present
when: ansible_os_family == Debian
when: ansible_os_family == 'Debian'

- name: install needed packages for NetworkManager
become: yes
Expand Down

0 comments on commit 5f57bce

Please sign in to comment.