Re: [Puppet Users] hiera in puppet 3.0.1 doesn't take facter variable

2012-12-25 Thread Dan White
What do the following commands return ?

hiera -c /etc/puppet/hiera.yaml ssh-packages 

hiera -c /etc/puppet/hiera.yaml operatingsystem=Ubuntu ssh-packages 

On Dec 24, 2012, at 10:31 PM, roadtest wrote:

 Hello, 
 
 I follow http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ to 
  try hiera on my 3.0.1 puppet master.  I follow the instruction except my 
 environment is ubuntu.  Here is my /etc/hiera.yaml
 ---
 :hierarchy:
   - %{operatingsystem}
   - common
 :backends:
   - yaml
 
 :yaml:
   :datadir: '/var/lib/hiera'
 
 Here is my backends
 $more /var/lib/hiera/Ubuntu.yaml
 ---
 ssh_packages : - 'openssh-server'
 
 Here is section of ssh class 
 $more /etc/puppet/modules/ssh/manifests/init.pp
 class ssh {
   #  $ssh_packages  = ['openssh','openssh-clients','openssh-server']
   #   $ssh_packages  = ['openssh-server']
   #  $permit_root_login = 'no'
   #$ssh_users = ['root','jeff','gary','hunter']
   $ssh_packages = hiera('ssh_packages')
   $permit_root_login = hiera('permit_root_login')
   $ssh_users = hiera('ssh_users')
 
   package { $ssh_packages:
 ensure = present,
 before = File['/etc/ssh/sshd_config'],
   }
 file { '/etc/ssh/sshd_config':
 ensure  = present,
 owner   = 'root',
 group   = 'root',
 mode= '0644',
 # Template uses $permit_root_login and $ssh_users
 content = template('ssh/sshd_config.erb'),
   }
 
   service { 'sshd':
 ensure = running,
 enable = true,
 hasstatus  = true,
 hasrestart = true,
   }
 }
 
 when  my ubuntu client is trying to pull the catalog, it has following errors.
 Dec 24 22:17:07 vm2 puppet-agent[18103]: Could not retrieve catalog from 
 remote server: Error 400 on SERVER: Could not find data item ssh_packages in 
 any Hiera data file and no default supplied at 
 /etc/puppet/modules/ssh/manifests/init.pp:6 on node vm2
 
 It appears to me that %{operatingsystem} in hiera.yaml is invalid and 
 ssh_packages can't be properly assigned even it is valid on the client 
 machine.
 vm2# facter | grep operatingsystem
 operatingsystem = Ubuntu
 operatingsystemrelease = 12.04
 
 I can't figure out what wrong with my configuration. Thanks for any 
 suggestions!
 
 carl
 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/puppet-users/-/Hm7YfNU7MT0J.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] hiera in puppet 3.0.1 doesn't take facter variable

2012-12-25 Thread roadtest
Further testing shows hiera can parse dynamic variable using scope file, 
but it can't parse facter value. 

root@vm1:~# hiera --yaml /var/tmp/scope.yaml  ssh_packages
[openssh-server]
root@vm1:~# more /var/tmp/scope.yaml
operatingsystem: Ubuntu
root@vm1:~# hiera ssh_packages
nil
root@vm1:~# hiera ssh_users=ssh_users is static variable and 
hiera can parse it without problem. 
[root, jeff, gary, hunter]






On Tuesday, December 25, 2012 8:24:29 AM UTC-5, Ygor wrote:

 What do the following commands return ? 

 hiera -c /etc/puppet/hiera.yaml ssh-packages 

 hiera -c /etc/puppet/hiera.yaml operatingsystem=Ubuntu ssh-packages 

 On Dec 24, 2012, at 10:31 PM, roadtest wrote: 

  Hello, 
  
  I follow 
 http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ to  try 
 hiera on my 3.0.1 puppet master.  I follow the instruction except my 
 environment is ubuntu.  Here is my /etc/hiera.yaml 
  --- 
  :hierarchy: 
- %{operatingsystem} 
- common 
  :backends: 
- yaml 
  
  :yaml: 
:datadir: '/var/lib/hiera' 
  
  Here is my backends 
  $more /var/lib/hiera/Ubuntu.yaml 
  --- 
  ssh_packages : - 'openssh-server' 
  
  Here is section of ssh class 
  $more /etc/puppet/modules/ssh/manifests/init.pp 
  class ssh { 
#  $ssh_packages  = ['openssh','openssh-clients','openssh-server'] 
#   $ssh_packages  = ['openssh-server'] 
#  $permit_root_login = 'no' 
#$ssh_users = ['root','jeff','gary','hunter'] 
$ssh_packages = hiera('ssh_packages') 
$permit_root_login = hiera('permit_root_login') 
$ssh_users = hiera('ssh_users') 
  
package { $ssh_packages: 
  ensure = present, 
  before = File['/etc/ssh/sshd_config'], 
} 
  file { '/etc/ssh/sshd_config': 
  ensure  = present, 
  owner   = 'root', 
  group   = 'root', 
  mode= '0644', 
  # Template uses $permit_root_login and $ssh_users 
  content = template('ssh/sshd_config.erb'), 
} 
  
service { 'sshd': 
  ensure = running, 
  enable = true, 
  hasstatus  = true, 
  hasrestart = true, 
} 
  } 
  
  when  my ubuntu client is trying to pull the catalog, it has following 
 errors. 
  Dec 24 22:17:07 vm2 puppet-agent[18103]: Could not retrieve catalog from 
 remote server: Error 400 on SERVER: Could not find data item ssh_packages 
 in any Hiera data file and no default supplied at 
 /etc/puppet/modules/ssh/manifests/init.pp:6 on node vm2 
  
  It appears to me that %{operatingsystem} in hiera.yaml is invalid and 
 ssh_packages can't be properly assigned even it is valid on the client 
 machine. 
  vm2# facter | grep operatingsystem 
  operatingsystem = Ubuntu 
  operatingsystemrelease = 12.04 
  
  I can't figure out what wrong with my configuration. Thanks for any 
 suggestions! 
  
  carl 
  
  
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups Puppet Users group. 
  To view this discussion on the web visit 
 https://groups.google.com/d/msg/puppet-users/-/Hm7YfNU7MT0J. 
  To post to this group, send email to 
  puppet...@googlegroups.comjavascript:. 

  To unsubscribe from this group, send email to 
 puppet-users...@googlegroups.com javascript:. 
  For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en. 



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/iyI5cBxwgHsJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] hiera in puppet 3.0.1 doesn't take facter variable

2012-12-25 Thread roadtest
Thanks for your reply! Here is the output.

root@vm1:/etc/puppet/modules/ssh/manifests# hiera -c /etc/puppet/hiera.yaml 
ssh_packages
nil
root@vm1:/etc/puppet/modules/ssh/manifests# hiera -c /etc/puppet/hiera.yaml 
operatingsystem=Ubuntu ssh_packages
ssh_packages


It appears ssh_packages is not resolved properly.

Thanks,

carl

On Tuesday, December 25, 2012 8:24:29 AM UTC-5, Ygor wrote:

 What do the following commands return ? 

 hiera -c /etc/puppet/hiera.yaml ssh-packages 

 hiera -c /etc/puppet/hiera.yaml operatingsystem=Ubuntu ssh-packages 

 On Dec 24, 2012, at 10:31 PM, roadtest wrote: 

  Hello, 
  
  I follow 
 http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ to  try 
 hiera on my 3.0.1 puppet master.  I follow the instruction except my 
 environment is ubuntu.  Here is my /etc/hiera.yaml 
  --- 
  :hierarchy: 
- %{operatingsystem} 
- common 
  :backends: 
- yaml 
  
  :yaml: 
:datadir: '/var/lib/hiera' 
  
  Here is my backends 
  $more /var/lib/hiera/Ubuntu.yaml 
  --- 
  ssh_packages : - 'openssh-server' 
  
  Here is section of ssh class 
  $more /etc/puppet/modules/ssh/manifests/init.pp 
  class ssh { 
#  $ssh_packages  = ['openssh','openssh-clients','openssh-server'] 
#   $ssh_packages  = ['openssh-server'] 
#  $permit_root_login = 'no' 
#$ssh_users = ['root','jeff','gary','hunter'] 
$ssh_packages = hiera('ssh_packages') 
$permit_root_login = hiera('permit_root_login') 
$ssh_users = hiera('ssh_users') 
  
package { $ssh_packages: 
  ensure = present, 
  before = File['/etc/ssh/sshd_config'], 
} 
  file { '/etc/ssh/sshd_config': 
  ensure  = present, 
  owner   = 'root', 
  group   = 'root', 
  mode= '0644', 
  # Template uses $permit_root_login and $ssh_users 
  content = template('ssh/sshd_config.erb'), 
} 
  
service { 'sshd': 
  ensure = running, 
  enable = true, 
  hasstatus  = true, 
  hasrestart = true, 
} 
  } 
  
  when  my ubuntu client is trying to pull the catalog, it has following 
 errors. 
  Dec 24 22:17:07 vm2 puppet-agent[18103]: Could not retrieve catalog from 
 remote server: Error 400 on SERVER: Could not find data item ssh_packages 
 in any Hiera data file and no default supplied at 
 /etc/puppet/modules/ssh/manifests/init.pp:6 on node vm2 
  
  It appears to me that %{operatingsystem} in hiera.yaml is invalid and 
 ssh_packages can't be properly assigned even it is valid on the client 
 machine. 
  vm2# facter | grep operatingsystem 
  operatingsystem = Ubuntu 
  operatingsystemrelease = 12.04 
  
  I can't figure out what wrong with my configuration. Thanks for any 
 suggestions! 
  
  carl 
  
  
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups Puppet Users group. 
  To view this discussion on the web visit 
 https://groups.google.com/d/msg/puppet-users/-/Hm7YfNU7MT0J. 
  To post to this group, send email to 
  puppet...@googlegroups.comjavascript:. 

  To unsubscribe from this group, send email to 
 puppet-users...@googlegroups.com javascript:. 
  For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en. 



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/YPLcZhLn2YsJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] hiera in puppet 3.0.1 doesn't take facter variable

2012-12-25 Thread Dan White
OK.  Consider:

--
http://docs.puppetlabs.com/facter/1.6/core_facts.html#summary
Facts appear in Puppet as normal top-scope variables
--

--
http://docs.puppetlabs.com/hiera/1/configuring.html#format
Each top-level key in the hash must be a Ruby symbol with a colon (:) prefix. 
The available settings are listed below, under “Global Settings” and 
“Backend-Specific Settings”.

Example Config File

---
:backends:
  - yaml
  - json
:yaml:
  :datadir: /etc/puppet/hieradata
:json:
  :datadir: /etc/puppet/hieradata
:hierarchy:
  - %{::clientcert}
  - %{::custom_location}
  - common
--

Based on those two factoids, I would suggest trying the following in your 
hiera.yaml: 

:hierarchy: 

  - %{::operatingsystem} 
  - common 


All the examples here http://docs.puppetlabs.com/hiera/1/hierarchy.html  have 
the double-colon notation

Also, just to be thorough, what does facter -p operatingsystem return ?

On Dec 25, 2012, at 10:48 AM, roadtest wrote:

 Thanks for your reply! Here is the output.
 
 root@vm1:/etc/puppet/modules/ssh/manifests# hiera -c /etc/puppet/hiera.yaml 
 ssh_packages
 nil
 root@vm1:/etc/puppet/modules/ssh/manifests# hiera -c /etc/puppet/hiera.yaml 
 operatingsystem=Ubuntu ssh_packages
 ssh_packages
 
 
 It appears ssh_packages is not resolved properly.
 
 Thanks,
 
 carl
 
 On Tuesday, December 25, 2012 8:24:29 AM UTC-5, Ygor wrote:
 What do the following commands return ? 
 
 hiera -c /etc/puppet/hiera.yaml ssh-packages 
 
 hiera -c /etc/puppet/hiera.yaml operatingsystem=Ubuntu ssh-packages 
 
 On Dec 24, 2012, at 10:31 PM, roadtest wrote: 
 
  Hello, 
  
  I follow http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ 
  to  try hiera on my 3.0.1 puppet master.  I follow the instruction except 
  my environment is ubuntu.  Here is my /etc/hiera.yaml 
  --- 
  :hierarchy: 
- %{operatingsystem} 
- common 
  :backends: 
- yaml 
  
  :yaml: 
:datadir: '/var/lib/hiera' 
  
  Here is my backends 
  $more /var/lib/hiera/Ubuntu.yaml 
  --- 
  ssh_packages : - 'openssh-server' 
  
  Here is section of ssh class 
  $more /etc/puppet/modules/ssh/manifests/init.pp 
  class ssh { 
#  $ssh_packages  = ['openssh','openssh-clients','openssh-server'] 
#   $ssh_packages  = ['openssh-server'] 
#  $permit_root_login = 'no' 
#$ssh_users = ['root','jeff','gary','hunter'] 
$ssh_packages = hiera('ssh_packages') 
$permit_root_login = hiera('permit_root_login') 
$ssh_users = hiera('ssh_users') 
  
package { $ssh_packages: 
  ensure = present, 
  before = File['/etc/ssh/sshd_config'], 
} 
  file { '/etc/ssh/sshd_config': 
  ensure  = present, 
  owner   = 'root', 
  group   = 'root', 
  mode= '0644', 
  # Template uses $permit_root_login and $ssh_users 
  content = template('ssh/sshd_config.erb'), 
} 
  
service { 'sshd': 
  ensure = running, 
  enable = true, 
  hasstatus  = true, 
  hasrestart = true, 
} 
  } 
  
  when  my ubuntu client is trying to pull the catalog, it has following 
  errors. 
  Dec 24 22:17:07 vm2 puppet-agent[18103]: Could not retrieve catalog from 
  remote server: Error 400 on SERVER: Could not find data item ssh_packages 
  in any Hiera data file and no default supplied at 
  /etc/puppet/modules/ssh/manifests/init.pp:6 on node vm2 
  
  It appears to me that %{operatingsystem} in hiera.yaml is invalid and 
  ssh_packages can't be properly assigned even it is valid on the client 
  machine. 
  vm2# facter | grep operatingsystem 
  operatingsystem = Ubuntu 
  operatingsystemrelease = 12.04 
  
  I can't figure out what wrong with my configuration. Thanks for any 
  suggestions! 
  
  carl 
  
  
  
  -- 
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group. 
  To view this discussion on the web visit 
  https://groups.google.com/d/msg/puppet-users/-/Hm7YfNU7MT0J. 
  To post to this group, send email to puppet...@googlegroups.com. 
  To unsubscribe from this group, send email to 
  puppet-users...@googlegroups.com. 
  For more options, visit this group at 
  http://groups.google.com/group/puppet-users?hl=en. 
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To view this discussion on the web visit 
 https://groups.google.com/d/msg/puppet-users/-/YPLcZhLn2YsJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 

Re: [Puppet Users] hiera in puppet 3.0.1 doesn't take facter variable

2012-12-25 Thread roadtest
Hi,

I got the same errors after change from %{operatingsystem} to 
%{::operatingsystem}.

In the mean time, I did similar testing using puppet enterprise(default 
puppet is 2.7.x), which is running hiera 0.3.0 , without any problem. It 
nicely parse operatingsystem to Ubuntu and worked like a charm.  Does this 
mean I can't use dynamic variable with  hiera 1.1.1 in puppet 3.0.1?

Btw, the return of facter -p operatingsystem is Ubuntu and I am aware it 
is case sensitive.

Thanks,

carl

On Tuesday, December 25, 2012 2:11:49 PM UTC-5, Ygor wrote:

 OK.  Consider: 

 -- 
 http://docs.puppetlabs.com/facter/1.6/core_facts.html#summary 
 Facts appear in Puppet as normal top-scope variables 
 -- 

 -- 
 http://docs.puppetlabs.com/hiera/1/configuring.html#format 
 Each top-level key in the hash must be a Ruby symbol with a colon (:) 
 prefix. The available settings are listed below, under “Global Settings” 
 and “Backend-Specific Settings”. 

 Example Config File 

 --- 
 :backends: 
   - yaml 
   - json 
 :yaml: 
   :datadir: /etc/puppet/hieradata 
 :json: 
   :datadir: /etc/puppet/hieradata 
 :hierarchy: 
   - %{::clientcert} 
   - %{::custom_location} 
   - common 
 -- 

 Based on those two factoids, I would suggest trying the following in your 
 hiera.yaml: 

 :hierarchy: 

   - %{::operatingsystem} 
   - common 


 All the examples here http://docs.puppetlabs.com/hiera/1/hierarchy.html have 
 the double-colon notation 

 Also, just to be thorough, what does facter -p operatingsystem return ? 

 On Dec 25, 2012, at 10:48 AM, roadtest wrote: 

  Thanks for your reply! Here is the output. 
  
  root@vm1:/etc/puppet/modules/ssh/manifests# hiera -c 
 /etc/puppet/hiera.yaml ssh_packages 
  nil 
  root@vm1:/etc/puppet/modules/ssh/manifests# hiera -c 
 /etc/puppet/hiera.yaml operatingsystem=Ubuntu ssh_packages 
  ssh_packages 
  
  
  It appears ssh_packages is not resolved properly. 
  
  Thanks, 
  
  carl 
  
  On Tuesday, December 25, 2012 8:24:29 AM UTC-5, Ygor wrote: 
  What do the following commands return ? 
  
  hiera -c /etc/puppet/hiera.yaml ssh-packages 
  
  hiera -c /etc/puppet/hiera.yaml operatingsystem=Ubuntu ssh-packages 
  
  On Dec 24, 2012, at 10:31 PM, roadtest wrote: 
  
   Hello, 
   
   I follow 
 http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ to  try 
 hiera on my 3.0.1 puppet master.  I follow the instruction except my 
 environment is ubuntu.  Here is my /etc/hiera.yaml 
   --- 
   :hierarchy: 
 - %{operatingsystem} 
 - common 
   :backends: 
 - yaml 
   
   :yaml: 
 :datadir: '/var/lib/hiera' 
   
   Here is my backends 
   $more /var/lib/hiera/Ubuntu.yaml 
   --- 
   ssh_packages : - 'openssh-server' 
   
   Here is section of ssh class 
   $more /etc/puppet/modules/ssh/manifests/init.pp 
   class ssh { 
 #  $ssh_packages  = 
 ['openssh','openssh-clients','openssh-server'] 
 #   $ssh_packages  = ['openssh-server'] 
 #  $permit_root_login = 'no' 
 #$ssh_users = ['root','jeff','gary','hunter'] 
 $ssh_packages = hiera('ssh_packages') 
 $permit_root_login = hiera('permit_root_login') 
 $ssh_users = hiera('ssh_users') 
   
 package { $ssh_packages: 
   ensure = present, 
   before = File['/etc/ssh/sshd_config'], 
 } 
   file { '/etc/ssh/sshd_config': 
   ensure  = present, 
   owner   = 'root', 
   group   = 'root', 
   mode= '0644', 
   # Template uses $permit_root_login and $ssh_users 
   content = template('ssh/sshd_config.erb'), 
 } 
   
 service { 'sshd': 
   ensure = running, 
   enable = true, 
   hasstatus  = true, 
   hasrestart = true, 
 } 
   } 
   
   when  my ubuntu client is trying to pull the catalog, it has following 
 errors. 
   Dec 24 22:17:07 vm2 puppet-agent[18103]: Could not retrieve catalog 
 from remote server: Error 400 on SERVER: Could not find data item 
 ssh_packages in any Hiera data file and no default supplied at 
 /etc/puppet/modules/ssh/manifests/init.pp:6 on node vm2 
   
   It appears to me that %{operatingsystem} in hiera.yaml is invalid and 
 ssh_packages can't be properly assigned even it is valid on the client 
 machine. 
   vm2# facter | grep operatingsystem 
   operatingsystem = Ubuntu 
   operatingsystemrelease = 12.04 
   
   I can't figure out what wrong with my configuration. Thanks for any 
 suggestions! 
   
   carl 
   
   
   
   -- 
   You received this message because you are subscribed to the Google 
 Groups Puppet Users group. 
   To view this discussion on the web visit 
 https://groups.google.com/d/msg/puppet-users/-/Hm7YfNU7MT0J. 
   To post to this group, send email to puppet...@googlegroups.com. 
   To unsubscribe from this group, send email to 
 puppet-users...@googlegroups.com. 
   For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en. 
  
  
  -- 
  You received this message because you are subscribed to the Google 

[Puppet Users] Coverage reports of manifests

2012-12-25 Thread Vincent Janelle
Is there a way of determining spec testing reports of manifests?  I'm 
adding tests to an existing deployment and it'd be useful to find out what 
code isn't being tested.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/Myj1KaztMkwJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] puppetlabs/apt and apt::ppa

2012-12-25 Thread Andrey Ageyev
Greetings,

I'm trying to add ppa:nginx/stable repo for Ubuntu 12.04.1 LTS.
Server: puppetmaster-common 3.0.1-1puppetlabs1 
Agent: puppet  2.7.11

And when I try to apply manifest - getting: 
puppet agent -t
info: Caching catalog for wproxy71.tpnt.net
err: Failed to apply catalog: Could not find dependency 
File[/etc/apt/sources.list.d] for 
Exec[add-apt-repository-ppa:openstack-ppa/bleeding-edge] at 
/etc/puppet/modules/apt/manifests/ppa.pp:38

The folder - */etc/apt/sources.list.d* exists.
Does anybody know what's can be wrong?

Thanks,
Andrey.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/BPkgzDYkpy0J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppetlabs/apt and apt::ppa

2012-12-25 Thread Brian Lalor
Is that directory managed as a resource with puppet? Puppet doesn't recognize 
non-managed resources as dependencies. 

--
Brian Lalor
bla...@bravo5.org

On Dec 25, 2012, at 9:22 PM, Andrey Ageyev a.age...@gmail.com wrote:

 The folder - /etc/apt/sources.list.d exists.
 Does anybody know what's can be wrong?

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] puppetlabs/apt and apt::ppa

2012-12-25 Thread Andrey Ageyev
This directory exists in the fresh ubuntu system.

I only found this, but there is no solution or workaround.

On Dec 26, 2012, at 4:31 AM, Brian Lalor bla...@bravo5.org wrote:

 Is that directory managed as a resource with puppet? Puppet doesn't recognize 
 non-managed resources as dependencies. 
 
 --
 Brian Lalor
 bla...@bravo5.org
 
 On Dec 25, 2012, at 9:22 PM, Andrey Ageyev a.age...@gmail.com wrote:
 
 The folder - /etc/apt/sources.list.d exists.
 Does anybody know what's can be wrong?
 
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to 
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: puppetlabs/apt and apt::ppa

2012-12-25 Thread Andrey Ageyev
Fixed by removing dependency File[$sources_list_d] in apt/manifests/ppa.pp 
around line 33:

require   = [
File[$sources_list_d],
Package[${package}],
],

to 
require   = Package[${package}],


среда, 26 декабря 2012 г., 4:22:35 UTC+2 пользователь Andrey Ageyev написал:

 Greetings,

 I'm trying to add ppa:nginx/stable repo for Ubuntu 12.04.1 LTS.
 Server: puppetmaster-common 3.0.1-1puppetlabs1 
 Agent: puppet  2.7.11

 And when I try to apply manifest - getting: 
 puppet agent -t
 info: Caching catalog for wproxy71.tpnt.net
 err: Failed to apply catalog: Could not find dependency 
 File[/etc/apt/sources.list.d] for 
 Exec[add-apt-repository-ppa:openstack-ppa/bleeding-edge] at 
 /etc/puppet/modules/apt/manifests/ppa.pp:38

 The folder - */etc/apt/sources.list.d* exists.
 Does anybody know what's can be wrong?

 Thanks,
 Andrey.




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/CEgiBNLSA6cJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Not able to install puppet enterprise onn agent node using install command.

2012-12-25 Thread lalit jangra
Any Help?

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/0H_inZHA98wJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] hiera in puppet 3.0.1 doesn't take facter variable

2012-12-25 Thread roadtest
The right syntax should be following. The key(ssh_packages) should be put 
before value assignment and it returns the right value.

#hiera -c /etc/puppet/hiera.yaml ssh_packages operatingsystem=Ubuntu
[openssh-server]

On Tuesday, December 25, 2012 10:48:25 AM UTC-5, roadtest wrote:

 Thanks for your reply! Here is the output.

 root@vm1:/etc/puppet/modules/ssh/manifests# hiera -c 
 /etc/puppet/hiera.yaml ssh_packages
 nil
 root@vm1:/etc/puppet/modules/ssh/manifests# hiera -c 
 /etc/puppet/hiera.yaml operatingsystem=Ubuntu ssh_packages
 ssh_packages


 It appears ssh_packages is not resolved properly.

 Thanks,

 carl

 On Tuesday, December 25, 2012 8:24:29 AM UTC-5, Ygor wrote:

 What do the following commands return ? 

 hiera -c /etc/puppet/hiera.yaml ssh-packages 

 hiera -c /etc/puppet/hiera.yaml operatingsystem=Ubuntu ssh-packages 

 On Dec 24, 2012, at 10:31 PM, roadtest wrote: 

  Hello, 
  
  I follow 
 http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ to 
  try hiera on my 3.0.1 puppet master.  I follow the instruction except my 
 environment is ubuntu.  Here is my /etc/hiera.yaml 
  --- 
  :hierarchy: 
- %{operatingsystem} 
- common 
  :backends: 
- yaml 
  
  :yaml: 
:datadir: '/var/lib/hiera' 
  
  Here is my backends 
  $more /var/lib/hiera/Ubuntu.yaml 
  --- 
  ssh_packages : - 'openssh-server' 
  
  Here is section of ssh class 
  $more /etc/puppet/modules/ssh/manifests/init.pp 
  class ssh { 
#  $ssh_packages  = 
 ['openssh','openssh-clients','openssh-server'] 
#   $ssh_packages  = ['openssh-server'] 
#  $permit_root_login = 'no' 
#$ssh_users = ['root','jeff','gary','hunter'] 
$ssh_packages = hiera('ssh_packages') 
$permit_root_login = hiera('permit_root_login') 
$ssh_users = hiera('ssh_users') 
  
package { $ssh_packages: 
  ensure = present, 
  before = File['/etc/ssh/sshd_config'], 
} 
  file { '/etc/ssh/sshd_config': 
  ensure  = present, 
  owner   = 'root', 
  group   = 'root', 
  mode= '0644', 
  # Template uses $permit_root_login and $ssh_users 
  content = template('ssh/sshd_config.erb'), 
} 
  
service { 'sshd': 
  ensure = running, 
  enable = true, 
  hasstatus  = true, 
  hasrestart = true, 
} 
  } 
  
  when  my ubuntu client is trying to pull the catalog, it has following 
 errors. 
  Dec 24 22:17:07 vm2 puppet-agent[18103]: Could not retrieve catalog 
 from remote server: Error 400 on SERVER: Could not find data item 
 ssh_packages in any Hiera data file and no default supplied at 
 /etc/puppet/modules/ssh/manifests/init.pp:6 on node vm2 
  
  It appears to me that %{operatingsystem} in hiera.yaml is invalid and 
 ssh_packages can't be properly assigned even it is valid on the client 
 machine. 
  vm2# facter | grep operatingsystem 
  operatingsystem = Ubuntu 
  operatingsystemrelease = 12.04 
  
  I can't figure out what wrong with my configuration. Thanks for any 
 suggestions! 
  
  carl 
  
  
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups Puppet Users group. 
  To view this discussion on the web visit 
 https://groups.google.com/d/msg/puppet-users/-/Hm7YfNU7MT0J. 
  To post to this group, send email to puppet...@googlegroups.com. 
  To unsubscribe from this group, send email to 
 puppet-users...@googlegroups.com. 
  For more options, visit this group at 
 http://groups.google.com/group/puppet-users?hl=en. 



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/hxV7Du7DV_EJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] How to specify dependency

2012-12-25 Thread Andrey Ageyev
Hi,

sorry for stupid question, but how I can specify package depends on class 
with parameters?

class nginx::install ( 
$nginx  = nginx-light,
$ensure = 'installed'
) {
include nginx::service

package { $nginx :
ensure  = $ensure,
notify  = Class[nginx::service],
}
}
Must depend on:
apt::ppa { ppa:nginx/stable: }

How to correctly specify this inside class nginx::install?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/26BnW1awwx4J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: hiera in puppet 3.0.1 doesn't take facter variable

2012-12-25 Thread roadtest
I fixed the problem by restarting puppetmaster and all dynamic facter 
variables are parsed properly. Thanks a lot to people who respond my 
question during Christmas. Now I need to explain to my wife where I am 
 during Christmas:-)

Cheers,

carl

On Monday, December 24, 2012 10:31:18 PM UTC-5, roadtest wrote:

 Hello, 

 I follow http://puppetlabs.com/blog/first-look-installing-and-using-hiera/to  
 try hiera on my 3.0.1 puppet master.  I follow the instruction except 
 my environment is ubuntu.  Here is my /etc/hiera.yaml
 ---
 :hierarchy:
   - %{operatingsystem}
   - common
 :backends:
   - yaml

 :yaml:
   :datadir: '/var/lib/hiera'

 Here is my backends
 $more /var/lib/hiera/Ubuntu.yaml
 ---
 ssh_packages : - 'openssh-server'

 Here is section of ssh class 
 $more /etc/puppet/modules/ssh/manifests/init.pp
 class ssh {
   #  $ssh_packages  = ['openssh','openssh-clients','openssh-server']
   #   $ssh_packages  = ['openssh-server']
   #  $permit_root_login = 'no'
   #$ssh_users = ['root','jeff','gary','hunter']
   *$ssh_packages = hiera('ssh_packages')*
   $permit_root_login = hiera('permit_root_login')
   $ssh_users = hiera('ssh_users')

   package { $ssh_packages:
 ensure = present,
 before = File['/etc/ssh/sshd_config'],
   }
 file { '/etc/ssh/sshd_config':
 ensure  = present,
 owner   = 'root',
 group   = 'root',
 mode= '0644',
 # Template uses $permit_root_login and $ssh_users
 content = template('ssh/sshd_config.erb'),
   }

   service { 'sshd':
 ensure = running,
 enable = true,
 hasstatus  = true,
 hasrestart = true,
   }
 }

 when  my ubuntu client is trying to pull the catalog, it has following 
 errors.
 Dec 24 22:17:07 vm2 puppet-agent[18103]: Could not retrieve catalog from 
 remote server: Error 400 on SERVER: Could not find data item ssh_packages 
 in any Hiera data file and no default supplied at 
 /etc/puppet/modules/ssh/manifests/init.pp:6 on node vm2

 It appears to me that %{operatingsystem} in hiera.yaml is invalid and 
 ssh_packages can't be properly assigned even it is valid on the client 
 machine.
 vm2# facter | grep operatingsystem
 operatingsystem = Ubuntu
 operatingsystemrelease = 12.04

 I can't figure out what wrong with my configuration. Thanks for any 
 suggestions!

 carl




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/jIR-Ii7ZP7IJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] Re: Getting Started with Hiera

2012-12-25 Thread roadtest
I wish hiera documentation can be brought up to date soon. That is sure to 
help many people who just start using hiera.

Thanks,

carl

On Monday, November 19, 2012 12:57:09 PM UTC-5, Michael Hall wrote:

 Yup, we have some work to do on this. I recently joined the Puppet Labs 
 documentation team, and getting Hiera better documented is high on my list 
 of priorities.

 If you don't mind spending the time watching a video of a talk, I can 
 recommend Kelsey Hightower's presentation at PuppetConf '12: 

 http://www.youtube.com/watch?v=z9TK-gUNFHkfeature=youtu.be

 It provides a walkthrough example that might help you get your arms around 
 Hiera a little better. I've converted the slide deck to a PDF, but it's a 
 little large so please email me directly if you'd like me to forward a copy 
 to you. 

 There are also a few notes on the Hiera github repo, including a note on 
 how to make sure your hierarchy and data files are correctly configured:

 https://github.com/puppetlabs/hiera/tree/master/docs/tutorials

 Hope this helps a little, and we'll have more formal documentation out 
 soon.

 Regards,
 Michael




 On Thursday, November 15, 2012 10:20:35 AM UTC-8, Worker Bee wrote:

 Hi Everyone;

 Can anyone direct me towards documentation on getting started with 
 Hiera?  SPecifically, I ma looking for an easy way to verify post-install 
 functionality.

 I did visit the following page which is is blank...
 http://docs.puppetlabs.com/hiera/1/puppet.html

 Any help would be greatly appreciated!



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/Qbvk7icQEjwJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.