camptocamp / puppet-nfs

manage your nfs shares (client and server)
Apache License 2.0
30 stars 70 forks source link

Ephemeral IP in export file #72

Open rmalenko opened 4 years ago

rmalenko commented 4 years ago

I had a test server with IP 1.1.1.1, then I removed this IP everywhere in manifests, even restart NFS server, like windows :) But this IP appears again in export 1.1.1.1, like this

/nfs_server     2.2.2.2(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash)
/nfs_server     1.1.1.1

Could you prompt me where I could look for to resolve , please?

raphink commented 4 years ago

I'm guessing you mean you had a nfs::export resource, and removed it from your code and it didn't remove it. Is that correct?

rmalenko commented 4 years ago

Yes, sorry for non-exhaustive information

This IP was absent

  include nfs::server
  $exportdir  = '/backup'
  nfs::export { 'clickhouse':
    ensure  => absent,
    guest   => '111.111.111.111',
    share   => $exportdir,
    options => 'rw,fsid=0,insecure,no_subtree_check,async,no_root_squash',
  }
...

however, I see it in export file like this

/backup     22.22.22.22(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash)
/backup     111.111.111.111
raphink commented 4 years ago

Can you check the following please?

grep concat::fragment $(puppet config print statedir)/resources.txt
rmalenko commented 4 years ago

Yes, of course. Empty result.

This command on puppet agent gives: cat /opt/puppetlabs/puppet/cache/state/resources.txt | grep 'concat' concat_file[/etc/exports]

on puppet server

concat_file[/etc/ssh/sshd_config]
concat_file[/etc/apache2/ports.conf]
concat_file[15-default.conf]
concat_file[15-default-ssl.conf]
concat_file[25-infra-puppet.conf]
concat_file[25-files-puppet.conf]
raphink commented 4 years ago

The Puppet server's resources.txt relates to its agent, so it's irrelevant to this issue.

The fragment is not listed on the agent so it should be removed from the file. Do you see anything related to /etc/exports in a Puppet agent log with --debug?

rmalenko commented 4 years ago

Here are debug output

Debug: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/notify: notify to Exec[reload_nfs_srv]
Debug: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/Concat_file[/etc/exports]/before: before to File[/etc/exports]
Debug: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/Concat_file[/etc/exports]: Skipping automatic relationship with File[/etc/exports]
Debug: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/File[/etc/exports]: Adding autorequire relationship with User[root]
Debug: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/File[/etc/exports]: Adding autorequire relationship with Group[root]
Debug: Executing: 'diff -u /etc/exports /tmp/puppet-file20200305-17118-njmgqk'
Notice: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/File[/etc/exports]/content: 
--- /etc/exports    2020-03-05 14:34:41.911790955 +0300
Info: Computing checksum on file /etc/exports
Info: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/File[/etc/exports]: Filebucketed /etc/exports to puppet with sum c0d0dbfd5a1e4849ca4c1d89f4e031a4
Debug: Executing: 'diff -u /etc/exports /tmp/puppet-file20200305-17118-5mgzp8'
Notice: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/File[/etc/exports]/content: 
Notice: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/File[/etc/exports]/content: content changed '{md5}c0d0dbfd5a1e4849ca4c1d89f4e031a4' to '{md5}1e6f28048ead3caae0d250cdf3192ee9' (corrective)
Debug: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/File[/etc/exports]: The container Concat[/etc/exports] will propagate my refresh event
Debug: /Stage[main]/Nfs::Server::Debian/Concat[/etc/exports]/File[/etc/exports]: The container /etc/exports will propagate my refresh event
Debug: /etc/exports: The container Concat[/etc/exports] will propagate my refresh event
Debug: Concat[/etc/exports]: The container Class[Nfs::Server::Debian] will propagate my refresh event
Info: Concat[/etc/exports]: Scheduling refresh of Exec[reload_nfs_srv]
Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/onlyif:   Process: 8459 ExecReload=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/onlyif: Mar 05 14:26:24 backup exportfs[7849]: exportfs: /etc/exports [6]: Neither 'subtree_check' or 'no_subtree_check' specified for export "1.1.1.1:/backup_nfs_server".
Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/onlyif: Mar 05 14:26:24 backup exportfs[7849]:   Assuming default behaviour ('no_subtree_check').
Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/onlyif: Mar 05 14:26:24 backup exportfs[7849]:   NOTE: this default has changed since nfs-utils version 1.0.x
Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/onlyif: Mar 05 14:26:24 backup exportfs[7849]: exportfs: incompatible duplicated export entries:
Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/onlyif: Mar 05 14:26:24 backup exportfs[7849]: exportfs:         1.1.1.1:/backup_nfs_server (0x425) [IGNORED]
Debug: /Stage[main]/Nfs::Server::Debian/Exec[reload_nfs_srv]/onlyif: Mar 05 14:26:24 backup exportfs[7849]: exportfs:         1.1.1.1:/backup_nfs_server (0x2432)
nfs::export { 'ch-02':
    ensure  => present,
    guest   => '1.1.1.1',
    share   => $exportdir,
    options => 'rw,fsid=0,insecure,no_subtree_check,async,no_root_squash',
  }