Coder Social home page Coder Social logo

Comments (6)

bronandrews avatar bronandrews commented on August 28, 2024

I see there is a new RolesFilePath property...I could try to use that to pick up file content on the client ?
But what OctopusDSC module version is this in? The only module downloading for me is 2.0.26, which does not have this new property.

from octopusdsc.

matt-richardson avatar matt-richardson commented on August 28, 2024

Hi @bronandrews. @drryu had a similar request but found a workaround in that they could use an environment variable for this. You could have a script resource that sets the environment variable, and then the cTentacleAgent resource could read that.

Let me know how you go with that.

from octopusdsc.

drryu avatar drryu commented on August 28, 2024

Hi @matt-richardson @bronandrews, this is still an issue.

Doesn't look like DSC allows variables to be set at run-time (http://stackoverflow.com/questions/29640108/can-i-have-dynamic-variables-in-dsc-file-resource), even with environment variables.

The environment variables are in-place replaced when the mof is generated (server) and not on the client where it is run.

The best workaround I have found is to be write a file to client machine and then have the resource read from the file when installing the agent.

I have created a pull request with this feature. Please review.

from octopusdsc.

bronandrews avatar bronandrews commented on August 28, 2024

@drryu Thanks for confirming,
I didn't think Environment variables would work as the Roles property seems to resolve when the mof is generated, no matter what you do!
@matt-richardson Can we reopen this issue?

Is your workaround using the new RolesFilePath property? - I saw your Pull Request on that.
Will that definitely resolve at runtime, as opposed to mof creation time?

I tried something like that with the Roles property
i.e.
Script Resource had:
$RolesToUse > C:\RolesToUse.txt

and then the cTentacleAgent Resource had:
Roles = Get-Content C:\RolesToUse.txt

But it still looked for the file locally on the server while creating the mof file, and never read the client one at runtime.

If this new RolesFilePath property works I'd like to try it.
Is that available in a release yet?
The latest module version that downloads is 2.0.26 which does not have it.
Many thanks.

from octopusdsc.

bronandrews avatar bronandrews commented on August 28, 2024

Hi - any update on my queries?
Is the workaround to use RolesFilePath property? and how what version can I get which incorporates that?

Many thanks!

from octopusdsc.

matt-richardson avatar matt-richardson commented on August 28, 2024

Hi @bronandrews

That PR has not been merged as I'm not convinced its the best approach. I think its probably better to follow the approach outlined in how to separate configuration and environment data.

Let me know how that works for you.

from octopusdsc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.