Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Providers: Scope of Variable Requiring @resource[]

$
0
0
I am trying to set the following variable in my powershell provider for IIS. $identityType_alias = case @resource[:identitytype] when 0, :LocalSystem then 0 when 1, :LocalService then 1 when 2, :NetworkService then 2 when 3, :SpecificUser then 3 when 4, :ApplicationPoolIdentity then 4 else 4 end The trouble that I am experiencing is where to initialize it. If i set it at the start along with all other top-scope variables, @resource doesn't exist yet and it falls on it's face. I have temporarily just defined it each time I call on it but I know there is a better way to do this and the reproduction of code unnecessarily bothers me. Specifically, this variable is used within the Create and Flush methods so it needs a scope appropriate to both of those.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>