microsoft / PowerShell-DSC-for-Linux

PowerShell Desired State Configuration - for Linux
Other
339 stars 130 forks source link

Error: Unable to find service named autofs in systemd. RHEL8.1 #797

Open mrpullen opened 3 years ago

mrpullen commented 3 years ago

Attempting to deploy the RHEL79.MOF file from ato-toolkit using the latest DSC for linux release 1.2. Seems to work without issues until it reaches a nxService resource - then fails.

Error: Unable to find service named autofs in systemd. 2021/05/13 15:58:25: ERROR: null(0): EventId=1 Priority=ERROR Job FE792666-948D-4600-A1AD-08060B9E1C4A : This event indicates that failure happens when LCM is processing the configuration. ErrorId is 1. ErrorDetail is The SendConfigurationApply function did not succeed.. ResourceId is [nxService][V-204451][medium][SRG-OS-000114-GPOS-00059]::[RHEL]Baseline and SourceInfo is C:\Program Files\WindowsPowerShell\Modules\PowerStig\4.8.0\DSCResources\Resources\linux.nxService.ps1::13::9::nxService. ErrorMessage is A general error occurred, not covered by a more specific error code..

From the MOF that specific resourceId looks like this

instance of MSFT_nxServiceResource as $MSFT_nxServiceResource1ref
{
ResourceID = "[nxService][V-204451][medium][SRG-OS-000114-GPOS-00059]::[RHEL]Baseline";
 Controller = "systemd";
 Enabled = False;
 SourceInfo = "C:\\Program Files\\WindowsPowerShell\\Modules\\PowerStig\\4.8.0\\DSCResources\\Resources\\linux.nxService.ps1::13::9::nxService";
 Name = "autofs";
 ModuleName = "nx";
 ModuleVersion = "1.0";

 ConfigurationName = "LinuxBaseLine";

};

Installing omi-server and dsc with the following script

# Install repository configuration
curl -sSL https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft-prod.repo

# Install Microsoft's GPG public key
curl -sSL https://packages.microsoft.com/keys/microsoft.asc > ./microsoft.asc

## Import
sudo rpm --import ./microsoft.asc

## Install OMI
sudo yum -y install omi

sudo wget https://github.com/microsoft/PowerShell-DSC-for-Linux/releases/download/v1.2.0-0/dsc-1.2.0-0.ssl_110.x64.rpm
sudo rpm -Uvh dsc-1.2.0-0.ssl_110.x64.rpm

## now DSC is installed - what do we do about it.

Thanks.

jineshcodes commented 3 years ago

Which Operating system distro are you using? please share version details from /etc/os-release Can you please share the OMI version on the machine. This dsc versions requires omi to be >= 1.6.8 Also the following logs will help investigate issue further, can you please upload those and share a link: /var/opt/omi/log/dsc.log /var/opt/omi/logdscdetailed.log /var/opt/omi/log/omiserver.log

mrpullen commented 3 years ago

more /etc/os-release

NAME="Red Hat Enterprise Linux"
VERSION="8.1 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.1"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.1 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.1:GA"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.1
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.1"

I will put the files up on my github and send a link when I am done. thanks for the assistance.

jineshcodes commented 3 years ago

Thanks for pointing this issue @mrpullen . I have raised a PR for the same.

mrpullen commented 3 years ago

Pushed the requested log files up here. Log files