--- - name: create logsync group group: name: logsync system: true - name: create logsync user user: name: logsync comment: Service logsync createhome: false group: logsync home: /var/empty shell: /sbin/nologin system: true - name: create logsync ssh key directory file: path: /etc/ssh/logsync state: directory mode: 0750 owner: root group: logsync - name: create logsync ssh keys command: argv: - ssh-keygen - -t - ed25519 - -C - "logsync@{{ inventory_hostname }}" - -f - /etc/ssh/logsync/id_ed25519 creates: /etc/ssh/logsync/id_ed25519 - name: fix logsync ssh key permissions file: path: "{{ item }}" owner: root group: logsync mode: 0640 with_items: - /etc/ssh/logsync/id_ed25519 - /etc/ssh/logsync/id_ed25519.pub - import_role: name: rclone vars: local_user: logsync remote_user: logsync hostgroup: webservers destination: /var/cache/sync-http-logs private_key: /etc/ssh/logsync/id_ed25519 - name: create data directories file: path: "{{ item }}" state: directory mode: 0750 owner: logsync group: logsync with_items: - /var/cache/sync-http-logs