--- - 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 }}'