Closed nealpeters86 closed 2 years ago
But we're having issue's doing that (yes I know puppet also supports Chocolatey, but we want to do it the DSC way).
That's fine, just keep in mind that the DSC way is much more limited currently than the Puppet supported puppetlabs/chocolatey module (which supports completely offline scenarios better than cChoco. Also not chocolatey/chocolatey - the supported module has chocolateysource, chocolateyconfig, and chocolateyfeature as well as package). However it is hoped that the DSC will achieve a bit more parity at some point this year as compared to the Puppet provider.
As for the issues you are running into, I imagine @jpogran or someone else will answer that.
@nealpeters86 Believe it or not, the manifest file parser had a bug (line 21) in it which meant it expected single quotes in the psd1 file, and the cChoco DSC Resource is the first to use double quotes.
After editing the regex, we correctly parse the file. I'll put up a PR in abit with the fix
~/src/puppetlabs/modules/dsc> git s
M build/dsc/psmodule.rb
?? lib/puppet/type/dsc_cchocoinstaller.rb
?? lib/puppet/type/dsc_cchocopackageinstaller.rb
?? lib/puppet/type/dsc_cchocosource.rb
?? lib/puppet_x/dsc_resources/cChoco/
Note that the cChocoPackageInstallerSet
Composite DSC Resource won't be parsed as Composite DSC Resources don't have a MOF schema file and can't be parsed at this time.
Addressed in #282
Hi,
Puppet will be shutting down the github issues tab in this repository as there already is a publicly accessible issue tracker on March 24th, 2017.
If you want to continue the discussion from this issue, please follow the ticket already created from this issue (typically MODULES-XXXX) in our issue tracker.
If you would like to file a new issue, please follow the template here to create a new ticket.
Thanks,
James Pogran
Hello! We are doing some house keeping and noticed that this issue has been open for a long time.\n\nWe're going to close it but please do raise another issue if the issue still persists. 😄
Hello,
We are trying to compile the cChoco module (https://github.com/PowerShellOrg/cChoco). But we're having issue's doing that (yes I know puppet also supports Chocolatey, but we want to do it the DSC way).
CentOS Linux release 7.3.1611 (Core) ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
The steps that we took:
In the following directory: [root@puppetmaster02 custom]# pwd /etc/puppetlabs/code/environments/production/modules/dsc/build/vendor/custom
1) git clone https://github.com/PowerShellOrg/cChoco.git 2) verified that the directory name and the PSD1 filename are the same. 3) Directory structure looks like this:
[root@puppetmaster02 cChoco]# ls -l total 32 drwxr-xr-x. 2 root root 4096 Feb 20 14:53 AppVeyor -rw-r--r--. 1 root root 914 Feb 20 14:53 appveyor.yml -rw-r--r--. 1 root root 495 Feb 20 14:53 cChoco.psd1 drwxr-xr-x. 6 root root 4096 Feb 20 14:53 DSCResources -rw-r--r--. 1 root root 1580 Feb 20 14:53 ExampleConfig.ps1 drwxr-xr-x. 2 root root 4096 Feb 20 14:53 Examples -rw-r--r--. 1 root root 2202 Feb 20 14:53 readme.md drwxr-xr-x. 2 root root 4096 Feb 20 14:53 Tests [root@puppetmaster02 cChoco]# pwd /etc/puppetlabs/code/environments/production/modules/dsc/build/vendor/custom/cChoco
4) after making sure all the files are in place we did the following:
4a) in folder: [root@puppetmaster02 build]# pwd /etc/puppetlabs/code/environments/production/modules/dsc/build
4b) runned the following command bundle exec rake dsc:resources:import["build/vendor/custom"]
4c) good results! [root@puppetmaster02 build]# bundle exec rake dsc:resources:import["build/vendor/custom"] (in /etc/puppetlabs/code/environments/production/modules/dsc) Importing custom types from '/etc/puppetlabs/code/environments/production/modules/dsc/build/vendor/custom' Copying vendored resources from /etc/puppetlabs/code/environments/production/modules/dsc/build/vendor/custom to /etc/puppetlabs/code/environments/production/modules/dsc/lib/puppet_x/dsc_resources Adding custom types to '/etc/puppetlabs/code/environments/production/modules/dsc/import/dsc_resources'
5) now we need to rebuild the module with the following command: bundle exec rake dsc:types:build
5a) [root@puppetmaster02 build]# pwd /etc/puppetlabs/code/environments/production/modules/dsc/build
5b) run the command: bundle exec rake dsc:types:build
5c) We're getting a lot of things now. But at the end we have the following:
open /etc/puppetlabs/code/environments/production/modules/dsc/import/dsc_resources/xWindowsUpdate/DscResources/MSFT_xMicrosoftUpdate/MSFT_xMicrosoftUpdate.schema.mof [pragma] open /etc/puppetlabs/code/environments/production/modules/dsc/import/dsc_resources/xWindowsUpdate/DscResources/MSFT_xWindowsUpdate/MSFT_xWindowsUpdate.schema.mof [pragma] open /etc/puppetlabs/code/environments/production/modules/dsc/import/dsc_resources/xWindowsUpdate/DscResources/MSFT_xWindowsUpdateAgent/MSFT_xWindowsUpdateAgent.schema.mof [pragma] open /etc/puppetlabs/code/environments/production/modules/dsc/import/dsc_resources/xWordPress/DscResources/MSFT_xWordPressSite/MSFT_xWordPressSite.schema.mof [pragma] rake aborted! NoMethodError: undefined method'
Tasks: TOP => dsc:types:build
(See full trace by running task with --trace)
empty?' for nil:NilClass /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/psmodule.rb:13:in
version' (erb):81:inblock (2 levels) in build_dsc_types' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:187:in
block (2 levels) in build_dsc_types' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:186:inopen' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:186:in
block in build_dsc_types' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:178:ineach' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:178:in
build_dsc_types' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc.rake:228:inblock (3 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in
eval' /usr/local/rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in `I've runned the task with the --trace and then we have the following output
open /etc/puppetlabs/code/environments/production/modules/dsc/import/dsc_resources/xWindowsUpdate/DscResources/MSFT_xWindowsUpdate/MSFT_xWindowsUpdate.schema.mof [pragma] open /etc/puppetlabs/code/environments/production/modules/dsc/import/dsc_resources/xWindowsUpdate/DscResources/MSFT_xWindowsUpdateAgent/MSFT_xWindowsUpdateAgent.schema.mof [pragma] open /etc/puppetlabs/code/environments/production/modules/dsc/import/dsc_resources/xWordPress/DscResources/MSFT_xWordPressSite/MSFT_xWordPressSite.schema.mof [pragma] rake aborted! NoMethodError: undefined method'
/usr/local/rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in '
empty?' for nil:NilClass /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/psmodule.rb:13:in
version' (erb):81:inblock (2 levels) in build_dsc_types' /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/erb.rb:864:in
eval' /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/erb.rb:864:inresult' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:187:in
block (2 levels) in build_dsc_types' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:186:inopen' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:186:in
block in build_dsc_types' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:178:ineach' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc/manager.rb:178:in
build_dsc_types' /etc/puppetlabs/code/environments/production/modules/dsc/build/dsc.rake:228:inblock (3 levels) in <top (required)>' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/task.rb:240:in
block in execute' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/task.rb:235:ineach' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/task.rb:235:in
execute' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/task.rb:179:inblock in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/monitor.rb:214:in
mon_synchronize' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/task.rb:172:ininvoke_with_call_chain' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/task.rb:165:in
invoke' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:150:ininvoke_task' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:106:in
block (2 levels) in top_level' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:106:ineach' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:106:in
block in top_level' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:115:inrun_with_threads' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:100:in
top_level' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:78:inblock in run' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:176:in
standard_exception_handling' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/lib/rake/application.rb:75:inrun' /usr/local/rvm/gems/ruby-2.3.3/gems/rake-10.5.0/bin/rake:33:in
<top (required)>' /usr/local/rvm/gems/ruby-2.3.3/bin/rake:22:inload' /usr/local/rvm/gems/ruby-2.3.3/bin/rake:22:in
eval' /usr/local/rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:15:in
Are we doing something wrong? :-)