Trying to deploy Nextcloud client config on Linux & MacOS

Hi all,

I’ve a few machines I’ld like to deploy using ansible. Installing the client is already working as expected.

What I’m looking for is a way to get a config (including credentials) rolled to my other machines.

I’m well aware of ~/.config/Nextcloud/nextcloud.cfg but from looking at it I’m afraid that it doesn’t contain the credentials.

Hoping you’ve got some hints for me

As a reply to myself and maybe for others looking into a similar challenge.

This is how I solved it:

    - name: Create directory .config
      become: true
      become_user: '{{remoteuser}}'
      ansible.builtin.file:
        path: ~/.config
        state: directory
        mode: '0755'

    - name: Create directory Nextcloud
      become: true
      become_user: '{{remoteuser}}'
      ansible.builtin.file:
        path: ~/Nextcloud
        state: directory
        mode: '0755'

    - name: Copy Nextcloud config
      become: true
      become_user: '{{remoteuser}}'
      ansible.builtin.copy:
        src: ~/ansible/templates/Nextcloud
        dest: ~/.config

But I still need to enter my password in the browser to grant access… Isn’t there a way to avoid that?