Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
servers-config
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Sistemisti
servers-config
Commits
43c0a473
Commit
43c0a473
authored
Mar 02, 2018
by
Mattia Rizzolo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common/users: rework the ssh keys handling
Signed-off-by:
Mattia Rizzolo
<
mattia@debian.org
>
parent
c25d39cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
6 deletions
+42
-6
roles/common/tasks/users.yml
roles/common/tasks/users.yml
+42
-6
No files found.
roles/common/tasks/users.yml
View file @
43c0a473
...
...
@@ -42,14 +42,50 @@
-
"
{{
handled_users
}}"
-
extra_groups
-
name
:
set ssh keys for admin user
s
-
name
:
Install the ssh key
s
authorized_key
:
user
:
"
{{
item
}}"
key
:
"
{{
admin_users[item]
}}"
user
:
"
{{
item.0.name
}}"
key
:
"
{{
item.1.key
}}"
comment
:
"
{{
item.1.comment
|
default(None)
}}"
state
:
"
{{
item.1.state
}}"
path
:
/etc/ssh/authorized_keys/{{ item.0.name }}
manage_dir
:
no
with_subelements
:
-
"
{{
handled_users
}}"
-
keys
exclusive
:
true
state
:
present
-
name
:
Install the ssh keys for the management user
authorized_key
:
user
:
manager
key
:
"
{{
item.1.key
}}"
comment
:
"
{{
item.1.comment
|
default(None)
}}"
state
:
"
{{
item.1.state
}}"
path
:
/etc/ssh/authorized_keys/manager
manage_dir
:
no
with_subelements
:
-
"
{{
handled_users
}}"
-
keys
when
:
-
item.0.name in admin_users
with_items
:
"
{{
admin_users.keys()
}}"
-
name
:
"
Change
the
owner
of
/etc/ssh/authorized_keys...
bug:
http://git.io/t1zSKA"
file
:
path
:
/etc/ssh/authorized_keys
state
:
directory
owner
:
root
group
:
root
mode
:
0755
-
name
:
list files in /etc/authorized_keys, then I'll chown/chmod them
command
:
ls -1 /etc/ssh/authorized_keys/
register
:
dumpfiles
changed_when
:
false
-
name
:
"
Change
the
owner
of
/etc/ssh/authorized_keys/*...
bug:
http://git.io/t1zSKA"
file
:
path
:
/etc/ssh/authorized_keys/{{ item }}
state
:
file
owner
:
root
group
:
root
mode
:
0644
with_items
:
"
{{
dumpfiles.stdout_lines
}}"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment