Browse Source

Use PDK to build puppet module

The puppet module command is deprecated and
is replaced by using the PDK [1] [2].

The difference between the two commands is only
the output in the pkg directory.

The old puppet module command will create a folder and a tarball with the module.

$ls pkg/
openstack-openstacklib-14.1.0/
openstack-openstacklib-14.1.0.tar.gz

While the PDK will only create the tarball in the
pkg folder. This should be no problem since I can't
find anywhere were we are using the generated folder
in the pkg folder.

This is part 2 in the series, it makes the actual change.

Depends-On: https://review.opendev.org/667589
Depends-On: https://review.opendev.org/667595
Needed-By: https://review.opendev.org/627554
Needed-By: https://review.opendev.org/627566
Change-Id: Id40ff665e92606455ef6b544f11394db2201c8b9
changes/34/627534/11
Tobias Urdin 1 month ago
parent
commit
ea3f5be9c2
2 changed files with 19 additions and 3 deletions
  1. 8
    2
      roles/build-puppet-module/README.rst
  2. 11
    1
      roles/build-puppet-module/tasks/main.yaml

+ 8
- 2
roles/build-puppet-module/README.rst View File

@@ -1,5 +1,11 @@
1
-An ansible role to build a Puppet module.  This role assumes that Puppet is
2
-already installed on the target system (either manually or using bindep).
1
+An Ansible role to build a Puppet module using the Puppet
2
+Development Kit (PDK).
3
+
4
+.. note::
5
+
6
+   This role requires installed Ruby, Ruby development and build tools
7
+   (gcc/g++ and make) packages, they can be installed using the
8
+   :zuul:role:`install-pdk-dependencies` role.
3 9
 
4 10
 **Role Variables**
5 11
 

+ 11
- 1
roles/build-puppet-module/tasks/main.yaml View File

@@ -1,4 +1,14 @@
1
+- name: Find out ruby gem user directory
2
+  command: ruby -e 'puts Gem.user_dir'
3
+  register: gem_user_dir
4
+
5
+- name: Install pdk gem
6
+  gem:
7
+    name: pdk
8
+
1 9
 - name: Build puppet module
2
-  command: puppet module build .
10
+  command: pdk build --force
3 11
   args:
4 12
     chdir: "{{ puppet_module_chdir }}"
13
+  environment:
14
+    PATH: "{{ gem_user_dir.stdout }}/bin:{{ ansible_env.PATH }}"

Loading…
Cancel
Save