Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-sb-devops
Commits
a6bd8b87
Commit
a6bd8b87
authored
7 years ago
by
manoj v
Browse files
Options
Download
Patches
Plain Diff
Issue #345 chore: added script to provide ssh access
parent
36b6f4dd
release-1.3.1
release-1.3
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible/createuser.yml
+14
-0
ansible/createuser.yml
ansible/roles/createuser/tasks/main.yml
+15
-0
ansible/roles/createuser/tasks/main.yml
with
29 additions
and
0 deletions
+29
-0
ansible/createuser.yml
0 → 100644
+
14
−
0
View file @
a6bd8b87
---
-
hosts
:
"
{{
remote
}}"
become
:
yes
roles
:
-
ssh-access
tags
:
-
add-user
-
hosts
:
"
{{
remote
}}"
become
:
yes
tasks
:
-
user
:
name="{{ user }}" state=absent remove=yes
tags
:
-
delete-user
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ansible/roles/createuser/tasks/main.yml
0 → 100644
+
15
−
0
View file @
a6bd8b87
-
name
:
Add group
group
:
name={{ group }} state=present
become
:
yes
-
name
:
Create user
become
:
yes
user
:
state=present name="{{ user }}" group="{{ group }}" groups=sudo shell=/bin/bash createhome=yes password="{{password}}" update_password=always
-
name
:
Add ssh public key
authorized_key
:
user="{{ user }}" key="{{ public_key }}"
become
:
yes
-
name
:
Install key
copy
:
content="{{ public_key }}" dest=/home/{{ user }}/.ssh/{{ public_key }} mode=600 owner={{ user }}
become
:
yes
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets