From 16fe7bbd3f18c268376e85702f7814a061673ba4 Mon Sep 17 00:00:00 2001 From: vass Date: Wed, 1 Apr 2020 20:00:36 +0200 Subject: [PATCH] Rename install-pdk-dependencies to ensure-pdk-dependencies for consistency The old role will be kept and include ensure-pdk-dependencies for backwards-compatability. Change-Id: Ia269db36655685fe3f4dc54c60ae4bc09a913f52 --- doc/source/puppet-roles.rst | 3 ++- roles/build-puppet-module/README.rst | 2 +- roles/ensure-pdk-dependencies/README.rst | 5 +++++ roles/ensure-pdk-dependencies/tasks/main.yaml | 19 ++++++++++++++++ roles/install-pdk-dependencies/README.rst | 6 +---- .../install-pdk-dependencies/tasks/main.yaml | 22 +++---------------- zuul-tests.d/puppet-roles-jobs.yaml | 10 ++++----- 7 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 roles/ensure-pdk-dependencies/README.rst create mode 100644 roles/ensure-pdk-dependencies/tasks/main.yaml diff --git a/doc/source/puppet-roles.rst b/doc/source/puppet-roles.rst index 3d0da8b6d..740c6da0e 100644 --- a/doc/source/puppet-roles.rst +++ b/doc/source/puppet-roles.rst @@ -2,6 +2,7 @@ Puppet Roles ============ .. zuul:autorole:: build-puppet-module -.. zuul:autorole:: install-pdk-dependencies +.. zuul:autorole:: ensure-pdk-dependencies .. zuul:autorole:: fetch-puppet-module-output +.. zuul:autorole:: install-pdk-dependencies .. zuul:autorole:: upload-forge diff --git a/roles/build-puppet-module/README.rst b/roles/build-puppet-module/README.rst index ec3a6dacb..ab713c5dd 100644 --- a/roles/build-puppet-module/README.rst +++ b/roles/build-puppet-module/README.rst @@ -5,7 +5,7 @@ Development Kit (PDK). This role requires installed Ruby, Ruby development and build tools (gcc/g++ and make) packages, they can be installed using the - :zuul:role:`install-pdk-dependencies` role. + :zuul:role:`ensure-pdk-dependencies` role. **Role Variables** diff --git a/roles/ensure-pdk-dependencies/README.rst b/roles/ensure-pdk-dependencies/README.rst new file mode 100644 index 000000000..4893ee70f --- /dev/null +++ b/roles/ensure-pdk-dependencies/README.rst @@ -0,0 +1,5 @@ +Ensure dependencies for Puppet Development Kit are installed + +This role installs all dependencies for Puppet Development Kit (PDK) +so that puppet modules can be build with the PDK and published to the +forge. diff --git a/roles/ensure-pdk-dependencies/tasks/main.yaml b/roles/ensure-pdk-dependencies/tasks/main.yaml new file mode 100644 index 000000000..032cd2e32 --- /dev/null +++ b/roles/ensure-pdk-dependencies/tasks/main.yaml @@ -0,0 +1,19 @@ +- name: Install ruby dependencies on Red Hat/SUSE based distribution + package: + name: + - ruby-devel + - gcc-c++ + - make + state: present + become: yes + when: ansible_os_family == "RedHat" or ansible_os_family == "Suse" + +- name: Install ruby dependencies on Debian based distribution + package: + name: + - ruby-dev + - g++ + - make + state: present + become: yes + when: ansible_os_family == "Debian" diff --git a/roles/install-pdk-dependencies/README.rst b/roles/install-pdk-dependencies/README.rst index 4893ee70f..0d0143dec 100644 --- a/roles/install-pdk-dependencies/README.rst +++ b/roles/install-pdk-dependencies/README.rst @@ -1,5 +1 @@ -Ensure dependencies for Puppet Development Kit are installed - -This role installs all dependencies for Puppet Development Kit (PDK) -so that puppet modules can be build with the PDK and published to the -forge. +.. warning:: Deprecated, use ensure-pdk-dependencies instead. diff --git a/roles/install-pdk-dependencies/tasks/main.yaml b/roles/install-pdk-dependencies/tasks/main.yaml index 032cd2e32..9f985fe32 100644 --- a/roles/install-pdk-dependencies/tasks/main.yaml +++ b/roles/install-pdk-dependencies/tasks/main.yaml @@ -1,19 +1,3 @@ -- name: Install ruby dependencies on Red Hat/SUSE based distribution - package: - name: - - ruby-devel - - gcc-c++ - - make - state: present - become: yes - when: ansible_os_family == "RedHat" or ansible_os_family == "Suse" - -- name: Install ruby dependencies on Debian based distribution - package: - name: - - ruby-dev - - g++ - - make - state: present - become: yes - when: ansible_os_family == "Debian" +- name: Include ensure-pdk-dependencies. + include_role: + name: ensure-pdk-dependencies diff --git a/zuul-tests.d/puppet-roles-jobs.yaml b/zuul-tests.d/puppet-roles-jobs.yaml index 13e4bd15c..463a083d4 100644 --- a/zuul-tests.d/puppet-roles-jobs.yaml +++ b/zuul-tests.d/puppet-roles-jobs.yaml @@ -1,11 +1,11 @@ - job: - name: zuul-jobs-test-install-pdk-dependencies - description: Test the install-pdk-dependencies role + name: zuul-jobs-test-ensure-pdk-dependencies + description: Test the ensure-pdk-dependencies role files: - - roles/install-pdk-dependencies/.* + - roles/ensure-pdk-dependencies/.* run: test-playbooks/simple-role-test.yaml vars: - role_name: install-pdk-dependencies + role_name: ensure-pdk-dependencies # -* AUTOGENERATED *- # The following project section is autogenerated by @@ -15,6 +15,6 @@ - project: check: jobs: &id001 - - zuul-jobs-test-install-pdk-dependencies + - zuul-jobs-test-ensure-pdk-dependencies gate: jobs: *id001