Project

Profile

Help

Issue #1879

Incorrect name when syncing puppet module from the filesystem

Added by tomckay@redhat.com over 4 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.8.3
Platform Release:
2.8.5
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 2
Quarter:

Description

### For creating local motd module ###
sudo mkdir /var/www/html/pub/puppet-modules
sudo chmod a+rw /var/www/html/pub/puppet-modules
git clone https://github.com/puppetlabs/puppetlabs-motd.git
cd puppetlabs-motd
sudo pulp-puppet-module-builder --output-dir /var/www/html/pub/puppet-modules .

Sync this into Pulp with:

pulp-admin puppet repo create --repo-id=motd --feed=file:///var/www/html/pub/puppet-modules
pulp-admin puppet repo sync run --repo-id motd

If you look at the name stored in the DB for that puppet module you'll see:

"name" : "puppetlabs-motd",

The module name is puppetlabs-motd in the metadata.json, but for 2 reasons the name is expected to be just 'motd'.

1. When this module is published with the puppet install distributor, the folder name will be 'puppet-motd' which causes puppet to error when it runs. It expects the folder to be the same name as the puppet class which is motd.

2. This is different from the name produced by this same module brought in via sync-from -puppet-forge or traditional upload.

I recommend having the sync from file:// also use split_filename() as the others[0][1] do today.

[0]: https://github.com/pulp/pulp_puppet/blob/c9598b39f21a366dd771b05f9c6e3831f33f78e2/pulp_puppet_plugins/pulp_puppet/plugins/importers/forge.py#L298
[1]: https://github.com/pulp/pulp_puppet/blob/c9598b39f21a366dd771b05f9c6e3831f33f78e2/pulp_puppet_plugins/pulp_puppet/plugins/importers/upload.py#L46

Associated revisions

Revision 529d2da9 View on GitHub
Added by ipanova@redhat.com over 4 years ago

Incorrect name when syncing puppet module from the filesystem.

closes #1879 closes #1880

https://pulp.plan.io/issues/1879 https://pulp.plan.io/issues/1880

History

#1 Updated by jsherril@redhat.com over 4 years ago

The problem seems to be as the module is being imported, it imports it as the name 'puppetlabs-motd' rather than just 'motd'

#3 Updated by mhrivnak over 4 years ago

  • Priority changed from Normal to High
  • Sprint/Milestone set to 20
  • Triaged changed from No to Yes

#4 Updated by ipanova@redhat.com over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com

#5 Updated by ipanova@redhat.com over 4 years ago

  • Status changed from ASSIGNED to POST
  • Platform Release set to 2.8.4

#6 Updated by bmbouter over 4 years ago

  • Subject changed from incorrect name when syncing puppet module created with pulp-puppet-module-builder to Incorrect name when syncing puppet module from the filesystem
  • Description updated (diff)

Rewriting the description after discussion w/ Katello devs and some testing on my own. @jsherrill, your comment 1 was correct in stating the expected behavior.

#8 Updated by ipanova@redhat.com over 4 years ago

  • Project changed from Pulp to Puppet Support

#9 Updated by ipanova@redhat.com over 4 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#10 Updated by semyers over 4 years ago

  • Status changed from MODIFIED to 5

#11 Updated by semyers over 4 years ago

  • Platform Release changed from 2.8.4 to 2.8.5

#12 Updated by semyers over 4 years ago

  • Status changed from 5 to MODIFIED

#13 Updated by pthomas@redhat.com over 4 years ago

  • Status changed from MODIFIED to 6

verified

[root@cloud-qe-14 ~]# rpm -qa |grep pulp-puppet
python-pulp-puppet-common-2.8.4-0.1.beta.el7.noarch
pulp-puppet-admin-extensions-2.8.4-0.1.beta.el7.noarch
pulp-puppet-plugins-2.8.4-0.1.beta.el7.noarch
pulp-puppet-tools-2.8.4-0.1.beta.el7.noarch
[root@cloud-qe-14 ~]# 

[root@cloud-qe-14 ~]# sudo mkdir /var/www/html/pub/puppet-modules
mkdir: cannot create directory ‘/var/www/html/pub/puppet-modules’: No such file or directory
[root@cloud-qe-14 ~]# ls -l /var/www/html/
total 0
[root@cloud-qe-14 ~]# sudo mkdir /var/www/html/pub/
[root@cloud-qe-14 ~]# sudo mkdir /var/www/html/pub/puppet-modules
[root@cloud-qe-14 ~]# sudo chmod a+rw /var/www/html/pub/puppet-modules
[root@cloud-qe-14 ~]# git clone https://github.com/puppetlabs/puppetlabs-motd.git
Cloning into 'puppetlabs-motd'...
remote: Counting objects: 344, done.
remote: Total 344 (delta 0), reused 0 (delta 0), pack-reused 344
Receiving objects: 100% (344/344), 68.85 KiB | 0 bytes/s, done.
Resolving deltas: 100% (103/103), done.
[root@cloud-qe-14 ~]# cd puppetlabs-motd
[root@cloud-qe-14 puppetlabs-motd]# sudo pulp-puppet-module-builder --output-dir /var/www/html/pub/puppet-modules .
cd .
git status
git remote show -n origin
git fetch
git fetch --tags
find . -name Modulefile -o -name metadata.json
puppet module build .
mkdir -p /var/www/html/pub/puppet-modules
cp ./pkg/puppetlabs-motd-1.4.0.tar.gz /var/www/html/pub/puppet-modules
cd /var/www/html/pub/puppet-modules
cd /root/puppetlabs-motd
cd /root/puppetlabs-motd
[root@cloud-qe-14 puppetlabs-motd]# pulp-admin puppet repo create --repo-id=motd --feed=file:///var/www/html/pub/puppet-modules
Successfully created repository [motd]

[root@cloud-qe-14 puppetlabs-motd]# pulp-admin puppet repo sync run --repo-id motd
+----------------------------------------------------------------------+
                    Synchronizing Repository [motd]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading metadata...
[==================================================] 100%
Metadata Query: 1/1 items
... completed

Downloading new modules...
[==================================================] 100%
Module: 0/0 items
... completed

Task Succeeded

Publishing modules...
[==================================================] 100%
Module: 1/1 items
... completed

Generating repository metadata...
[-]
... completed

Publishing repository over HTTP...
... completed

Publishing repository over HTTPS...
... skipped

Task Succeeded

[root@cloud-qe-14 puppetlabs-motd]# pulp-admin puppet repo modules --repo-id motd
Name:               motd
Version:            1.4.0
Author:             puppetlabs
Checksum:           2208c834479e6be21893d5d644398802ecb0b7a1565801877488fb62c15f
                    f8c0
Checksum Type:      sha256
Dependencies:       
  Name:                puppetlabs/registry
  Version Requirement: >= 1.0.0 < 2.0.0
  Name:                puppetlabs/stdlib
  Version Requirement: >= 2.1.0 < 5.0.0
Description:        This module simply manages /etc/motd or the Windows Logon
                    Message as a template, showing interpolation of system
                    attributes
Downloaded:         True
License:            Apache-2.0
Project Page:       https://github.com/puppetlabs/puppetlabs-motd
Pulp User Metadata: 
Source:             https://github.com/puppetlabs/puppetlabs-motd
Summary:            A simple module to demonstrate managing /etc/motd or Windows
                    Logon Message as a template
Tag List:           

#14 Updated by semyers about 4 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#16 Updated by bmbouter over 2 years ago

  • Sprint set to Sprint 2

#17 Updated by bmbouter over 2 years ago

  • Sprint/Milestone deleted (20)

#18 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF