nextcloud / ansible-collection-nextcloud-admin

The ansible galaxy for your nextcloud administrative needs.
https://galaxy.ansible.com/nextcloud/admin
BSD 2-Clause "Simplified" License
138 stars 77 forks source link

nextcloud.admin.install_nextcloud fail if source: is not defined, but conf: is defined in nextcloud_apps #335

Open ivoruetsche opened 9 months ago

ivoruetsche commented 9 months ago

Hi

According to README - it should be possible to declare the conf: without the source:

nextcloud_apps:
  app_name_3: # Download from nextcloud official app-store
    conf:
      parameter1: ldap:\/\/ldapsrv
      parameter2: another_value

But, I got this error:

TASK [nextcloud.admin.install_nextcloud : [App] - Verify the yaml declaration for the app "xx"] *************************************************************************************************************
fatal: [198.19.220.125]: FAILED! => {
    "assertion": "(nc_app_cfg.source is defined) and (nc_app_cfg.source is string)",
    "changed": false,
    "evaluated_to": false,
    "msg": "xx is not well declared."
}

This two parts are responsible

- name: "[App] - Parse the item values"
  ansible.builtin.set_fact:
    nc_app_name: "{{ item.key }}"
    nc_app_source: "{{ item.value.source if item.value.source is defined else item.value }}"
    nc_app_cfg: "{{ item.value }}"

- name: "[App] - Verify the yaml declaration for the app \"{{ nc_app_name }}\""
  ansible.builtin.assert:
    that:
      - (nc_app_cfg.source is defined) and (nc_app_cfg.source is string)
    msg: "{{ nc_app_name }} is not well declared."
  when: nc_app_cfg is not string

Thanks a lot Ivo

marioqxx commented 9 months ago

Hi Ivo,

can you please remove this block:

and re-try. It seems this block is no longer necessary. Thx marioqxx

ivoruetsche commented 9 months ago

Hi marioqxx

Yes, I did it and it works.

Thanks a lot

Ivo

marioqxx commented 9 months ago

Thanks for testing Ivo! I'll do some more tests and then get this fixed through a pull-request. This pull request https://github.com/nextcloud/ansible-collection-nextcloud-admin/pull/336 shall fix this.