- name: Create system groups become: true group: name: "{{ item }}" system: true loop: "{{ system_groups.split(',') }}" - name: Create group phd become: true group: name: phd - name: Add user phd become: true user: name: phd group: phd groups: "{{ system_groups }}" - name: Create folder ~phd/.ssh file: path: ~phd/.ssh state: directory owner: phd group: phd mode: 0700 - name: Upload SSH key copy: src: ~/.ssh/phd@nb3.pub dest: ~phd/.ssh/authorized_keys owner: phd group: phd mode: 0600