Browse Source

Prepare: 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 1 in a series of two changes, it contains a role to install
the package dependencies (run in pre.yaml before revoke-sudo is called),
the followup change adds the role to actually build. We need those two
steps to not introduce breakage since the users of build-puppet-module
need to be updated before we can change build-puppet-module.

Change-Id: Ief299751c001542b10fcdf44f1b40a169135877a
Needed-By: https://review.opendev.org/667589
Needed-By: https://review.opendev.org/667595
Co-Authored-By: Tobias Urdin <tobias.urdin@binero.se>
changes/90/667590/5
Andreas Jaeger 1 month ago
parent
commit
0efea94054

+ 1
- 0
doc/source/puppet-roles.rst View File

@@ -2,5 +2,6 @@ Puppet Roles
2 2
 ============
3 3
 
4 4
 .. zuul:autorole:: build-puppet-module
5
+.. zuul:autorole:: install-pdk-dependencies
5 6
 .. zuul:autorole:: fetch-puppet-module-output
6 7
 .. zuul:autorole:: upload-forge

+ 5
- 0
roles/install-pdk-dependencies/README.rst View File

@@ -0,0 +1,5 @@
1
+Ensure dependencies for Puppet Development Kit are installed
2
+
3
+This role installs all dependencies for Puppet Development Kit (PDK)
4
+so that puppet modules can be build with the PDK and published to the
5
+forge.

+ 19
- 0
roles/install-pdk-dependencies/tasks/main.yaml View File

@@ -0,0 +1,19 @@
1
+- name: Install ruby dependencies on Red Hat/SUSE based distribution
2
+  package:
3
+    name:
4
+      - ruby-devel
5
+      - gcc-c++
6
+      - make
7
+    state: present
8
+  become: yes
9
+  when: ansible_os_family == "RedHat" or ansible_os_family == "Suse"
10
+
11
+- name: Install ruby dependencies on Debian based distribution
12
+  package:
13
+    name:
14
+      - ruby-dev
15
+      - g++
16
+      - make
17
+    state: present
18
+  become: yes
19
+  when: ansible_os_family == "Debian"

Loading…
Cancel
Save