On Thursday, January 10, 2013 2:53:34 PM UTC-6, Vladimir Rutsky wrote: > > Sorry, there is a typo in example: > > define python_virtualenv( $directory ) { > # Setup virtualenv in directory here > ... > > $easy_install = "${directory}/bin/easy_install" > } > > And use it in this way: > > python_virtualenv { 'env for Django': > directory => '/opt/django/env' > } > > python_virtualenv { 'env for Worker': > directory => '/opt/worker/env' > } > > # Now I want to use easy_install from created virtual environments: > class { 'django': > easy_install => ???$Python_virtualenv['env for Django']::easy_install??? > } > > class { 'django-cache': > easy_install => ???$Python_virtualenv['env for Django']::easy_install??? > } > > class { 'worker': > easy_install => ???$Python_virtualenv['env for Worker']::easy_install??? > } > > Question remains the same: how to access $easy_install variable defined > inside type define resource? > > You can't. Defines, or as the are more formally called, defined types, act more like the built in resource types rather than classes. The variables and parameters from a define can only be accessed from the define itself, and from templates invoked within the define.
> > Vladimir Rutsky > > -- 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/-/ZIhCgvZ_C6oJ. 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.