Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-7494

atboot time => false always creates /etc/fstab entry

    Details

      Description

      While running a mount of block devices via puppet, there is a problem with attribute atboot => false. It will always created a entry in the /etc/fstab, regardless of the atboot value.

      This will lead to a problem while the OS will then try to mount the block devices at boot time.

      It's unclean: Is this intended or is this not working?
      The documentation is point to the fact that this in not supported at 'some' platform. Does this include Linux?

      Example:

        mount {'data':
          ensure  => mounted,
          atboot  => false,
          device  => '/dev/mapper/data',
          fstype  => ext4,
          options => 'rw',
          name    => '/var/lib/downloads',
        }
      

      This will lead to this line in the /etc/fstab

      /dev/mapper/data	/var/lib/downloads	ext4	rw	0	0
      

      I used puppet 3.4.3 on different Ubuntu version (12.04, 13.10 and 14.04) the behavior was always the same.

      How to reproduce on an example VM:

      vagrant@example:~$ sudo mkdir -p  /var/lib/downloads
      vagrant@example:~$ sudo dd if=/dev/zero of=/asd bs=1M count=1024
      vagrant@example:~$ sudo losetup /dev/loop0 /asd
      vagrant@example:~$ sudo mkfs.ext4 /dev/loop0 
      

      Now running this test.pp:

        mount {'data':
          ensure  => mounted,
          atboot  => false,
          device  => '/dev/mapper/data',
          fstype  => ext4,
          options => 'rw',
          name    => '/var/lib/downloads',
        }
      

      vagrant@example:~$ sudo puppet apply -v -d test.pp 
      Debug: Failed to load library 'selinux' for feature 'selinux'
      Notice: Compiled catalog for example.vbox.net in environment production in 0.05 seconds
      Debug: Creating default schedules
      Debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dsimport does not exist
      Debug: Puppet::Type::User::ProviderLdap: true value when expecting false
      Debug: Puppet::Type::User::ProviderPw: file pw does not exist
      Debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist
      Debug: /User[puppet]: Provider useradd does not support features libuser; not managing attribute forcelocal
      Debug: Puppet::Type::Group::ProviderDirectoryservice: file /usr/bin/dscl does not exist
      Debug: Puppet::Type::Group::ProviderLdap: true value when expecting false
      Debug: Puppet::Type::Group::ProviderPw: file pw does not exist
      Debug: /Group[puppet]: Provider groupadd does not support features libuser; not managing attribute forcelocal
      Debug: Using settings: adding file resource 'privatedir': 'File[/var/lib/puppet/ssl/private]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"750", :backup=>false, :path=>"/var/lib/puppet/ssl/private"}'
      Debug: Using settings: adding file resource 'logdir': 'File[/var/log/puppet]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"750", :backup=>false, :path=>"/var/log/puppet"}'
      Debug: Using settings: adding file resource 'hostcrl': 'File[/var/lib/puppet/ssl/crl.pem]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:file, :owner=>"puppet", :mode=>"644", :backup=>false, :path=>"/var/lib/puppet/ssl/crl.pem"}'
      Debug: Using settings: adding file resource 'vardir': 'File[/var/lib/puppet]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :backup=>false, :path=>"/var/lib/puppet"}'
      Debug: Using settings: adding file resource 'certdir': 'File[/var/lib/puppet/ssl/certs]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"755", :backup=>false, :path=>"/var/lib/puppet/ssl/certs"}'
      Debug: Using settings: adding file resource 'clientyamldir': 'File[/var/lib/puppet/client_yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :mode=>"750", :backup=>false, :path=>"/var/lib/puppet/client_yaml"}'
      Debug: Using settings: adding file resource 'hostprivkey': 'File[/var/lib/puppet/ssl/private_keys/example.vbox.net.pem]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:file, :owner=>"puppet", :mode=>"640", :backup=>false, :path=>"/var/lib/puppet/ssl/private_keys/example.vbox.net.pem"}'
      Debug: Using settings: adding file resource 'publickeydir': 'File[/var/lib/puppet/ssl/public_keys]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"755", :backup=>false, :path=>"/var/lib/puppet/ssl/public_keys"}'
      Debug: Using settings: adding file resource 'plugindest': 'File[/var/lib/puppet/lib]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/var/lib/puppet/lib"}'
      Debug: Using settings: adding file resource 'classfile': 'File[/var/lib/puppet/state/classes.txt]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :owner=>"root", :mode=>"640", :backup=>false, :path=>"/var/lib/puppet/state/classes.txt"}'
      Debug: Using settings: adding file resource 'lastrunreport': 'File[/var/lib/puppet/state/last_run_report.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :mode=>"640", :backup=>false, :path=>"/var/lib/puppet/state/last_run_report.yaml"}'
      Debug: Using settings: adding file resource 'clientbucketdir': 'File[/var/lib/puppet/clientbucket]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :mode=>"750", :backup=>false, :path=>"/var/lib/puppet/clientbucket"}'
      Debug: Using settings: adding file resource 'localcacert': 'File[/var/lib/puppet/ssl/certs/ca.pem]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:file, :owner=>"puppet", :mode=>"644", :backup=>false, :path=>"/var/lib/puppet/ssl/certs/ca.pem"}'
      Debug: Using settings: adding file resource 'privatekeydir': 'File[/var/lib/puppet/ssl/private_keys]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"750", :backup=>false, :path=>"/var/lib/puppet/ssl/private_keys"}'
      Debug: Using settings: adding file resource 'pluginfactdest': 'File[/var/lib/puppet/facts.d]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/var/lib/puppet/facts.d"}'
      Debug: Using settings: adding file resource 'graphdir': 'File[/var/lib/puppet/state/graphs]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/var/lib/puppet/state/graphs"}'
      Debug: Using settings: adding file resource 'confdir': 'File[/etc/puppet]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :backup=>false, :path=>"/etc/puppet"}'
      Debug: Using settings: adding file resource 'statefile': 'File[/var/lib/puppet/state/state.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :mode=>"660", :backup=>false, :path=>"/var/lib/puppet/state/state.yaml"}'
      Debug: Using settings: adding file resource 'hostcert': 'File[/var/lib/puppet/ssl/certs/example.vbox.net.pem]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:file, :owner=>"puppet", :mode=>"644", :backup=>false, :path=>"/var/lib/puppet/ssl/certs/example.vbox.net.pem"}'
      Debug: Using settings: adding file resource 'ssldir': 'File[/var/lib/puppet/ssl]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"771", :backup=>false, :path=>"/var/lib/puppet/ssl"}'
      Debug: Using settings: adding file resource 'client_datadir': 'File[/var/lib/puppet/client_data]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :mode=>"750", :backup=>false, :path=>"/var/lib/puppet/client_data"}'
      Debug: Using settings: adding file resource 'statedir': 'File[/var/lib/puppet/state]{:loglevel=>:debug, :links=>:follow, :ensure=>:directory, :mode=>"1755", :backup=>false, :path=>"/var/lib/puppet/state"}'
      Debug: Using settings: adding file resource 'lastrunfile': 'File[/var/lib/puppet/state/last_run_summary.yaml]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :mode=>"644", :backup=>false, :path=>"/var/lib/puppet/state/last_run_summary.yaml"}'
      Debug: Using settings: adding file resource 'hostpubkey': 'File[/var/lib/puppet/ssl/public_keys/example.vbox.net.pem]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:file, :owner=>"puppet", :mode=>"644", :backup=>false, :path=>"/var/lib/puppet/ssl/public_keys/example.vbox.net.pem"}'
      Debug: Using settings: adding file resource 'rundir': 'File[/var/run/puppet]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"755", :backup=>false, :path=>"/var/run/puppet"}'
      Debug: Using settings: adding file resource 'requestdir': 'File[/var/lib/puppet/ssl/certificate_requests]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"755", :backup=>false, :path=>"/var/lib/puppet/ssl/certificate_requests"}'
      Debug: Using settings: adding file resource 'resourcefile': 'File[/var/lib/puppet/state/resources.txt]{:loglevel=>:debug, :links=>:follow, :ensure=>:file, :owner=>"root", :mode=>"640", :backup=>false, :path=>"/var/lib/puppet/state/resources.txt"}'
      Debug: /File[/var/lib/puppet/ssl/certificate_requests]: Autorequiring File[/var/lib/puppet/ssl]
      Debug: /File[/var/lib/puppet/state/last_run_summary.yaml]: Autorequiring File[/var/lib/puppet/state]
      Debug: /File[/var/lib/puppet/facts.d]: Autorequiring File[/var/lib/puppet]
      Debug: /File[/var/lib/puppet/ssl/public_keys/example.vbox.net.pem]: Autorequiring File[/var/lib/puppet/ssl/public_keys]
      Debug: /File[/var/lib/puppet/state]: Autorequiring File[/var/lib/puppet]
      Debug: /File[/var/lib/puppet/state/classes.txt]: Autorequiring File[/var/lib/puppet/state]
      Debug: /File[/var/lib/puppet/client_data]: Autorequiring File[/var/lib/puppet]
      Debug: /File[/var/lib/puppet/state/graphs]: Autorequiring File[/var/lib/puppet/state]
      Debug: /File[/var/lib/puppet/state/resources.txt]: Autorequiring File[/var/lib/puppet/state]
      Debug: /File[/var/lib/puppet/ssl]: Autorequiring File[/var/lib/puppet]
      Debug: /File[/var/lib/puppet/state/state.yaml]: Autorequiring File[/var/lib/puppet/state]
      Debug: /File[/var/lib/puppet/ssl/certs/example.vbox.net.pem]: Autorequiring File[/var/lib/puppet/ssl/certs]
      Debug: /File[/var/lib/puppet/ssl/public_keys]: Autorequiring File[/var/lib/puppet/ssl]
      Debug: /File[/var/lib/puppet/ssl/private_keys/example.vbox.net.pem]: Autorequiring File[/var/lib/puppet/ssl/private_keys]
      Debug: /File[/var/lib/puppet/client_yaml]: Autorequiring File[/var/lib/puppet]
      Debug: /File[/var/lib/puppet/lib]: Autorequiring File[/var/lib/puppet]
      Debug: /File[/var/lib/puppet/ssl/crl.pem]: Autorequiring File[/var/lib/puppet/ssl]
      Debug: /File[/var/lib/puppet/ssl/private]: Autorequiring File[/var/lib/puppet/ssl]
      Debug: /File[/var/lib/puppet/ssl/private_keys]: Autorequiring File[/var/lib/puppet/ssl]
      Debug: /File[/var/lib/puppet/ssl/certs]: Autorequiring File[/var/lib/puppet/ssl]
      Debug: /File[/var/lib/puppet/ssl/certs/ca.pem]: Autorequiring File[/var/lib/puppet/ssl/certs]
      Debug: /File[/var/lib/puppet/clientbucket]: Autorequiring File[/var/lib/puppet]
      Debug: /File[/var/lib/puppet/state/last_run_report.yaml]: Autorequiring File[/var/lib/puppet/state]
      Debug: /File[/var/lib/puppet/state/classes.txt]/mode: mode changed '0644' to '0640'
      Debug: /File[/var/lib/puppet/state/last_run_report.yaml]/mode: mode changed '0660' to '0640'
      Debug: /File[/var/lib/puppet/state/resources.txt]/mode: mode changed '0644' to '0640'
      Debug: Finishing transaction 70322638836580
      Debug: Loaded state in 0.02 seconds
      Debug: Loaded state in 0.00 seconds
      Info: Applying configuration version '1397847690'
      Debug: Prefetching parsed resources for mount
      Debug: Executing '/bin/mount'
      Notice: /Stage[main]/Main/Mount[data]/ensure: defined 'ensure' as 'mounted'
      Debug: Flushing mount provider target /etc/fstab
      Debug: Executing '/bin/mount /var/lib/downloads'
      Debug: /Stage[main]/Main/Mount[data]: The container Class[Main] will propagate my refresh event
      Info: /Stage[main]/Main/Mount[data]: Scheduling refresh of Mount[data]
      Info: Mount[data](provider=parsed): Remounting
      Debug: Executing '/bin/mount -o remount /var/lib/downloads'
      Notice: /Stage[main]/Main/Mount[data]: Triggered 'refresh' from 1 events
      Debug: /Stage[main]/Main/Mount[data]: The container Class[Main] will propagate my refresh event
      Info: /Stage[main]/Main/Mount[data]: Scheduling refresh of Mount[data]
      Debug: Class[Main]: The container Stage[main] will propagate my refresh event
      Debug: Finishing transaction 70322639866880
      Debug: Storing state
      Debug: Stored state in 0.03 seconds
      Notice: Finished catalog run in 0.16 seconds
      Debug: Using settings: adding file resource 'rrddir': 'File[/var/lib/puppet/rrd]{:group=>"puppet", :loglevel=>:debug, :links=>:follow, :ensure=>:directory, :owner=>"puppet", :mode=>"750", :backup=>false, :path=>"/var/lib/puppet/rrd"}'
      Debug: /File[/var/lib/puppet/rrd]/ensure: created
      Debug: Finishing transaction 70322639022320
      Debug: Received report to process from example.vbox.net
      Debug: Processing report from example.vbox.net with processor Puppet::Reports::Store
      vagrant@example:~$ cat /etc/fstab
      # HEADER: This file was autogenerated at Fri Apr 18 19:01:31 +0000 2014
      # HEADER: by puppet.  While it can still be managed manually, it
      # HEADER: is definitely not recommended.
      # /etc/fstab: static file system information.
      #
      # Use 'blkid' to print the universally unique identifier for a
      # device; this may be used with UUID= as a more robust way to name devices
      # that works even if disks are added and removed. See fstab(5).
      #
      # <file system> <mount point>   <type>  <options>       <dump>  <pass>
      proc	/proc	proc	nodev,noexec,nosuid	0	0
      /dev/mapper/precise64-root	/	ext4	errors=remount-ro	0	1
      # /boot was on /dev/sda1 during installation
      UUID=943029e3-c40d-4412-b3b1-8ad4ceb25e93	/boot	ext2	defaults	0	2
      /dev/mapper/precise64-swap_1	none	swap	sw	0	0
      /dev/loop0	/var/lib/downloads	ext4	rw	0	0
      
      

      Rebooting will end in a 'undefine' state of the system duo the fact that Ubuntu requires a user input(Not good for a VM with no define input/output, beside of the a NIC)

      best regards
      Akendo

      PS: First bug report ever. Hope you can work with this.

      Edit: Adding image of the problem from vagrant example box

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Akendo Alex Sla
              QA Contact:
              Narmadha Perumal
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Zendesk Support