Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config.pp creates tmp as file but selinux_build_module_simple.sh wants to create a dir #215

Closed
ericcolruyt opened this issue Apr 26, 2017 · 1 comment
Labels
bug Something isn't working

Comments

@ericcolruyt
Copy link

ericcolruyt commented Apr 26, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.7.1
  • Ruby: 2.1.9p490
  • Distribution: RHEL7.3
  • Module version: 1.0.0

How to reproduce (e.g Puppet code you use)

selinux::module {"ovcd_hostname":
  ensure    => present,
  source_te => "puppet:///modules/ito_systlinux_colruyt/usr/share/selinux/targeted/ovcd_hostname.te",
}

What are you seeing

...
Info: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[clean-module-ovcd_hostname]: Scheduling refresh of Exec[build-module-ovcd_hostname]
Notice: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[build-module-ovcd_hostname]/returns: mkdir: cannot create directory ‘tmp’: File exists
Error: /opt/puppetlabs/puppet/cache/puppet-selinux/bin/selinux_build_module_simple.sh ovcd_hostname /opt/puppetlabs/puppet/cache/puppet-selinux/modules || (rm -f /opt/puppetlabs/puppet/cache/puppet-selinux/modules/ovcd_hostname.pp /opt/puppetlabs/puppet/cache/puppet-selinux/modules/ovcd_hostname.loaded && exit 1) returned 1 instead of one of [0]
Error: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[build-module-ovcd_hostname]/returns: change from notrun to 0 failed: /opt/puppetlabs/puppet/cache/puppet-selinux/bin/selinux_build_module_simple.sh ovcd_hostname /opt/puppetlabs/puppet/cache/puppet-selinux/modules || (rm -f /opt/puppetlabs/puppet/cache/puppet-selinux/modules/ovcd_hostname.pp /opt/puppetlabs/puppet/cache/puppet-selinux/modules/ovcd_hostname.loaded && exit 1) returned 1 instead of one of [0]
Notice: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[build-module-ovcd_hostname]/returns: mkdir: cannot create directory ‘tmp’: File exists
Error: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[build-module-ovcd_hostname]: Failed to call refresh: /opt/puppetlabs/puppet/cache/puppet-selinux/bin/selinux_build_module_simple.sh ovcd_hostname /opt/puppetlabs/puppet/cache/puppet-selinux/modules || (rm -f /opt/puppetlabs/puppet/cache/puppet-selinux/modules/ovcd_hostname.pp /opt/puppetlabs/puppet/cache/puppet-selinux/modules/ovcd_hostname.loaded && exit 1) returned 1 instead of one of [0]
Error: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[build-module-ovcd_hostname]: /opt/puppetlabs/puppet/cache/puppet-selinux/bin/selinux_build_module_simple.sh ovcd_hostname /opt/puppetlabs/puppet/cache/puppet-selinux/modules || (rm -f /opt/puppetlabs/puppet/cache/puppet-selinux/modules/ovcd_hostname.pp /opt/puppetlabs/puppet/cache/puppet-selinux/modules/ovcd_hostname.loaded && exit 1) returned 1 instead of one of [0]
Notice: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[install-module-ovcd_hostname]: Dependency Exec[build-module-ovcd_hostname] has failures: true
Warning: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[install-module-ovcd_hostname]: Skipping because of failed dependencies
...

What behaviour did you expect instead

Info: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[clean-module-ovcd_hostname]: Scheduling refresh of Exec[build-module-ovcd_hostname]
Notice: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[build-module-ovcd_hostname]/returns: executed successfully
Info: /Stage[main]/Ito_systlinux_colruyt::Setup/Zz_selinux_systlinux_colruyt::Module[ovcd_hostname]/Selinux::Module[ovcd_hostname]/Exec[build-module-ovcd_hostname]: Scheduling refresh of Exec[install-module-ovcd_hostname]

Output log

See above

Any additional information you'd like to impart

After modifying the following in config.pp, things worked as expected:

  # created by refpolicy builder and our simple builder
  # ensure it does not get purged
  file {"${module_build_dir}/tmp":
    ensure => directory,
    selinux_ignore_defaults => true
  }
@oranenj
Copy link
Contributor

oranenj commented Apr 29, 2017

The proposed fix seems fine to me, so I created a PR

@oranenj oranenj added the bug Something isn't working label Apr 29, 2017
@oranenj oranenj changed the title config.pp creates tmp as file but selinux_build_module_simple.sh want to create a dir config.pp creates tmp as file but selinux_build_module_simple.sh wants to create a dir May 4, 2017
EmRowlands pushed a commit to EmRowlands/puppet-selinux that referenced this issue Mar 29, 2023
cegeka-jenkins pushed a commit to cegeka/puppet-selinux that referenced this issue Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants