ansible-collection-nextcloud-admin icon indicating copy to clipboard operation
ansible-collection-nextcloud-admin copied to clipboard

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

Open ivoruetsche opened this issue 1 year ago • 3 comments

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

ivoruetsche avatar Jan 04 '24 14:01 ivoruetsche

Hi Ivo,

can you please remove this block:

  • 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

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

marioqxx avatar Jan 12 '24 06:01 marioqxx

Hi marioqxx

Yes, I did it and it works.

Thanks a lot

Ivo

ivoruetsche avatar Jan 12 '24 22:01 ivoruetsche

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.

marioqxx avatar Jan 13 '24 20:01 marioqxx