I have a file which stores multiple file paths in the file content, as such: Is there a single line command to loop the file paths in the file and set the permission for each of the file paths chmod 644 <file paths in /var/tmp/sample>? Answer Another way to use xargs:
Tag: puppet
retrieve fact info based on variable in puppet
I have these facts: So with the main_ip fact I need to retrieve the interface that host it. I have try the following to compare the ip: but I cannot retrieve the value of the fact with the variable i’m giving… Can you please advice me how to find the value of the fact with the variable information…
Puppet – How to purge a directory
A bit of a Puppet newbie here. I am trying to recursively purge all files and directories under /var/www except keep one file present (/var/www/html/appicon.ico). This is my code: The code does appear to purge all files and directories, except for other files under /var/www/html. Any thoughts what I am doing …
Puppet-Apt fails to install package because of verification
Environment: Running CentOs 7.2 Server in a virtual machine, which has a local proxy set up with CNTLM. I have installed vagrant version 1.8.1. In addition i installed the vagrant-proxyconf plugin. Goal: Set up a virtual machine on the CentOs 7.2 Server with vagrant. Yes: A virtual machine in a virtual machin…
Can resource attributes depend on file-presence?
I’m writing a module, that will provide for mirrored yum-repositories on our network. The single server will host the mirrors offering them to other hosts (and itself). I have a problem with the initial chicken-and-egg — the first download may not happen for a while, but, if I enable a new reposit…
Puppet exec with command mkdir -p does not fail but does not create folder
I’m running this simple puppet code on Ubuntu 14.04 machines, to create folders according to a comma-separated list of paths: This resource definition is used as follows (in this case – just a single folder, no commas, other modules do need this “split” logic): When I run it, I see the…
unable to install puppetserver on ec2 ubuntu instance error: Some packages could not be installed
I am trying to install Puppet server on an EC2 Ubuntu instance: If I try to install puppet-common: I tried purging puppet-common and reinstalling it. I have also tried sudo apt-get upgrade. Any help will be appreciated. Thanks. Answer Have you enabled the PuppetLabs package repositories? Depending on the vers…
How to store linux command output into a variable in puppet
Is it possible to store a linux command result in variable? I am trying to store an encrypted value in a variable. To encrypt I am using base64 command. To store it in variable, I am using generate method. But I am not able to store a value. Answer If you want to execute any command on Puppet Master server
Puppet referring to a module inside a module
I’m using Puppet 3.5.1 on Linux 6 machine. I have a local module “A” that includes a sub-module “B”. Such that sub-module “B” is located in “/etc/puppet/modules/A/modules/B”. I refer to sub-module “B” in my module “A” classes: (/etc…
Managing a user password for linux in puppet
I need to create a test user with a password using puppet. I’ve read that puppet cannot manage user passwords in a generic cross-platform way, which is a pity. I am doing this for Red Hat Enterprise Linux Server release 6.3. I do as follows: puppet updates the password of the user, but Linux says login/…