Skip to content

[Feature request]: Separate Soft and Hard links in file resource #25

@jstraw

Description

@jstraw

Use Case

There are instances where software refuses to traverse a symbolic (soft) link, and a hard link would work better. Right now that would require an exec with a creates, but that won't fix itself if changed later.

  # Manage a hardlink for the downloads directory so that it can be presented
  # both Nginx and rsync. The hardlink is need so that it still works from
  # rsync's chroot when /var/mirror/artifacts is excluded
  exec { 'hardlink-downloads':
    command => 'cp -r --link /var/mirror/artifacts/downloads /var/mirror/downloads',
    path    => '/usr/bin:/bin',
    creates => '/var/mirror/downloads';
  }

Describe the solution you would like

In the file resource I'd like to suggest we leave ensure => link as soft/symbolic link, but make it an alias to soft_link and then add a hard_link (we could also use soft and hard, but that seems more difficult to follow.)

Both would use the existing style of the link ensure.

file { '/etc/inetd.conf':
  ensure => soft_link,
  target => '/etc/inet/inetd.conf',
}

file { '/var/mirror/downloads':
  ensure => hard_link,
  target => '/var/mirror/artifacts/downloads',
}

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions