Atenciosamente,
Rafael Tomelin
skype: rafael.tomelin
E-mail: rafael....@gmail.com
RHCE - Red Hat Certified Engineer
PPT-205 - Puppet Certified Professional 2017
Zabbix - ZABBIX Certified Specialist
LPI3
ITIL v3
--Atenciosamente,
Rafael Tomelin
skype: rafael.tomelin
E-mail: rafael....@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...@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.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CANa5_qJXKBnJQKH-6zW7mr3Osk%2BrwLPvMXg5zX_CwbN3fP9BAw%40mail.gmail.com.
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...@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.
For more options, visit https://groups.google.com/d/optout.
cat lib/puppet/type/foo.rb
require 'puppet/resource_api'
Puppet::ResourceApi.register_type(
name: 'foo',
docs: <<-EOS,
This type provides Puppet with the capabilities to manage ...
EOS
features: [],
attributes: {
ensure: {
type: 'Enum[present, absent]',
desc: 'Whether this resource should be present or absent on the target system.',
default: 'present',
},
name: {
type: 'String',
desc: 'The name of the resource you want to manage.',
behaviour: :namevar,
},
},
)
My provider:
cat lib/puppet/provider/foo/foo.rb
require 'puppet/resource_api/simple_provider'
# Implementation for the foo type using the Resource API.
class Puppet::Provider::Foo::Foo < Puppet::ResourceApi::SimpleProvider
def get(_context)
[
{
name: 'foo',
ensure: 'present',
},
{
name: 'bar',
ensure: 'present',
},
]
end
def create(context, name, should)
context.notice("Creating '#{name}' with #{should.inspect}")
end
def update(context, name, should)
context.notice("Updating '#{name}' with #{should.inspect}")
end
def delete(context, name)
context.notice("Deleting '#{name}'")
end
end
class first_type {
foo{ 'my_type':
ensure => present,
}
}
What`s problem : Could not autoload puppet/type/foo: no such file to load -- puppet/resource_api
The provider write the ruby, is possible create provider with python? If yes, is change ruby to python?
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CALF7fHa5_QY%2BjKzW5tzw8YL4FVXSBzAvheHKp_i1VbhOLXXhhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAGEUqbB-PsmNt0hzjoJWARd7285O%2BgHwAeqqC4qNv_zH1dWLPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CALF7fHY-eyUzWRdTaojGU9jfFdV-5DuGLkMG4h_KoZCAw4WBRg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.