Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible development VM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
Development Playbooks
Ansible development VM
Commits
b106621f
Verified
Commit
b106621f
authored
2 years ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Add SSH key to user
parent
93510d8d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+2
-2
2 additions, 2 deletions
README.md
roles/gap_utility_user/tasks/main.yml
+7
-3
7 additions, 3 deletions
roles/gap_utility_user/tasks/main.yml
with
9 additions
and
5 deletions
README.md
+
2
−
2
View file @
b106621f
...
...
@@ -4,7 +4,7 @@ A -- very simple -- Ansible playbook that adds a new local user to `utility[\d+]
Example usage of this playbook:
```
ansible-playbook -i 127.0.0.1, playbook.yml -e "username=$USERNAME" -e "full_name=$YOUR_NAME" -k
ansible-playbook -i 127.0.0.1, playbook.yml -e "username=$USERNAME" -e "full_name=$YOUR_NAME"
-e "ssh_key_path=$YOUR_SSH_KEY"
-k
```
Remember to fill in the variables
`$USERNAME`
and
`$YOUR_
NAME`
Remember to fill in the variables
`$USERNAME`
,
`$YOUR_NAME`
,
and
`$YOUR_
SSH_KEY`
.
This diff is collapsed.
Click to expand it.
roles/gap_utility_user/tasks/main.yml
+
7
−
3
View file @
b106621f
...
...
@@ -4,11 +4,15 @@
comment
:
"
{{
full_name
}}"
groups
:
sudo
append
:
yes
# generate_ssh_key: yes
# ssh_key_bits: 4096
# ssh_key_comment: "{{ username }}'s key"
password
:
'
!'
# Do not allow login with a password
password_lock
:
yes
# Login with SSH key only
register
:
user_output
-
name
:
Add SSH key to user for logging in
ansible.posix.authorized_key
:
user
:
"
{{
username
}}"
key
:
"
{{
ssh_key_path
}}"
-
name
:
Create new VM for development
ansible.builtin.debug
:
msg
:
"
Now,
provision
a
new
VM
using
Terraform"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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