1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_weechat.git synced 2024-08-16 13:09:48 +02:00
ansible_role_weechat/tasks/configure_plugins.yml

31 lines
1.1 KiB
YAML

---
- name: Create weechat directory
become: true
ansible.builtin.file:
path: "{{ weechat__home_directory }}/.weechat"
state: directory
owner: "{{ weechat__user }}"
mode: "0750"
- name: Create weechat plugins directory
become: true
ansible.builtin.file:
path: "{{ weechat__home_directory }}/.weechat/{{ item.value }}/autoload"
state: directory
owner: "{{ weechat__user }}"
mode: "0750"
with_dict: "{{ weechat_plugin_languages }}"
- name: Download weechat plugins
ansible.builtin.get_url:
url: 'https://weechat.org/files/scripts/{{ item }}'
dest: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.', 1)[-1]] }}/{{ item }}"
mode: '0644'
with_items: '{{ weechat__plugins }}'
- name: Symlinking plugins to autoload
ansible.builtin.file:
src: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.', 1)[-1]] }}/{{ item }}"
dest: "{{ weechat__home_directory }}/.weechat/{{ weechat_plugin_languages[item.split('.', 1)[-1]] }}/autoload/{{ item }}"
state: link
with_items: '{{ weechat__plugins }}'