From bb070de812d4cc293a7dc0f9c26b9a1a771ca4f8 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 11 Mar 2020 21:08:00 +0100 Subject: [PATCH] improve and rewrite weechat plugin task --- defaults/main.yml | 4 ++-- tasks/configure_directorys.yml | 19 ------------------- tasks/configure_plugins.yml | 19 +++++++++++++++++++ tasks/configure_weechat.yml | 4 ---- tasks/main.yml | 4 ++-- vars/main.yml | 4 ++-- 6 files changed, 25 insertions(+), 29 deletions(-) delete mode 100644 tasks/configure_directorys.yml delete mode 100644 tasks/configure_weechat.yml diff --git a/defaults/main.yml b/defaults/main.yml index c9a97e2..8a5c863 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,8 +4,8 @@ weechat: install: true # autostart weechat via systemd in a tmux session? autostart: false - # should we configure weechat - configure: false + # should we install official weechat plugins + install_plugins: false # user to install and use weechat user: "{{ ansible_user_id }}" # where is our home direcotory for weechat diff --git a/tasks/configure_directorys.yml b/tasks/configure_directorys.yml deleted file mode 100644 index d3b424e..0000000 --- a/tasks/configure_directorys.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: create weechat directory - become: true - become_user: "{{ weechat.user }}" - file: - path: "{{ weechat.home_directory }}" - state: directory - owner: "{{ weechat.user }}" - mode: "0750" - -- name: create weechat plugins directory - become: true - become_user: "{{ weechat.user }}" - file: - path: "{{ weechat.home_directory }}/{{ item.value }}/autoload" - state: directory - owner: "{{ weechat.user }}" - mode: "0750" - with_dict: "{{ weechat_plugin_languages }}" diff --git a/tasks/configure_plugins.yml b/tasks/configure_plugins.yml index 977a932..be0e488 100644 --- a/tasks/configure_plugins.yml +++ b/tasks/configure_plugins.yml @@ -1,4 +1,23 @@ --- +- name: create weechat directory + become: true + become_user: "{{ weechat.user }}" + file: + path: "{{ weechat.home_directory }}" + state: directory + owner: "{{ weechat.user }}" + mode: "0750" + +- name: create weechat plugins directory + become: true + become_user: "{{ weechat.user }}" + file: + path: "{{ weechat.home_directory }}/{{ item.value }}/autoload" + state: directory + owner: "{{ weechat.user }}" + mode: "0750" + with_dict: "{{ weechat_plugin_languages }}" + - name: download weechat plugins get_url: url: 'https://weechat.org/files/scripts/{{ item }}' diff --git a/tasks/configure_weechat.yml b/tasks/configure_weechat.yml deleted file mode 100644 index 2705587..0000000 --- a/tasks/configure_weechat.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- include_tasks: configure_directorys.yml - -- include_tasks: configure_plugins.yml diff --git a/tasks/main.yml b/tasks/main.yml index 29de6ba..b805a49 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -9,8 +9,8 @@ - include_tasks: "install-{{ ansible_os_family|lower }}.yml" when: weechat.install | bool -- include_tasks: configure_weechat.yml - when: weechat.configure | bool +- include_tasks: configure_plugins.yml + when: weechat.install_plugins | bool - include_tasks: setup_autostart.yml when: weechat.autostart | bool diff --git a/vars/main.yml b/vars/main.yml index b31ac08..76e8b29 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -9,14 +9,14 @@ weechat_plugin_languages: lua: lua # version management -playbook_version_number: 2054 # should be over ninethousand +playbook_version_number: 2055 # should be over ninethousand playbook_version_path: 'role-weechat_roles-ansible_github.com.version' # default values _weechat: install: true autostart: false - configure: false + install_plugins: false user: "{{ ansible_user_id }}" home_directory: "{{ ansible_env.HOME | default('/home/{{ weechat.user }}') }}/.weechat" plugins: []