nkakouros-original / ansible-role-nextcloud

An Ansible role to install Nextcloud
GNU General Public License v3.0
11 stars 5 forks source link

Simplify JSON parsing #29

Closed simonspa closed 4 years ago

simonspa commented 5 years ago

Once https://github.com/nextcloud/server/issues/8092 is resolved we can resort to simpler JSON out parsing using a filter:

   become_user: "{{ nextcloud_file_owner }}"
-  register: nextcloud_installed_apps
+  register: _result
   changed_when: false

 - name: Remove non-json text from command output
   set_fact:
-    nextcloud_installed_apps: >-
-      {{
-        nextcloud_installed_apps.stdout[
-          (nextcloud_installed_apps.stdout.find('{')):
-        ]
-      }}
+    nextcloud_installed_apps: "{{ _result.stdout | from_json }}"
nkakouros commented 4 years ago

This does not seem to be an issue anymore right?