Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Otter - PsDsc option unavailable in Configuration Plan editor



  • I'm currently using Otter Server 1.0.1 and am trying to configure a PS DSC resource for a target server.

    However, I can't seem to figure out how to do it. The documentation mentions a PsDsc function, but when i go to add a Configuration to the Server, there's no PsDsc option as an available command. I see PSExec, PSEnsure, and PSCall (after I create a script asset), but no PsDsc.

    Is there something I have to do beforehand before the option becomes available (like PSCall not being visible if there's no scripts in assets)?

    Also, is there any additional documentation about the PsDsc function? I'm really interested in it, but the documentation doesn't mention many things, such as how it works given that PS DSC is based on a 1 configuration file per target server method, and this seems to imply the ability to just add "resources" as needed (which would be very cool). Does the Otter PsDsc simply execute multiple push configurations for each attached resource?



  • The PSDsc Operation does not currently have an editor, so you have to add it in Text Mode. When you switch back to Visual Mode, however, it will persist, but just will not be editable until you go back to text mode.

    The PSDsc Operation's default (positional) argument is the resource name, and the arguments are whatever that resource takes as arguments. For example, the xWebAppPool resource would be invoked as follows.

    PSDsc xWebAppPool (
      Name: AccountsAppPool,
      Ensure: present
    );
    

    This operation will invoke a DSC resource directly, without needing to create a configuration document. This resources is invoked on whatever server is in context, so you can easily do something like...

    foreach server in @SomeList
    {
        PSDsc xWebAppPool (
          Name: AccountsAppPool,
          Ensure: present  
        );
    }        
    

    Note that, the invoked resource will need to be available on the targeted machine, and the refresh mode of the Local Configuration Manager (LCM) must be Disabled.

    Otter uses Microsoft's recommend entry point for third-party CM tools such as Otter, so it should hopefully be fairly straightforward.



  • Hi Steve, thank you for your replay and clarification.

    I've set the LCM refresh to disabled on the target machine, and installed WMF 5.0 Production Preview (latest available version). I created the following in text mode for the target server (Win2012 R2):

    PSDsc WindowsFeature (
    Name: 'Windows-Server-Backup',
    Ensure: 'Present'
    );

    When I ran that, however, I received the following error:
    Unhandled exception: System.InvalidOperationException: The ConfigurationKey property of the PersistedConfiguration returned null. Make sure that the configuration either overrides this property, or specifies both ConfigurationKeyAttribute and PersistentAttribute attributes on the property.
    at Inedo.Otter.Extensibility.Configurations.PersistedConfiguration.Persist(ConfigurationPersistenceContext context)
    at Inedo.Otter.PlanExecuter.OtterPlanExecuterBase.<PerformCollection>d__40.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Inedo.Otter.PlanExecuter.OtterPlanExecuterBase.<Inedo-ExecutionEngine-Executer-IExecutionHostEnvironment-ExecuteActionAsync>d__39.MoveNext()



  • Ah, yes... definitely a bug. Seems to be related to some unanticipated changes in the latest WMF preview, but easy for us to fix. Can you please try upgrading to v1.0.3?

    Also please note that, due to a bug in the latest WMF5, it now appears you may need to specify a module name for some non-built in resources; it's supposed to be optional, and search all installed modules if not specified. We don't know when Microsoft will fix this, but the work-around is fairly simple:

    PSDsc xWebAdministration::xWebAppPool  (
      Name: AccountsAppPool,
      Ensure: present  
    );


Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation