forked from LibreSchool/doraemon
sudoers fix
This commit is contained in:
parent
9b9db0f626
commit
cfe38a1321
@ -1,7 +1,7 @@
|
|||||||
Summary: Helps client to join domain and maintain itself
|
Summary: Helps client to join domain and maintain itself
|
||||||
Name: doraemon
|
Name: doraemon
|
||||||
Version: 2.0.0
|
Version: 2.0.0
|
||||||
Release: 1.ns6
|
Release: 2.ns6
|
||||||
URL: https://github.com/bglug-it/doraemon/
|
URL: https://github.com/bglug-it/doraemon/
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Packager: Paolo Asperti <paolo@asperti.com>
|
Packager: Paolo Asperti <paolo@asperti.com>
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
#
|
{
|
||||||
# 50doraemon
|
$OUT = 'srvmgr ALL=NOPASSWD: /bin/cat ';
|
||||||
#
|
|
||||||
srvmgr ALL=NOPASSWD: /bin/cat /home/amgmt/.ansible/vault.txt
|
|
||||||
|
|
||||||
|
use esmith::ConfigDB;
|
||||||
|
my $confdb = esmith::ConfigDB->open;
|
||||||
|
my $backup = $confdb->get('doraemon') or die "No doraemon db entry found\n";
|
||||||
|
my $VaultPassFile = $backup->prop('VaultPassFile') || '/home/amgmt/.ansible/vault.txt';
|
||||||
|
my $ManagementKeyFile = $backup->prop('ManagementKeyFile') || '/home/amgmt/.ssh/id_rsa.pub';
|
||||||
|
my $DomainFile = $backup->prop('DomainFile') || '/etc/domain.yml';
|
||||||
|
|
||||||
|
$OUT = 'srvmgr ALL=NOPASSWD: /bin/cat ' . $VaultPassFile . '
|
||||||
|
srvmgr ALL=NOPASSWD: /bin/cat ' . $ManagementKeyFile .'
|
||||||
|
srvmgr ALL=NOPASSWD: /bin/cat ' . $DomainFile;
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -125,19 +125,13 @@ function pingHost($host, $timeout=1) {
|
|||||||
function ROUTE_domain() {
|
function ROUTE_domain() {
|
||||||
global $config_db;
|
global $config_db;
|
||||||
$theFile = $config_db->getProp(CONFIG_KEY,'DomainFile');
|
$theFile = $config_db->getProp(CONFIG_KEY,'DomainFile');
|
||||||
$content = file_get_contents($theFile);
|
passthru("/usr/bin/sudo /bin/cat $theFile");
|
||||||
if (false !== $content) {
|
|
||||||
echo $content;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ROUTE_mgmtkey() {
|
function ROUTE_mgmtkey() {
|
||||||
global $config_db;
|
global $config_db;
|
||||||
$theFile = $config_db->getProp(CONFIG_KEY,'ManagementKeyFile');
|
$theFile = $config_db->getProp(CONFIG_KEY,'ManagementKeyFile');
|
||||||
$content = file_get_contents($theFile);
|
passthru("/usr/bin/sudo /bin/cat $theFile");
|
||||||
if (false !== $content) {
|
|
||||||
echo $content;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ROUTE_epoptes_srv() {
|
function ROUTE_epoptes_srv() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user