Yes, Esuqeci had already altered or removed the following lines: defaultfor: operatingsystem =>: linux confine: operatingsystem =>: linux
But it had no effect Em sex, 21 de set de 2018 às 17:52, Nick Lewis <n...@puppet.com> escreveu: > On Fri, Sep 21, 2018 at 1:34 PM Rafael Tomelin <rafael.tome...@gmail.com> > wrote: > >> Hi guys, >> >> I am creating a type in custom provider, but I am not able to understand >> the following question. >> >> I created a basic type to understand the concept of things, as follows: >> Puppet::Type.newtype(:mydir) do >> @doc = "First custom type." >> >> ensurable do >> defaultvalues >> defaultto :present >> end >> >> newparam(:name, :namevar => true) do >> end >> >> newparam(:install_location) do >> end >> end >> >> >> After creating the provider, but does not recognize the same and displays >> the following error: >> Error: Could not find a suitable provider for mydir >> Notice: Applied catalog in 0.63 seconds >> >> Puppet::Type.type(:mydir).provide(:linux) do >> >> defaultfor :operatingsystem => :linux >> confine :operatingsystem => :linux >> >> commands :mkdir => "mkdir" >> commands :rm => "rm" >> >> def exists? >> Puppet.info("checking if is already deployed") >> deploy_dir = "#{resource[:install_location]}/#{resource[:name]}" >> >> File.directory?(deploy_dir) and Dir.entries(deploy_dir).size > 2 >> end >> >> def create >> Puppet.info("Deploying the appliction") >> deploy_dir = "#{resource[:install_location]}/#{resource[:name]}" >> >> mkdir('-p', deploy_dir) >> end >> >> def destroy >> Puppet.info("Removing the appliction") >> deploy_dir = "#{resource[:install_location]}/#{resource[:name]}" >> rm('-rf',deploy_dir) >> end >> end >> >> What I did not envisage is how Puppet identifies the provider to be >> used in the OS? >> > > It looks like the trouble here is that "linux" isn't a valid value for > operatingsystem. If you look at some examples in puppet, you can see that > common values of operatingsystem are like "fedora", "centos", "suse". The > fact you want to use here is osfamily, which *is* "linux". > > >> -- >> >> Atenciosamente, >> >> Rafael Tomelin >> >> skype: rafael.tomelin >> >> E-mail: rafael.tome...@gmail.com >> >> RHCE - Red Hat Certified Engineer >> PPT-205 - Puppet Certified Professional 2017 >> Zabbix - ZABBIX Certified Specialist >> LPI3 >> ITIL v3 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to puppet-users+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/puppet-users/CAGEUqbCtgp2bo7CN8STqDxq5L4WZLCJXNT%2Buq7-qzpvVYaL3%2Bg%40mail.gmail.com >> <https://groups.google.com/d/msgid/puppet-users/CAGEUqbCtgp2bo7CN8STqDxq5L4WZLCJXNT%2Buq7-qzpvVYaL3%2Bg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/CANa5_qJXKBnJQKH-6zW7mr3Osk%2BrwLPvMXg5zX_CwbN3fP9BAw%40mail.gmail.com > <https://groups.google.com/d/msgid/puppet-users/CANa5_qJXKBnJQKH-6zW7mr3Osk%2BrwLPvMXg5zX_CwbN3fP9BAw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Atenciosamente, Rafael Tomelin skype: rafael.tomelin E-mail: rafael.tome...@gmail.com RHCE - Red Hat Certified Engineer PPT-205 - Puppet Certified Professional 2017 Zabbix - ZABBIX Certified Specialist LPI3 ITIL v3 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAGEUqbACVDjowt3yYWzKG7GFzP%2BjZKmxrrr5jg4P4g01dfciFQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.