Skip to content

Ansible role to create a user with public key SSH and passwordless sudo.

License

Notifications You must be signed in to change notification settings

lnovara/ansible-deploy-user

Repository files navigation

Ansible Role: deploy-user

Build Status Ansible Galaxy

Setup a user account with public key login and passwordless sudo.

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml).

user_name: deploy

User's name.

user_shell: /bin/bash

User's shell.

user_groups: []

Additional groups beyond the default. NB: this role automatically creates those groups if they do not exist in the system.

public_keys:
  - ~/.ssh/id_rsa.pub

List of public keys to add to the user's .ssh/authorized_keys file.

enable_passwordless_sudo: True

Enable passwordless sudo for the newly created user.

Dependencies

None.

Example Playbook

- name: Create deploy user on all hosts.
  hosts: all
  roles:
     - { role: lnovara.deploy-user,
         user_groups: [foo, bar] }

License

MIT

Author Information

Luca Novara

About

Ansible role to create a user with public key SSH and passwordless sudo.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages