Re: [Puppet Users] Puppetserver failing to start on a brand new Debian 12 VM

2024-04-23 Thread Martin Alfke
> On 23. Apr 2024, at 14:21, kristian...@gmail.com > wrote: > > I see > > root@puppetserver:~# apt policy puppetserver > puppetserver: > Installed: 7.9.5-2 > Candidate: 7.9.5-2 > Version table: > *** 7.9.5-2 500 > 500 http://deb.debian.org/debian bookworm/main amd64

Re: [Puppet Users] Puppetserver failing to start on a brand new Debian 12 VM

2024-04-23 Thread Martin Alfke
> On 23. Apr 2024, at 10:31, 'Dirk Heinrichs' via Puppet Users > wrote: > > Am Dienstag, dem 23.04.2024 um 10:29 +0200 schrieb Dirk Heinrichs: > >> Not true. They exist since years: > > Or did you mean "... for Debian 12"? Yes. As far as I know there are no packages for puppetserver and

Re: [Puppet Users] Puppetserver failing to start on a brand new Debian 12 VM

2024-04-23 Thread Martin Alfke
> On 23. Apr 2024, at 08:50, 'Dirk Heinrichs' via Puppet Users > wrote: > > Am Montag, dem 22.04.2024 um 22:55 -0700 schrieb kristian...@gmail.com > : > >> So the issue is not in the upgrade, but some general issue in Debian 12 and >> Puppet 7. > > Did you

Re: [Puppet Users] Problem with exported ressource file.

2024-03-30 Thread Martin Alfke
> On 30. Mar 2024, at 09:35, Albert Shih wrote: > > Le 29/03/2024 à 18:46:47+0100, Martin Alfke a écrit >> > Hi, > >>> If I do something like >>> >>> $group_hosts.each | String $host | { >>> @@file { "file for ${host}"

Re: [Puppet Users] Problem with exported ressource file.

2024-03-29 Thread Martin Alfke
> On 29. Mar 2024, at 14:37, Albert Shih wrote: > > Hi, > > I'm not 100% sure it's a bug, just 99%. What do you think ? > > If I do something like > > $group_hosts.each | String $host | { >@@file { "file for ${host}": > ensure => present, > path => '/etc/something.conf',

Re: [Puppet Users] fstab not updated by mountpoint ensure absent

2024-01-30 Thread Martin Alfke
Hi Miriam, You showed us some yaml (I assume hiera) data. We cannot say for sure what these data do. Can you please also provide the puppet code which should use the data? Hth, Martin > On 30. Jan 2024, at 14:25, Miriam Olmi > wrote: > > I mounted a shared file system on a couple of

Re: [EXTERNAL] - [Puppet Users] Puppet (open source) Web Interface

2023-12-15 Thread Martin Alfke
> > > Thank you, > > Ferdana > On Tuesday, December 12, 2023 at 7:05:49 PM UTC+7 Martin Alfke wrote: >> Besides foreman there is puppetboard which shows reports and facts from >> puppetdb. >> >> https://github.com/voxpupuli/puppetboard >> >> Hth,

Re: [EXTERNAL] - [Puppet Users] Puppet (open source) Web Interface

2023-12-12 Thread Martin Alfke
Besides foreman there is puppetboard which shows reports and facts from puppetdb. https://github.com/voxpupuli/puppetboard Hth, Martin > On 12. Dec 2023, at 11:20, 'Dirk Heinrichs' via Puppet Users > wrote: > > Am Sonntag, dem 10.12.2023 um 20:11 -0800 schrieb Ferdana Syaputra: > >> 1.

Re: [Puppet Users] convert hiera value to string array using lookup in hiera

2023-11-13 Thread Martin Alfke
Hi, Lookup always returns strings. You can use alias to retrieve the original value data type. https://www.puppet.com/docs/puppet/7/hiera_merging.html#alias-function Hth, Martin > On 13. Nov 2023, at 17:35, 'Tidhar Klein Orbach' via Puppet Users > wrote: > > Hi, > > I have a hiera file

Re: [Puppet Users] Error 500 on SERVER undefined method safe_load

2023-11-09 Thread Martin Alfke
> On 8. Nov 2023, at 20:17, James Millsap wrote: > > Thank you very much for the reply! We are running these versions... > > puppetserver version: 5.3.11 > ruby 2.0.0p648 > psych (2.0.0) > hiera 3.12.0 That is super outdated Puppet version. Can you please check the puppetserver log file.

Re: [Puppet Users] ERROR Facter - Error while resolving custom fact fact='letsencrypt_directory', resolution='': header too long

2023-09-21 Thread Martin Alfke
The fact reads certificates from several lets encrypt directories. See https://github.com/voxpupuli/puppet-letsencrypt/blob/master/lib/facter/letsencrypt_directory.rb I see in our code snippet, that you create empty files as cert files. Can you please check that the files in the directories are

Re: [Puppet Users] Call puppet define from Hiera

2023-08-31 Thread Martin Alfke
You either need a appconfig/manifests/init.pp class, or you can make use of stdlib::manage class and add the defined type to hiera See examples in https://dev.to/betadots/puppet-is-yaml-2e32 > On 28. Aug 2023, at 21:23, Ben Parry wrote: > > Puppeteers, > > I am bashing my head against a wall

Re: [Puppet Users] How to create new tickets now?

2023-08-31 Thread Martin Alfke
Hi Dirk, Maybe this one? https://puppet.atlassian.net/jira/projects Hth, Martin > On 25. Aug 2023, at 15:49, 'Dirk Heinrichs' via Puppet Users > wrote: > > Hi, > > PuppetLabs seems to have migrated https://tickets.pupptlabs.com > to a cloud-based Jira

Re: [Puppet Users] Puppet8 'lookup' fails when Puppet7 succeeds

2023-08-24 Thread Martin Alfke
Hi Jon, Do you have a node named “puppet.staging” running against you puppet staging environment? The —node option reads nodes facts from PuppetDB. That means that you must have anode connected to the puppet server where sou want to run the puppet lookup command. Hth, Martin > On 23. Aug

Re: [Puppet Users] Custom Fact Deployment

2023-08-07 Thread Martin Alfke
Hi Alessandro, There are two options on how to deploy external facts: 1. Manual: Place the executable bash script in /etc/puppetlabs/facter/facts.d 2. Automatic (using a module) Add the script (with executable flag) to a module in path facts.d/ Pluginsync will then deploy the bash script to

Re: [Puppet Users] Puppetserver7 or 8 support for Ubuntu Jammy 22.04 LTS

2023-05-12 Thread Martin Alfke
Packages for Jammy are expected to be available in Q3 2023. > On 11. May 2023, at 20:07, rbmr...@gmail.com wrote: > > Hi Team, > Do we have a puppetserver opensource package for Ubuntu 'jammy' > 22.04? > I tried and installed repository from >

Re: [Puppet Users] saz-ssh, hiera and options

2023-05-02 Thread Martin Alfke
another question, how can I specify different values in Hiera for > different operating systems? > > For example AuthorizedKeysCommand needs a different value in Linux and > FreeBSD? > > On Tuesday, May 2, 2023 at 3:51:20 AM UTC-4 Martin Alfke wrote: >> Hi, >> >

Re: [Puppet Users] saz-ssh, hiera and options

2023-05-02 Thread Martin Alfke
Hi, Ssh::server class has a parameter called “match_block” which calls a defined type: https://github.com/saz/puppet-ssh/blob/master/manifests/server/match_block.pp The defined type uses a template: https://github.com/saz/puppet-ssh/blob/master/templates/sshd_match_block.erb A hiera example is

Re: [Puppet Users] hiera, template and array

2023-03-29 Thread Martin Alfke
parse > template site/ntp/ntp.conf.epp: > Filepath: /etc/puppetlabs/code/modules/site/templates/ntp/ntp.conf.epp > Line: 3 > Detail: undefined local variable or method `’servers’' for > # > (file: /etc/puppetlabs/code/modules/site/manifests/profiles/ntp.pp, line: >

Re: [Puppet Users] hiera, template and array

2023-03-28 Thread Martin Alfke
rver: ".freeze; _erbout.<<((... >^ > Warning: Not using cache on failed catalog > Error: Could not retrieve catalog; skipping run > > On Tuesday, March 28, 2023 at 2:57:23 AM UTC-4 Martin Alfke wrote: >> You must iterate as servers is an array: >>

Re: [Puppet Users] hiera, template and array

2023-03-28 Thread Martin Alfke
You must iterate as servers is an array: <% $servers.each |$server| { -%> server: <%= $server %> <%- } -%> > On 27. Mar 2023, at 22:21, Laci D wrote: > > I'm working on defining NTP servers from Hiera. > > For Linux servers I have been using puppetlabs-ntp, which has been working > nicely.

Re: [Puppet Users] Enc forcing environment even passed via command line

2023-01-13 Thread Martin Alfke
on their name like > -E tejas -E xyz like that and run in noop so after make sure our changes > work proper we can commit it in git . > > On Thursday, 12 January 2023 at 16:48:52 UTC+5:30 Martin Alfke wrote: >> Hi Tejas, >> >> It looks like you are using an ENC >&g

Re: [Puppet Users] Enc forcing environment even passed via command line

2023-01-12 Thread Martin Alfke
Hi Tejas, It looks like you are using an ENC (https://www.puppet.com/docs/puppet/7/nodes_external.html#comparing_encs_and_node_definitions) This can either be Puppet Enterprise or Foreman. These can force a node to make use of a specific environment only and it forbids switching Puppet

Re: [Puppet Users] Puppet filters

2022-12-18 Thread Martin Alfke
Hi Nir, do you only need the capacity from the root file system? You can access the data hash directly: $facts['mountpoints']['/']['capacity'] hth, Martin > On 18. Dec 2022, at 08:44, Nir Fishler wrote: > > Hey Guys, > > I'm trying to pull data from an array using the 'mountpoints' facter

Re: [Puppet Users] Using VS Code with PDK -- how can I manually run puppet-lint?

2022-12-05 Thread Martin Alfke
PDK allows you to also run rake tasks pdk bundle exec rake -T Gives you an overview on available rake tasks. > On 5. Dec 2022, at 07:08, Dan Mahoney wrote: > > It turns out the answer to my second question is: > > gem install voxpupuli-puppet-lint-plugins > > ...which seems to be a meta

Re: [Puppet Users] Create a variable out of a bash command and notify it

2022-12-04 Thread Martin Alfke
Hi Nir, You want to collect information on nodes and you want to use this information in a catalog. This is what facter is used for. /lib/facter/upgradable_packages.rb Facter.add(:upgradable_packages) do setcode do Facter::Core::Execution.execute("/usr/bin/apt --simulate upgrade | grep

Re: [Puppet Users] How to install puppet-server on centos stream 9?

2022-11-22 Thread Martin Alfke
Hi Ruinan, There are not (yet) packages for puppet server for RHEL 9 based distributions. http://yum.puppet.com/puppet7/el/9/x86_64/index.html At the moment you must use RHEL 8 based distribution for Puppet Server: http://yum.puppet.com/puppet7/el/8/x86_64/index.html Hth, Martin > On 21. Nov

Re: [Puppet Users] Error: Could not run: cannot load such file -- net/ssh/telnet

2022-11-17 Thread Martin Alfke
Hi, Your puppet agent is missing a ruby gem: https://rubygems.org/gems/net-ssh-telnet This gem must be installed using the puppet ruby gem command: /opt/puppetlabs/puppet/bin/gem install net-ssh-telnet Hth, Martin > On 15. Nov 2022, at 10:53, Mike wrote: > > Hi, > > I've come across the

Re: [Puppet Users] not possible to access parameters from subclass

2022-11-17 Thread Martin Alfke
Hi, The testa::config manifests does not contain a class, but a defined resource types. One can only access variables from included classes, but not from defined types. Hth, Martin > On 14. Nov 2022, at 15:29, Jens Kuehnel wrote: > > Hi all, > > I'm using puppet for quite some time - about

Re: [Puppet Users] Copy file from Agent to Master

2022-11-10 Thread Martin Alfke
Hi Dennis, Your email is a little bit confusing. On one hand you mention that you have a file on an agent, which you like to be copied to the puppet server. On the other hand you mention the file resource being copied from the puppet server. Solution 1: Make a file from the agent available to

Re: [Puppet Users] [PuppetDB] Error 500 'Failed to execute '/pdb/cmd/v1....'

2022-11-02 Thread Martin Alfke
a complete success. > > On Monday, October 31, 2022 at 12:14:31 PM UTC+2 Martin Alfke wrote: >> How did you configure puppetdb and puppetserver? >> On Open Source we usually recommend the puppetlabs-puppetdb module. >> >> >> >>> On 31. Oct 2022, at 10:39, Nir Fis

Re: [Puppet Users] Puppet agent is not running on Windows 11

2022-11-01 Thread Martin Alfke
Hi Stephan’s,, You can not run puppetserver on Windows. Puppetserver is a Linux only process. If you run Windows only, you can make use of the puppetserver docker container. hth, Martin > On 31. Oct 2022, at 17:32, Stephanos Economides > wrote: > > Hi Puppet Users, > > I am a new user of

Re: [Puppet Users] Resource default values from site.pp not applied

2022-10-31 Thread Martin Alfke
> Am Montag, dem 31.10.2022 um 15:10 +0100 schrieb Martin Alfke: > >> Is attribute the correct parameter of some_resource type? > > Yes. > >> You mention that notify returns the desired results, therefore I assume that >> hiera returns a proper value for ’some.

Re: [Puppet Users] Resource default values from site.pp not applied

2022-10-31 Thread Martin Alfke
Hi Dirk, Is attribute the correct parameter of some_resource type? You mention that notify returns the desired results, therefore I assume that hiera returns a proper value for ’some.key’. Which means that the if facts clause is also working as expected. Are you overwriting the Some_resource

Re: [Puppet Users] [PuppetDB] Error 500 'Failed to execute '/pdb/cmd/v1....'

2022-10-31 Thread Martin Alfke
> puppetdb-access.log > puppetdb.log > puppetdb-status.log > but all seem to be empty - 0kb > what does that mean? > > On Monday, October 10, 2022 at 11:03:05 AM UTC+3 Martin Alfke wrote: >> Hi Nir, >> >> Please check the puppetdb log file for further error inve

Re: [Puppet Users] PuppetDB - ERROR [p.p.config] No subname set in the "database" config`

2022-10-13 Thread Martin Alfke
unior Engineer/Project Management > > On Wed, 12 Oct 2022 at 15:37, Martin Alfke wrote: >> >> Hi Callum, >> >> in general we use Puppet to also manage the Puppet Server. >> Usually we recommend using puppetlabs-puppetdb, which will take care on >> postgres

Re: [Puppet Users] PuppetDB - ERROR [p.p.config] No subname set in the "database" config`

2022-10-12 Thread Martin Alfke
> > Kind regards, > Callum McCrorie > Junior Engineer/Project Management > > > > On Tue, 11 Oct 2022 at 08:52, Martin Alfke wrote: > Subname needs the PostgreSQL connection. Not the PuppetDB URL > > Wrong: > subname = //localhost:8081/puppetdb > &g

Re: [Puppet Users] PuppetDB - ERROR [p.p.config] No subname set in the "database" config`

2022-10-11 Thread Martin Alfke
Subname needs the PostgreSQL connection. Not the PuppetDB URL Wrong: subname = //localhost:8081/puppetdb Right: subname = //localhost:5432/puppetdb In my config all the database config is not in config.ini but in database.ini # /etc/puppetlabs/puppetdb/conf/database.ini [database] # The

Re: [Puppet Users] [PuppetDB] Error 500 'Failed to execute '/pdb/cmd/v1....'

2022-10-10 Thread Martin Alfke
Hi Nir, Please check the puppetdb log file for further error investigation. Usually this is located at /var/log/puppetlabs/puppetdb/puppetdb.log Hth, Martin > On 30. Sep 2022, at 10:30, Nir Fishler wrote: > > Hello, > > puppetserver version: 7.8.0 (CentOS 7) | hostname: puppet-staging-srv

Re: [Puppet Users] Getting started - yikes

2022-07-29 Thread Martin Alfke
Hi Chris, Please check the time synchronisation prior running the installer. Also check the system requirements page: https://puppet.com/docs/pe/2019.8/system_requirements.html Especially

[Puppet Users] Hiera Data Manager Demo available

2022-07-28 Thread Martin Alfke
Hi everyone, we would like to introduce our Hiera Data Manager - HDM. HDM is made available under an Open Source License and offers a web interface to analyze Hiera Data. Further information are available on the project website: https://github.com/betadots/hdm

Re: [Puppet Users] Bolt: How to upload a downloaded file?

2022-04-27 Thread Martin Alfke
Hi, You can reference the actual path by using pwd: bolt file upload $(pwd)/inventory.yaml /root/ -t login Hth, Martin > On 27. Apr 2022, at 14:24, Helmut Rickel wrote: > > Hello, > this surely is a beginners question: > Using bolt, I want to download a file from one server and upload it

Re: [Puppet Users] hiera 5 postgresql backend

2022-04-14 Thread Martin Alfke
Hi, We usually recommend to not use any other backend, except for file based backends, due to performance. Any other backend must be able to deliver the same lookup speed. We did a calculation at a customer and we saw hiera answering 8000 queries in less than 1 second using the yaml file

Re: [Puppet Users] Custom functions what way forward

2022-03-24 Thread Martin Alfke
Hi Baz, There are two APIs for custom types/providers within modern Puppet. The “old” API uses the Puppet::Type.newtype syntax. I gave a talk on this topic a couple of years ago: https://www.slideshare.net/PuppetLabs/puppetconf-2016-moving-from-exec-to-types-and-providers-martin-alfke-example42

Re: [Puppet Users] Ruby gem-ruby-shadow RPM on RHEL 8 ?

2022-03-21 Thread Martin Alfke
national Corporation (SAIC) > Office: (301) 286-6919 > Mobile: (240) 513-5290 > > From: Puppet-Users Mailing List <mailto:puppet-users@googlegroups.com>> on behalf of Martin Alfke > mailto:tux...@gmail.com>> > Reply-To: Puppet-Users Mailing List <mailto:puppet

Re: [EXTERNAL] [Puppet Users] Re: Ruby gem-ruby-shadow RPM on RHEL 8 ?

2022-03-21 Thread Martin Alfke
Shadow is part of the ruby installation inside the puppet agent. You can verify functionality: /opt/puppetlabs/puppet/bin/irb irb(main):001:0> require 'shadow' => true irb(main):002:0> exit root@node01:~# If you receive the “true” output after you run require ’shadow’ all is set and you can

Re: [Puppet Users] Puppet doens't sync from Master

2022-03-01 Thread Martin Alfke
try to force it, when I lunch puppet agent, the file will be overwritten. > > There is somewhere I can check? > > All the best > Alex > > On Tuesday, March 1, 2022 at 7:51:23 AM UTC Martin Alfke wrote: > Check on both nodes the content of files in > /opt/puppetla

Re: [Puppet Users] Puppet doens't sync from Master

2022-02-28 Thread Martin Alfke
Check on both nodes the content of files in /opt/puppetlabs/puppet/cache/state directory. Especially classes.txt and resources.txt. If file content differs between the two nodes, your classification is not identical. hth, Martin > On 28. Feb 2022, at 12:29, 'Alessandro Ciappei' via Puppet

Re: [Puppet Users] Nested hiera lookup

2022-01-28 Thread Martin Alfke
Hi Helmut, This is not working! Within hiera you can use alias or lookup to receive other hiera data values. But you can not combine a lookup with string. https://puppet.com/docs/puppet/7/hiera_merging.html#interpolation_functions-lookup-and-hiera-function

Re: [Puppet Users] Puppet Manifest using to_json_pretty help

2021-12-07 Thread Martin Alfke
class demo ( Array[Hash] $para5, ){ file { '/etc/example.json’: ensure => file, content => to_json_pretty({ section1 => { para1 => somevalue, para2 => somevalue, para3 => somevalue, para4 => somevalue, para5 => $para5, }, true), }

Re: [Puppet Users] Help with Bolt Puppet DSL example

2021-11-18 Thread Martin Alfke
Hi Sandra, Bolt has two options: tasks and plans. Tasks consist of a Script (Shell, Powershell, Python, Ruby) and a .json file. Plans are written in Puppet DSL. Main difference: Tasks run workflow actions like stop a service, do something and restart the service. Plans are used to control tasks

Re: [Puppet Users] how do puppet agent service record and determine next request timepoint?

2021-10-15 Thread Martin Alfke
Hi, Running puppet agent as a daemon is not recommended in large environments with many nodes. We usually recommend running puppet agent from cron instead. Reason: When running puppet agent as daemon: T0 - Puppet agent start T0+x - Puppet agent finishes. Now waits for runinterval time (default

Re: [Puppet Users] Hiera driving me round the bend

2021-10-14 Thread Martin Alfke
Hi David, You seem to mix up hiera and facts. Your node has facts: --- derivedsite: 'cp1' hostdb: role: 'development' businessowner: ‘Infrastructure' attributes: - 'DNS-Slave' - 'Oracle' applicationlist: - ‘test' Now hiera jumps in (hiera.yaml file) and uses the

Re: [Puppet Users] Puppet7 and Ansible = conflict

2021-08-27 Thread Martin Alfke
Hi Arpin, Sounds like an utf-8 problem: `to_json': source sequence is illegal/malformed utf-8 Please run the facter -j command on the windows system and check that it returns the values. Check which locale is configured when running ansible on the windows system. Hth, Martin > On 27. Aug

Re: [Puppet Users] Getting the location of the manifest file

2021-08-16 Thread Martin Alfke
Hi Go, what do you want to achieve? When using puppet apply, a manifest can be anywhere on the filesystem. Best, Martin > On 16. Aug 2021, at 03:18, Go Iwai wrote: > > Hello, > > I want to know the location where puppet-apply locally applied the > manifest file. > > $ pwd >

Re: [Puppet Users] Azure Ruby gems are not loading.

2021-07-16 Thread Martin Alfke
Hi Raghu, where do you use the require? Within a Puppet function or within a Puppet provider? Functions are running on the Puppet Server, whereas providers are executed on the agent. If you do the require in a Puppet provider, the gem must be installed on the puppet agent

Re: [Puppet Users] Override default schedule for all resources

2021-07-07 Thread Martin Alfke
Hi Christian, instead of running puppet as daemon, you can run puppet via cron and omit the times where you do maintenance on the puppet server. Besides this: running puppet via cron will allow you to spread the agent connections and compiler work in a far more efficient way, reducing temporary

Re: [Puppet Users] Determining puppet env from client

2021-06-22 Thread Martin Alfke
gt; find any fact in the PE console's fact dialog box. Have I misunderstood your > comment? > > Thanks > > On Tuesday, 22 June 2021 at 13:31:14 UTC+1 Martin Alfke wrote: > Hi Dave, > > On PE Console, select a Node to view Node facts and check the environment > Var

Re: [Puppet Users] Determining puppet env from client

2021-06-22 Thread Martin Alfke
Hi Dave, On PE Console, select a Node to view Node facts and check the environment Variable. This variable is set on Master side, not agent side. Check that the environment variable matches to the PE selected node environment. You should then be able to filter using the environment “Fact”.

Re: [Puppet Users] Hiera lookup in hiera lookup

2021-05-18 Thread Martin Alfke
Hi Erwin, Nested lookups are possible. We did a blog post on this topic: https://blog.example42.com/2020/01/21/hiera-nested-lookups/ Just be sure: A nested lookup (like in your example) always returns a string. If you need arrays

Re: [Puppet Users] Using the puppet gem on an unsupported platform

2021-03-19 Thread Martin Alfke
defaults0 0 > ``` > > I note that the catalog adds the mount as expected if puppet is installed via > an rpm from the puppetlabs site. > > Anyone know why this is working in `puppet apply` but not `puppet agent` when > installed via a gem, please? > &

Re: [Puppet Users] Using the puppet gem on an unsupported platform

2021-03-11 Thread Martin Alfke
as it's already in the > modulepath. Just noticed something odd, will prod a bit more (unfortunately > next week now). > > Best, > > Mark > > On Thursday, March 11, 2021 at 7:04:06 AM UTC Martin Alfke wrote: > Hi Mark, > > please check module path using 'puppet config pr

Re: [Puppet Users] Using the puppet gem on an unsupported platform

2021-03-10 Thread Martin Alfke
Hi Mark, please check module path using 'puppet config print modulepath' and install the required core modules into one of the mentioned folders: puppet module install puppetlabs-mount_core --target-dir This should make the mount resource type available. Best, Martin > On 10. Mar 2021, at

Re: [Puppet Users] How to stub a custom puppet function in every spec test?

2021-03-09 Thread Martin Alfke
condition) do > ' > function profile::read_url(String $arg) >> String { > return "ssh-rsa Azuozgouzvouzvf== u...@domain.tld" > } > ' > end > end > > RSpec.configure do |c| > c.include_context "read_url stub&quo

[Puppet Users] How to stub a custom puppet function in every spec test?

2021-03-05 Thread Martin Alfke
Hi, we use a custom function (extlib::read_url) which we want to stub for every profile and role class unit test. We tried using before within Spec.configure: RSpec.configure do |c| c.before :each do Puppet::Functions.create_function(:'profile::read_url') do dispatch :read_url do

Re: [Puppet Users] Hiera data repetition

2021-02-28 Thread Martin Alfke
user hash from all hierarchies, except for one system: # data/common.yaml lookup_options: profile::base::usermgmt::users: merge: 'deep' # data/nodes/.yaml lookup_options: profile::base::usermgmt::users: merge: 'first' Best, Martin > Regards > Karsten > > Am Sa., 27. Feb. 20

Re: [Puppet Users] Hiera data repetition

2021-02-27 Thread Martin Alfke
Hi > On 25. Feb 2021, at 11:59, Dmitry Nurislamov wrote: > > Hello. Sometimes it is desirable to define Hiera variables for usage in Hiera > itself, i.e. variables that won't be looked up from Puppet manifests. We do > this to avoid repetition. Here's an example of a variable used only in the

Re: [Puppet Users] Regarding managing packages

2021-02-26 Thread Martin Alfke
Hi, You need a class with a parameter. e.g. class profile::packages ( Array $pgk = {}, ){ $pkg.each |$package| { package { $package: ensure => present, } } And in hiera: profile::packages::pkg: - ‘htop’ - ‘less’ - ‘anyotherpackage’ Hth, Martin > On 26. Feb 2021, at

Re: [Puppet Users] No subname set in the "database" config

2021-02-13 Thread Martin Alfke
Hi Spriya, are you managing puppetdb with puppetdb module? https://puppet.com/docs/puppetdb/latest/install_via_module.html node { # Configure puppetdb and its underlying database class { 'puppetdb': } # Configure the Puppet master to use puppetdb class { 'puppetdb::master::config': } }

Re: [Puppet Users] create_resources

2021-02-07 Thread Martin Alfke
Hi, there are some minor not-best-practices in your code: 1. create_resource I prefer using lambda over create_resources as these allows explizit resource declaration which are then bound to the class. This gives you explizit ordering, which you must add if using create_resource. 2. explizit

Re: [Puppet Users] init config once

2021-01-29 Thread Martin Alfke
ing its contents during the first Puppet run. The next > > Puppet runs should ignore any changes. > > > > > > On Thu, 2021-01-28 at 20:07 +0100, Martin Alfke wrote: > > > and please use ensure => file ! > > > this is more clear. > > > you can

Re: [Puppet Users] init config once

2021-01-28 Thread Martin Alfke
and please use ensure => file ! this is more clear. you can set the file ensure attribute to one of the following: file, directory, link, absent > On 28. Jan 2021, at 18:58, Ben Ford wrote: > > Yep, just use the replace attribute on the file resource. >

Re: [Puppet Users] Windows exec resource cannot find command error

2020-12-09 Thread Martin Alfke
e due to spaces: > > exec { '"c:/program files/telegraf/telegraf.exe" --service install': > ... > > > On Monday, December 7, 2020 at 2:06:53 PM UTC-5 Martin Alfke wrote: > Have you tried using the full path to the executable? > > exec { 'c:/program fil

Re: [Puppet Users] Windows exec resource cannot find command error

2020-12-07 Thread Martin Alfke
Have you tried using the full path to the executable? exec { 'c:/program files/telegraf/telegraf.exe --service install' : ... } > On 7. Dec 2020, at 18:17, Michael Watters wrote: > > I have an exec resource in a manifest for our Windows nodes however the > command is failing each time that

Re: [Puppet Users] Looking up the value defined in the hiera.yaml

2020-11-30 Thread Martin Alfke
Hi Go, > On 24. Nov 2020, at 00:06, Go Iwai wrote: > > Hello Dirk, > > Thank you for replying to the mail. However, your code doesn't work for the > resource of exec like below: > > exec { '/path/to/decrypted-file': > command => 'eyaml decrypt --file=/path/to/encrypted-file > >

Re: [Puppet Users] Running plans from console

2020-11-06 Thread Martin Alfke
Hi Vinay, Difficult to help when we don’t see the code and where you have placed it. Where have you placed your Puppet task? Do you use a Git Puppet control-repo? In which module, which directory, which file name have you added your code? Running plans via PE Console requires that the plan is:

Re: [Puppet Users] Puppet Agent Gem Install

2020-10-23 Thread Martin Alfke
l didn’t work. Let me double check again. >> >> Best, >> >> Tony Wu >> >>> On Oct 20, 2020, at 10:51 PM, Martin Alfke >> <mailto:tux...@gmail.com>> wrote: >>> >>> Hi Tony, >>> >>> puppet functions are executed on the

Re: [Puppet Users] Puppet Agent Gem Install

2020-10-20 Thread Martin Alfke
Hi Tony, puppet functions are executed on the puppet server. You need to install the gem within the puppet server puppetserver gem install my gem Hth, Martin > On 20. Oct 2020, at 21:37, Tony Wu wrote: > > Hi, > > I have a agent side function that requires a gem, so I did: > >

Re: [Puppet Users] Puppet Enterprise version upgrade from 2019.1.0 to 2019.8.1

2020-10-16 Thread Martin Alfke
Hi Vinay, Newest PE version adds PuppetDB Rest API service to compilers. If you have a single master only, you can ignore this. If you are using additional compilers, you must enable access to PostgreSQL Database from compilers to the master. We did an update from 2019.1 to latest PE release

Re: [Puppet Users] Best way to exclude classes from a few nodes

2020-10-01 Thread Martin Alfke
6.15.0 > > Yes, I ran the lookup as root. > > On Thursday, October 1, 2020 at 11:40:49 AM UTC+1 Martin Alfke wrote: > Which version of puppet are you using? > Puppet 5 or puppert 6? > > And: did you ran the puppet lookup command as root user? (I assume so, I just > want

Re: [Puppet Users] Best way to exclude classes from a few nodes

2020-10-01 Thread Martin Alfke
; Thanks, > Dan. > > > On Thursday, October 1, 2020 at 11:24:04 AM UTC+1 Martin Alfke wrote: > Hi Dan, > > The puppet lookup explain told you what it has found: > > Environment Data Provider (hiera configuration version 5) > Using configuration > "

Re: [Puppet Users] Best way to exclude classes from a few nodes

2020-10-01 Thread Martin Alfke
os/%{facts.os.family}.yaml" > Path not found > Hierarchy entry "common" > Path > "/etc/puppetlabs/code/environments/production/modules/grubipv6disable/data/common.yaml" > Original path: "common.yaml" &g

Re: [Puppet Users] Best way to exclude classes from a few nodes

2020-09-28 Thread Martin Alfke
-- false > > Thanks, > Dan. > > > > On Monday, September 28, 2020 at 11:54:42 AM UTC+1 Martin Alfke wrote: > Hi Dan, > > I would write the grubipv6disable class in another way: > > class grubipv6disable ( > Boolean $enable, > ) { >

Re: [Puppet Users] Best way to exclude classes from a few nodes

2020-09-28 Thread Martin Alfke
hcsrvprdidm02.fixnetix.com.yaml > --- > grubipv6disable::enable: false > > Seems hiera is not being read. > > Any further help you can provide would be appreciated > > Thanks, > Dan. > On Friday, September 18, 2020 at 12:43:26 PM UTC+1 Martin Alfke wrote: > Add a

Re: [Puppet Users] Best way to exclude classes from a few nodes

2020-09-18 Thread Martin Alfke
Add a parameter to grubipv6disable class which controls the internal behaviour. https://puppet.com/docs/puppet/6.17/lang_classes.html#class-parameters-and-variables e.g. #

Re: [Puppet Users] [Puppet] Can't manage Puppet Certificates on the PuppetCA (404 error)

2020-08-26 Thread Martin Alfke
Hi, Usually you can do the cert management via Foreman web interface. If CLI is not working, please check that your Puppet 6 Master has a cert extension. If this is missing you can check our blog posting: https://blog.example42.com/2018/10/08/puppet6-ca-upgrading/

Re: [Puppet Users] Any Puppet APIs which integrate with Azure API Management Gateway

2020-07-14 Thread Martin Alfke
Hi Vinay, Puppet managed an Azure module - but no more development. https://github.com/puppetlabs/puppetlabs-azure You can check documentation at the link mentioned above and verify whether this module serves your needs. Hth, Martin > On 13.

Re: [Puppet Users] Parameters to Puppet Task

2020-06-30 Thread Martin Alfke
Hi Valayil, You seem to miss loading the stdin json in your task: https://puppet.com/docs/bolt/latest/writing_tasks.html#no-op-task-example #!/usr/bin/env python import json import sys params = json.load(sys.stdin)

Re: [Puppet Users] Error while installing the docker on Ubuntu 18.04 using existing puppet forge module

2020-06-25 Thread Martin Alfke
Hi Vinay, Your error is unrelated to docker module, but comes from apt module. Apt module is trying to add the docker repos and fetch the gpg keys. Please make sure to allow outgoing https connections. If you want to install from your own internal mirror, you can set a docker class parameter:

Re: [Puppet Users] Puppetdb and postgresql module: How to manage Postgresql but NOT manage Postgresql REPO using Hiera?

2020-06-13 Thread Martin Alfke
postgresql::globals::manage_package_repo: false postgresql::globals::version: '9.6', > On 12. Jun 2020, at 17:40, Devminded wrote: > > Hi. > > I am trying to disable the managing of the Postgresql repo using Hiera when > using the puppetlabs/postgresql module. I have tried every Hiera

Re: [Puppet Users] hiera with environments

2020-06-11 Thread Martin Alfke
Hi, You should change to using a control-repo and adopt your codebase. https://puppet.com/docs/pe/2018.1/control_repo.html https://github.com/puppetlabs/best-practices/blob/master/puppet-modules-and-the-control-repo.md

Re: [Puppet Users] How to run yum update in puppet config.pp file?

2020-05-06 Thread Martin Alfke
Hi, > On 6. May 2020, at 02:17, Shivabalaji wrote: > > Hi Team, > I want to run yum updated every time, when I run puppet update. How do I add > yum update command? You can use Puppet to create a cron job which runs the yum update. https://forge.puppet.com/puppet/cron

[Puppet Users] Splat operator on file resource Error

2020-04-29 Thread Martin Alfke
Hi, we want to make use of the splat operator and extend the list of parameters: #site/profile/manifests/files.pp class profile::files ( Hash $files = {}, ){ $files.each |String $key, Hash $params| { $_template = $params['template'] $_value = delete($params, 'template') notify {

Re: [Puppet Users] Puppet on Ubuntu Focal

2020-04-25 Thread Martin Alfke
Are you using system ruby, installing puppet as a Ruby gem? No need to do this. Puppet Agent ships required ruby version. Just add the repo (http://apt.puppetlabs.com/puppet6-release-focal.deb) and then install puppet-agent package. hth, Martin > On 24. Apr 2020, at 17:27, Arpit sharma wrote:

Re: [Puppet Users] Where is source rpm for puppet6 open source rpm

2020-04-23 Thread Martin Alfke
You can install the RPM on /opt folder and re-use the same installation on multiple systems. Just be sure to configure puppet agent to not store node specific information in /opt. Check config options by running "sudo puppet config print —all” after Puppet agent installation Hth, Martin >

Re: [Puppet Users] Install software by running script

2020-04-15 Thread Martin Alfke
Hi Albert, > On 15. Apr 2020, at 15:51, Albert Shih wrote: > > Le 11/04/2020 à 12:15:12+0200, Martin Alfke a écrit > > Hi everyone. > >> > Thanks for the answer. > >>> I would like to have your point of view on how you install some software.

Re: [Puppet Users] Install software by running script

2020-04-11 Thread Martin Alfke
Hi Albert, > On 11. Apr 2020, at 11:27, Albert Shih wrote: > > Hi, > > I would like to have your point of view on how you install some software. > > Long time (in IT meaning) most of the software installation meaning run > some rpm, apt, and put a config file. That process is still

Re: [Puppet Users] upgrading opensource from 5.5 to 6.x

2020-03-19 Thread Martin Alfke
Hi Tim, Major difference between Puppet 5 and 6: - some types have been moved to separate git module repositories - puppet cert command has been moved to puppet server ca command (see also https://www.example42.com/2018/10/08/puppet6-ca-upgrading/

Re: [Puppet Users] Questions reg. Hiera v3 to v5 migration

2020-03-04 Thread Martin Alfke
Hi Dirk, > On 4. Mar 2020, at 09:12, Dirk Heinrichs wrote: > > Am Mittwoch, den 04.03.2020, 07:56 + schrieb Dirk Heinrichs: > >> I assume these two are equivalent: Yes, both deliver same results. I prefer the second option (using paths) The first option is useful in case that you need to

Re: [EXTERNAL] - Re: [Puppet Users] Hiera Setup Lookup Complaining

2020-03-03 Thread Martin Alfke
Hi, > > Am Mittwoch, den 26.02.2020, 05:57 -0800 schrieb Dan Crisp: > >> sshdconfig::match_address: "xx.xx.xx.xx" > > Just to clarify: Is "puppet lookup" supposed to find > "sshdconfig::match_address" when only "match_address" was given No! Hiera looks for a string based key, not regex.

  1   2   3   4   5   >