Puppet Managing Symlink

89 views
Skip to first unread message

chengkai liang

unread,
Aug 12, 2013, 8:22:53 PM8/12/13
to puppet...@googlegroups.com
Hi Everybody,

   So I have design a puppet module that will create a symlink under a given directory, and here's the module and a hiera, and fact data:

Hiera data
---
 confluence_setup::lic::lic_info:
    confluence_lib_path: /usr/local/confluence/confluence/WEB-INF/lib

A custom fact that will return

mysql_jdbc_connector_path => /usr/share/java/mysql-connector-java-5.1.17.jar
mysql_jdbc_name => mysql-connector-java-5.1.17.jar

Here the puppet manifest that suppose to create a symlink under confluence_lib_path,

# confluence_setup::lic is a module that performs an automaatic
# confluence license installation
class confluence_setup::lic(
  $lic_info = 'UNDEF',
) {

  # fail if $lic_info is unset
  if $lic_info == 'UNDEF' {
    fail( '$lic_info is not set' )
  }

  # fail if $lic_info is not a hash
  if ! is_hash( $lic_info ) {
    fail( '$lic_info has to be a hash' )
  }

  $license_key         = $lic_info['license_key']
  $confluence_lib_path = $lic_info['confluence_lib_path']

  # create a symlink points to mysql_jdbc_connector
  file { "${::mysql_jdbc_connector_path}":
    ensure => link,
    target => "${confluence_lib_path}/${::mysql_jdbc_name}",
  }
}

Yet, when ran with this command,

puppet apply -e 'include confluence_setup::lic' --modulepath /vagrant/puppet/modules:/vagrant/puppet/modules/custom_facts/lib --environment dev --hiera_config /vagrant/puppet/modules/hiera_config/files/hiera.yaml

Nothing was happened!!  Anybody has any idea why?

Thanks,
Chengkai

Puppet List

unread,
Aug 13, 2013, 1:51:06 AM8/13/13
to puppet...@googlegroups.com

Hello

Are your target and file are the wrong way round?

--
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 post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

chengkai liang

unread,
Aug 13, 2013, 9:02:38 AM8/13/13
to puppet...@googlegroups.com
I guess I am.  I just figure what went wrong there!!

You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/-Mzzr5etsj4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages