diff --git a/defaults/main.yml b/defaults/main.yml index 2d4459b..ff593a4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -29,6 +29,8 @@ rundeck_port_https: 4443 # base dir for config files rundeck_etc: /etc/rundeck +# base dir +rundeck_base: /var/lib/rundeck # target /etc/default/rundeckd read by /etc/rundeck/profile rundeck_default: @@ -62,3 +64,11 @@ rundeck_users: {} # roles: user,admin,architect,deploy,build # admin: # state: absent + +# rundeck_plugins +rundeck_plugins: {} +# see https://github.com/rundeck-plugins +# example: +# rundeck_plugins: +# "ansible-plugin.jar": "https://github.com/rundeck-plugins/ansible-plugin/releases/download/v4.0.5/ansible-plugin-4.0.5.jar" +# "another-plugin.zip": absent # remove plugin diff --git a/tasks/main.yml b/tasks/main.yml index 79ccf5a..84a281a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -72,3 +72,22 @@ state: "{{ item.value.state | default('present') }}" notify: rundeck service with_dict: "{{ rundeck_users | default({}) }}" + +- name: install plugins + ansible.builtin.get_url: + url: "{{ item.value }}" + dest: "{{ rundeck_base }}/libext/{{ item.key }}" + mode: '0644' + owner: rundeck + group: rundeck + notify: rundeck service + with_dict: "{{ rundeck_plugins }}" + where: item.value != "absent" + +- name: remove plugins + ansible.builtin.file: + path: "{{ rundeck_base }}/libext/{{ item.key }}" + state: absent + notify: rundeck service + with_dict: "{{ rundeck_plugins }}" + where: item.value == "absent"