forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ssh to 3216cd87ae97ee74f06edd0e4868cedbc90e86d9
3216cd87ae97ee74f06edd0e4868cedbc90e86d9 add summary, new release v2.8.1 10d5e39904498e64422450801779392085ca7baf new release v2.8.0 e7670e1640ed8569fce2461bcc1e804eb101383f Merge branch 'ccin2p3-feature/per_user_config' b296ee7d6f6ce2d4dc5fd3939c13364b6eddaaa1 fix users_client_options if no hiera values found e7a0ba390bbb3eb5a6f754ca513230a2f8dfaf53 Merge branch 'feature/per_user_config' of https://github.com/ccin2p3/puppet-ssh into ccin2p3-feature/per_user_config 0020bd68c6257db48092e131b233b1bf417bc3ba new release v2.7.0 adcce9563ad83d52b5979b08db696aa4af5488a0 cast port value to string before striping, fixes redhat-openstack#112 da7c691f0931dc61ca368d51445ffaddc6b2aba3 ignore Gemfile.lock and vendor dir d1f515e6065a811286e9ebfce2afe07843858e3d Merge pull request redhat-openstack#122 from stjeanp/master 28d63dbde9c4d214d826ecb6f4644df820e3e6f8 Merge pull request redhat-openstack#115 from cisco87/patch-1 d316ce453117849eb10833e8c9d6a84284b14912 Merge pull request redhat-openstack#114 from tedivm/concat_bug 828e7cf6d032d573b63bac47e272aecae348446d Merge pull request redhat-openstack#113 from tedivm/client_server_bug 5526b90bcbb1862acf86677ad214f98c7bd62d4f Fixes to make puppet-lint happy 10192afbc62ef8de13ff0522daf6531f9ff91e01 New type for managing users ssh configuration file 34e3e6977c5661ea269ccd5b80b74a9f097c576b Fixed parameter alignment cb626fd50fd039f51ffa4912182ad139f7203a93 It's needed since due for a bug in puppet hiera_hash might return an empty string instead of the default value. 6629299da7d788384a71ce30e5c57ac90c668a49 Deleted superfluous relationship 3e5821025f819822fd3df0b1f25c1589500959d0 Corrected dependency direction ced449b51874d5d408c1ff59faddc42c3eedcbfb Made config class compatible with new concat module fc6aa145e42fdaf801f22e422e43f40e8e151fb0 Corrected bug which applied server settings to the client Change-Id: I6d7aa52b30763880ebe8dc20a3962081befede15
- Loading branch information
Showing
14 changed files
with
333 additions
and
15 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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pkg/ | ||
*.swp | ||
.DS_Store | ||
Gemfile.lock | ||
vendor/ |
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
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,56 @@ | ||
# | ||
# Copyright (c) IN2P3 Computing Centre, IN2P3, CNRS | ||
# Contributor: Remi Ferrand <remi{dot}ferrand_at_cc(dot)in2p3.fr> (2015) | ||
# | ||
define ssh::client::config::user( | ||
$ensure = present, | ||
$target = undef, | ||
$user_home_dir = undef, | ||
$manage_user_ssh_dir = true, | ||
$options = {} | ||
) | ||
{ | ||
validate_re($ensure, '^(present|absent)$') | ||
validate_hash($options) | ||
validate_bool($manage_user_ssh_dir) | ||
|
||
include ::ssh::params | ||
|
||
$_files_ensure = $ensure ? { 'present' => 'file', 'absent' => 'absent' } | ||
|
||
# If a specific target file was specified, | ||
# it must have higher priority than any | ||
# other parameter. | ||
if ($target != undef) { | ||
validate_absolute_path($target) | ||
$_target = $target | ||
} | ||
else { | ||
if ($user_home_dir == undef) { | ||
$_user_home_dir = "/home/${name}" | ||
} | ||
else { | ||
validate_absolute_path($user_home_dir) | ||
$_user_home_dir = $user_home_dir | ||
} | ||
|
||
$user_ssh_dir = "${_user_home_dir}/.ssh" | ||
$_target = "${user_ssh_dir}/config" | ||
|
||
if ($manage_user_ssh_dir == true) { | ||
file { $user_ssh_dir: | ||
ensure => directory, | ||
owner => $name, | ||
mode => $::ssh::params::user_ssh_directory_default_mode, | ||
before => File[$_target] | ||
} | ||
} | ||
} | ||
|
||
file { $_target: | ||
ensure => $_files_ensure, | ||
owner => $name, | ||
mode => $::ssh::params::user_ssh_config_default_mode, | ||
content => template("${module_name}/ssh_config.erb") | ||
} | ||
} |
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 |
---|---|---|
@@ -1,33 +1,47 @@ | ||
class ssh ( | ||
$server_options = {}, | ||
$client_options = {}, | ||
$users_client_options = {}, | ||
$version = 'present', | ||
$storeconfigs_enabled = true | ||
) inherits ssh::params { | ||
|
||
validate_hash($server_options) | ||
validate_hash($client_options) | ||
validate_hash($users_client_options) | ||
validate_bool($storeconfigs_enabled) | ||
|
||
# Merge hashes from multiple layer of hierarchy in hiera | ||
$hiera_server_options = hiera_hash("${module_name}::server_options", undef) | ||
$hiera_client_options = hiera_hash("${module_name}::client_options", undef) | ||
$hiera_users_client_options = hiera_hash("${module_name}::users_client_options", undef) | ||
|
||
$fin_server_options = $hiera_server_options ? { | ||
undef => $server_options, | ||
default => $hiera_server_options, | ||
} | ||
|
||
$fin_client_options = $hiera_client_options ? { | ||
undef => $server_options, | ||
undef => $client_options, | ||
default => $hiera_client_options, | ||
} | ||
|
||
$fin_users_client_options = $hiera_users_client_options ? { | ||
undef => $users_client_options, | ||
default => $hiera_users_client_options, | ||
} | ||
|
||
class { 'ssh::server': | ||
ensure => $version, | ||
storeconfigs_enabled => $storeconfigs_enabled, | ||
options => $fin_server_options, | ||
ensure => $version, | ||
} | ||
|
||
class { 'ssh::client': | ||
ensure => $version, | ||
storeconfigs_enabled => $storeconfigs_enabled, | ||
options => $fin_client_options, | ||
ensure => $version, | ||
} | ||
|
||
create_resources('::ssh::client::config::user', $fin_users_client_options) | ||
} |
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
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
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
Oops, something went wrong.