Strange Issue with Symlink

18 views
Skip to first unread message

jbrown

unread,
Nov 7, 2012, 5:51:18 PM11/7/12
to puppet...@googlegroups.com
I'm seeing a strange issue with symlinks in Puppet 2.7.19. 
  File {
    ensure   => directory,
    owner    => apache,
    group    => apache,
  }

    file { "/mnt/${site_name}":
      mode => 0660,
    }

    mount { "/mnt/${site_name}":
      ensure => mounted,
      atboot => true,
      device => "${drupal_nfs_host}:${drupal_nfs_vol_root}",
      fstype => "nfs",
      options => "rw,vers=3,timeo=60,nosuid",
      require => File["/mnt/${site_name}"],
    }

    file { "/var/www/${site_name}/${drupal_shared_reldir}":
      ensure  => link,
      target  => "/mnt/${site_name}",
      require => [Mount["/mnt/${site_name}"], File["/var/www/${site_name}/${drupal_shared_reldir}"]],
    }

I run the agent on my node. The mount directory and mount point are setup correctly. However, the symlink is completely ignored. (I've replaced actual paths with the vars used above for privacy.)

notice: /File[/mnt/${site_name}]/ensure: created
notice: /Stage[main]//Node[NODE_NAME]/Market[${site_name}]/Mount[/mnt/${site_name}]/ensure: defined 'ensure' as 'mounted'
info: FileBucket adding {md5}fa596fe1bd0cf2b5a3205e605b02a259
info: /Stage[main]//Node[NODE_NAME]/Market[${site_name}]/Mount[/mnt/${site_name}]: Scheduling refresh of Mount[/mnt/${site_name}]
info: Mount[/mnt/${site_name}](provider=parsed): Remounting
notice: /Stage[main]//Node[NODE_NAME]/Market[${site_name}]/Mount[/mnt/${site_name}]: Triggered 'refresh' from 1 events
info: /Stage[main]//Node[NODE_NAME]/Market[${site_name}]/Mount[/mnt/${site_name}]: Scheduling refresh of Mount[/mnt/${site_name}]
notice: Finished catalog run in 13.16 seconds

As you can see, there were no messages related to File["/var/www/${site_name}/${drupal_shared_reldir}"].

The crazy part is that a test link does work.
  file { "/tmp/test-link":
  }

  file { "/tmp/link":
    ensure => link,
    target => "/tmp/test-link",
    require => File["/tmp/test-link"],
  }

Any thoughts on what's happening? It seems odd that there are no error messages.

Thanks,

jbrown

unread,
Nov 7, 2012, 6:22:28 PM11/7/12
to puppet...@googlegroups.com
Please disregard the original post. I found the issue.

I had the following incorrect require line in the link resource:
      require => [Mount["/mnt/${site_name}"], File["/var/www/${site_name}/${drupal_shared_reldir}"]],
It should be
      require => Mount["/mnt/${site_name}"],

Cheers,
Justin
Reply all
Reply to author
Forward
0 new messages