-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
vit01
committed
Jul 23, 2022
1 parent
16989e7
commit 9242c7e
Showing
5 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include software::everywhere | ||
include software::personal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
cmd_replace='sed "s|empty1|$SSH_KEY|g; s|empty2|$SSH_USER|g" software/manifests/personaltpl.pp > software/manifests/personal.pp' | ||
|
||
sops exec-env ./ssh-info.env "$cmd_replace" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
class software::personal { | ||
$user = 'vitya' | ||
|
||
ssh_authorized_key { 'empty2': | ||
ensure => present, | ||
user => $user, | ||
type => 'ssh-rsa', | ||
key => 'empty1' | ||
} | ||
|
||
$ssh_service_name = $operatingsystem ? { | ||
debian => "ssh", | ||
ubuntu => "ssh", | ||
archlinux => "sshd", | ||
manjarolinux => "sshd" | ||
} | ||
|
||
#service { 'ssh': | ||
# name => $ssh_service_name, | ||
# ensure => "running", | ||
# enable => "true" | ||
#} | ||
|
||
class { 'ssh::server': | ||
validate_sshd_file => true, | ||
options => { | ||
'Match User www-data' => { | ||
'ChrootDirectory' => '%h', | ||
'ForceCommand' => 'internal-sftp', | ||
'PasswordAuthentication' => 'no', | ||
'AllowTcpForwarding' => 'no', | ||
'X11Forwarding' => 'no', | ||
}, | ||
'Match User vitya' => { | ||
'PasswordAuthentication' => 'yes', | ||
'AllowTcpForwarding' => 'yes', | ||
'X11Forwarding' => 'yes', | ||
}, | ||
'PrintMotd' => 'no', | ||
'StreamLocalBindUnlink' => 'yes', | ||
'PasswordAuthentication' => 'yes', | ||
'PermitRootLogin' => 'no', | ||
'Port' => 356, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters