diff --git a/playbook.yml b/playbook.yml index 971167b..3efbe16 100644 --- a/playbook.yml +++ b/playbook.yml @@ -1,5 +1,67 @@ --- -- hosts: all +- name: Get host dependent variables + hosts: all + tasks: + + - name: Load host relative variables + ansible.builtin.include_vars: + dir: 'vars/{{ ansible_hostname}}' + + - name: Merge Sway output variable + ansible.builtin.set_fact: + sway_outputs: '{{ local_sway_outputs | + community.general.lists_mergeby(sway_outputs, "id") }}' + when: local_sway_outputs is defined + + - name: Merge Sway output variable + ansible.builtin.set_fact: + sway_inputs: '{{ local_sway_inputs | + community.general.lists_mergeby(sway_outputs, "name" ) }' + when: local_sway_input is defined + + - name: Merge Kanshi profiles variable + ansible.builtin.set_fact: + sway_outputs: '{{ local_kanshi_profiles | + community.general.lists_mergeby(kanshi_profiles, "profile") }}' + when: local_kanshi_profiles is defined + +- name: Install CLI stuff + hosts: all + tasks: + + - name: Install packages + ansible.builtin.package: + pkg: + - zsh + - pass + - vifm + - cmus + state: present + become: true + + - name: Copy ZSH files + ansible.builtin.copy: + src: '{{ item }}' + dest: '{{ ansible_user_dir }}' + mode: 0640 + loop: + - zsh/.zshrc + - zsh/.zprofile + + - name: Copy cmus files + ansible.builtin.copy: + src: cmus/ + dest: '{{ ansible_user_dir }}/.config/cmus/' + mode: 0640 + + - name: copy vifm config + ansible.builtin.copy: + src: vifm/ + dest: '{{ ansible_user_dir }}/.config/vifm/' + mode: 0640 + +- name: Launch roles + hosts: all roles: - ansible-sshagentd - ansible-sway