Skip to content

Add support for creating users #28

@brandonros

Description

@brandonros

Inspired by this Ansible playbook step:

- name: setup user
  hosts: new_droplet
  gather_facts: false
  tasks:
    - name: Ensure user "debian" exists
      ansible.builtin.user:
        name: debian
        shell: /bin/bash
        groups: sudo
        create_home: true
        home: /home/debian
        append: yes
        password: "{{ 'foobar123' | password_hash('sha512') }}"

    - name: add ssh key
      ansible.posix.authorized_key:
        user: debian
        state: present
        key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/user_module.html

https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html

https://nixpkgs-manual-sphinx-markedown-example.netlify.app/configuration/user-mgmt.xml.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions