Following up to last week’s article, Day 27: Managing Linux Users and Groups using PowerShell DSC, this week we’ll be demonstrating how to manage multiple resources in Linux using PowerShell DSC. In This week’s post is two examples, one for Ubuntu and one for CentOS, showing what a configuration can look like that is managing multiple items on a single host.
Ensures that the scom-svc-centos user is present.
Ensures that the scom-svc-users group is present.
Ensures that the root and scom-svc-centos users are members of the scom-svc-users group.
Ensures that the crond service is running.
Resets the password of the scom-svc-centos user account.
It should go without saying that storing credentials in clear text for Production purposes is a really bad idea; but just in case, the password here is in clear text for demonstration purposes only!
Write-Host "Multiple_Resources_CentOS - Configuration Loaded"
Ensures that the scom-svc-ubuntu user is present.
Ensures that the root and scom-svc-ubuntu users are members of the scom-svc-users group.
Ensures that the cron service is running.
Resets the password of the scom-svc-ubuntu user account.
Write-Host "Multiple_Resources_Ubuntu - Configuration Loaded"
This week’s post has demonstrated how to manage Multiple Resource in Linux using PowerShell DSC. Hopefully, this has given you some ideas on how you can template resource management for your Linux Environment.