Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

No such file or directory #99

Open
victor-soto opened this issue Jun 4, 2019 · 3 comments
Open

No such file or directory #99

victor-soto opened this issue Jun 4, 2019 · 3 comments

Comments

@victor-soto
Copy link

victor-soto commented Jun 4, 2019

I have an error when run puppet agent -t in node.

Could not set 'link' on ensure: No such file or directory @ dir_chdir - /usr/local/sonarqube (file: /etc/puppetlabs/code/environments/production/modules/sonarqube/manifests/move_to_home.pp, line: 9)

Wrapped exception:

No such file or directory @ dir_chdir - /usr/local/sonarqube
@ghoneycutt
Copy link
Member

What's your code look like for the sonarqube::move_to_home resource?

@victor-soto
Copy link
Author

victor-soto commented Jun 4, 2019

Hi @ghoneycutt , thanks for your support.

This is move_to_home.pp manifest file.

# copy folders susceptible to change from installation folder to /var/local/sonar and symlink  
define sonarqube::move_to_home (  
  $home,  
) {  
  file { "${home}/${name}":  
    ensure => 'directory',  
  }  
  ->  
  file { "${sonarqube::installdir}/${name}":  
    ensure => 'link',  
    target => "${home}/${name}",  
    force  => yes,  
  }  
}  

This is sonarqube::move_to_home lines into init.pp manifest file:

  Sonarqube::Move_to_home {
    home => $real_home,
  }
  ...
  ->
  sonarqube::move_to_home { 'data': }
  ->
  sonarqube::move_to_home { 'extras': }
  ->
  sonarqube::move_to_home { 'extensions': }
  ->
  sonarqube::move_to_home { 'logs': }
  ...

@ghoneycutt
Copy link
Member

Perhaps /usr/local/sonarqube does not exist yet and you are attempting to make a link there. The define should probably include the sonarqube class and have resource dependencies set.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants