Skip to content
Snippets Groups Projects
Commit f6ceaea4 authored by Kamil Andoniadis's avatar Kamil Andoniadis
Browse files

Resolve "Add option to set password"

parent 16149b83
No related branches found
No related tags found
No related merge requests found
# Ansible role - kypo-user-access
This role was specially designed for KYPO sandbox. It sets user-access public
SSH key as authorized key and optionally sets password to a user.
## Requirements
* This role requires root access, so you either need to specify `become` directive as a global or while invoking the role.
```yml
become: yes
```
## Role parameters
Mandatory parameters
* `kypo_user_access_username` - The name of the user to give SSH access to.
Optional parameters.
* `kypo_user_access_password` - The password of user `kypo_user_access_password` (omitted by default).
## Example
The simplest example.
```yml
roles:
- role: kypo-user-access
kypo_user_access_username: kypo
```
kypo_user_access_username: kypo_user_access_username:
kypo_user_access_ssh_public_key: '{{ hostvars["man"]["user_public_key_path"] }}' kypo_user_access_ssh_public_key: '{{ hostvars["man"]["user_public_key_path"] }}'
kypo_user_access_password:
...@@ -16,3 +16,9 @@ ...@@ -16,3 +16,9 @@
user: '{{ kypo_user_access_username }}' user: '{{ kypo_user_access_username }}'
key: '{{ lookup("file", kypo_user_access_ssh_public_key) }}' key: '{{ lookup("file", kypo_user_access_ssh_public_key) }}'
- name: set password if defined
user:
name: '{{ kypo_user_access_username }}'
password: '{{ kypo_user_access_password | password_hash("sha512") }}'
when: kypo_user_access_password is defined and kypo_user_access_password
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment