ansible-collection-nextcloud-admin
ansible-collection-nextcloud-admin copied to clipboard
nextcloud.admin.install_nextcloud fail if source: is not defined, but conf: is defined in nextcloud_apps
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
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
Hi marioqxx
Yes, I did it and it works.
Thanks a lot
Ivo
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.