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
0b9baa20
Commit
0b9baa20
authored
2 years ago
by
Simone Spinelli
Browse files
Options
Downloads
Patches
Plain Diff
Add sudo checks and new users variable
parent
9d62bddf
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
roles/gap_utility_user/tasks/main.yml
+14
-4
14 additions, 4 deletions
roles/gap_utility_user/tasks/main.yml
roles/gap_utility_user/vars/main.yaml
+5
-0
5 additions, 0 deletions
roles/gap_utility_user/vars/main.yaml
with
19 additions
and
4 deletions
roles/gap_utility_user/tasks/main.yml
+
14
−
4
View file @
0b9baa20
-
name
:
Make sure sudoers are paswordless
community.general.sudoers
:
name
:
sudo4gap
group
:
sudo
commands
:
ALL
state
:
present
-
name
:
Add a new Linux user
-
name
:
Add a new Linux user
ansible.builtin.user
:
ansible.builtin.user
:
name
:
"
{{
username
}}"
name
:
"
{{
item.
username
}}"
comment
:
"
{{
full_name
}}"
comment
:
"
{{
item.
full_name
}}"
groups
:
sudo
groups
:
sudo
append
:
yes
append
:
yes
password
:
'
!'
# Do not allow login with a password
password
:
'
!'
# Do not allow login with a password
password_lock
:
yes
# Login with SSH key only
password_lock
:
yes
# Login with SSH key only
shell
:
"
{{
item.shell
}}"
register
:
user_output
register
:
user_output
with_items
:
"
{{goat_users}}"
-
name
:
Add SSH key to user for logging in
-
name
:
Add SSH key to user for logging in
ansible.posix.authorized_key
:
ansible.posix.authorized_key
:
user
:
"
{{
username
}}"
user
:
"
{{
item.username
}}"
key
:
"
{{
ssh_key
}}"
key
:
"
{{
item.ssh_key
}}"
with_items
:
"
{{goat_users}}"
-
name
:
Create new VM for development
-
name
:
Create new VM for development
ansible.builtin.debug
:
ansible.builtin.debug
:
...
...
This diff is collapsed.
Click to expand it.
roles/gap_utility_user/vars/main.yaml
0 → 100644
+
5
−
0
View file @
0b9baa20
goat_users
:
-
username
:
simone
full_name
:
"
Simone
Spinelli"
shell
:
"
/bin/bash"
ssh_key
:
"
ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQDt0UfEy8Tz4lrrXvLqcmDcVB/uxGot3upZUOUtUFif6dBiGdasxvi7OaHoOh1Ho6SHGF57tXFYXzIR0VIXdFs0zG62FGESXLOzpGgoB/bWcRDoipcoM0rnMKNuL+SOFjGQ0XLQu4/I6UHd6pJ+JW2V6gx0KcbiHt5ogHiFeeDyC+p/+eSyP0kXVnP7ewU/A/0cTBhAEvNstPrWdKj4C9LadBq8ZC9JheuEBpJvG+EwEXTFfRwL3JsG1Gwvyhg2fmlqiqsiM70XB1v8CLOp/gGcv0ug1oAOl1XKEEYqE2z/GWvykX8DDyMF3C8JSdyX3oOANwYHQ46XuENZqKc4DvWt
simonespinelli@GA0050"
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