Puppet: System Administration Automated

Support

Ticket #726 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

mount ensure=>mounted gets confused with a manually mounted FS

Reported by: porridge Assigned to: luke
Priority: normal Milestone:
Component: library Version: 0.23.0
Severity: normal Keywords: mount
Cc: Triage Stage: Unreviewed
Attached Patches: None Complexity: Unknown

Description

To reproduce:

  • mount EXPORT on MOUNTPOINT manually (NOT adding it to fstab)
  • run puppet on the following .pp:
        mount { "MOUNTPOINT":
                atboot => no,
                blockdevice => "-",
                device => "EXPORT",
                ensure => mounted,
                fstype => nfs,
                options => $kernel ? {
                        linux => noauto,
                        sunos => "-"
                },
                pass => $kernel ? {
                        linux => 0,
                        sunos => "-"
                },
                dump => 0,
        }

Expected changes:

  • export stays mounted on MOUNTPOINT
  • a proper line gets appended to fstab

Actual changes:

  • export stays mounted on MOUNTPOINT
  • fstab gets rebuilt, but without any semantic change (i.e. timestamp is updated, but the line not added to the file)

After adding the following debugging code to provider/parsedfile.rb flush_target(), I noticed that the entry to be added has "ensure => absent" rather than the specified "mounted"

        if target == '/etc/fstab'
                Puppet.notice target_records(target).inspect
        end

Adding a line to the fstab manually makes puppet work as expected, so we concluded that the lack of the line in fstab makes puppet confused. Unfortunately due to the lack of knowledge on how providers/types work exactly, I wasn't able to investigate it any further.

(We used NFS and tested on Linux, but I don't think that matters)

Change History

07/20/07 18:47:10 changed by luke

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [2723].