southalc / types Goto Github PK
View Code? Open in Web Editor NEWManage ALL Puppet types or defined types from hiera
Manage ALL Puppet types or defined types from hiera
I'm bashing my head against a wall trying to get a template function to work on a file resource using types module. I am running Open Source Puppet 7.9 as part of Satellite 6.13. My heira code is;
types::file:
/path/to/my/file:
ensure: present
owner: root
content: template('mymodule/myfile.erb')
The generated file does not contain myfile.erb instead it contains the string; "template('mymodule/myfile.erb')"
Hello,
I'm running Opensource Puppet Server 7.4.2 and Puppet clients 7.16 on RHEL 8.6
I'm loading a bunch of modules like puppet-archive and puppet-rhsm. They provide some types (archive and rh_repo) I have defined calling them in hiera like so;
types::archive:
/tmp/somezipfile.zip:
ensure: 'present'
Yet they get completely ignored no error messages nothing. Yet other types such as puppetlabs-stdlib which provides file_line work perfectly well using the same format. I can't figure out how why this is? Since the type work if I put them in a puppet manifest and call that as class I figure it must be an issue with types not picking up the declaration?
types::file:
/tmp/testfile:
ensure: file
content: |
--testing
The above code will create a nuke file /tmp/testfile. However, the following code will create a file with the content 'testing':
types::file:
/tmp/testfile:
ensure: file
content: |
testing
This only happen in Puppet Enterprise, but not satellite. However, I cannot recreate the problem with the following .pp code:
file { '/tmp/testfile':
content => '--testing',
}
It will create a file with --testing as its content, even though there is no newline at the end of the file.
The following code will also create a null file:
types::file:
/tmp/testfile:
ensure: file
content: '--testing'
The following code will do the same thing:
types::file:
/tmp/testfile:
ensure: file
mode: '0444'
owner: 'root'
group: 'root'
content: |
-%{'nullvar'}-testing
Is there a workaround? Can you specify it in hex?
I tried to use tpyes to create resources from defined types utilizing the python module:
classes:
- types
- python
types:types:
- 'python::pip'
types::file:
'/home/debian/HELLOWORLD':
ensure: 'file'
types::python::pip:
'tabulate':
ensure: 'present'
pip_provider: 'pip3'
pkgname: 'tabulate'
the types::file example works fine
the types::python::pip example does not work. There is no error when applying, it's just being ignored. -> The pip package is not being installed
I do not understand what I did wrong and would greatly appreciate help on this issue :)
Thanks in advance!
Hello,
I am trying to get the official apache module working with your types module.
What I´ve done in Hiera:
types::types:
- 'apache'
- 'apache::vhost'
types::apache:
service_ensure: 'stopped'
types::apache::vhost:
'user.example.com':
port: '80'
docroot: '/var/www/test'
The apache::vhost part is working fine. I just cannot get the "apache" part to work.
Here is the error I am getting:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Expected value of type Hash, got String (file: /etc/puppetlabs/code/environments/production/modules/types/manifests/type.pp, line: 15, column: 23) (file: /etc/puppetlabs/code/environments/production/modules/types/manifests/init.pp, line: 39) on node server1.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Can you please help me out?
As shown with current master (96fee8e):
[tore:~/types] master ± puppet parser validate plans/hiera.pp
/usr/share/ruby/vendor_ruby/puppet/util.rb:461: warning: URI.escape is obsolete
Error: Could not parse for environment production: Syntax error at 'targets' (file: /home/tore/types/plans/hiera.pp, line: 8, column: 14)
Puppet package/version is puppet-5.5.20-2.fc33.noarch
(which is supported if https://forge.puppet.com/modules/southalc/types is to be believed).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.