Skip to content

Commit

Permalink
[reproducer] Add support for installing kustomize
Browse files Browse the repository at this point in the history
This change installs kustomize binary on the controller type nodes
as required by kustomize_deploy role.

Signed-off-by: Pragadeeswaran Sathyanarayanan <psathyan@redhat.com>
  • Loading branch information
psathyan committed May 15, 2024
1 parent 5b9323b commit f4551b6
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
2 changes: 2 additions & 0 deletions roles/reproducer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ cifmw_reproducer_supported_hypervisor_os:
minimum_version: 9
RedHat:
minimum_version: 9.3
cifmw_reproducer_kustomize_install_script: >-
https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh
4 changes: 4 additions & 0 deletions roles/reproducer/tasks/configure_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
- wget
- jq

- name: Install kustomize binary
ansible.builtin.include_tasks:
file: install_kustomize.yml

- name: Build job inventory for hook usage
tags:
- bootstrap
Expand Down
73 changes: 73 additions & 0 deletions roles/reproducer/tasks/install_kustomize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
# Copyright Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


- name: Ensure the directories exist
ansible.builtin.file:
path: "{{ item.dir_name }}"
mode: "{{ item.mode }}"
state: "directory"
owner: "{{ ansible_user_id }}"
group: "{{ ansible_user_id }}"
loop:
- dir_name: >-
{{
(cifmw_reproducer_basedir, 'tmp') | ansible.builtin.path_join
}}
mode: "0755"
- dir_name: >-
{{
(ansible_user_dir, '.local') | ansible.builtin.path_join
}}
mode: "0700"
- dir_name: >-
{{
(ansible_user_dir, '.local', 'bin') | ansible.builtin.path_join
}}
mode: "0755"
loop_control:
label: "{{ item.dir_name }}"

- name: Download the kustomize install script
ansible.builtin.get_url:
url: "{{ cifmw_reproducer_kustomize_install_script }}"
dest: >-
{{
(
cifmw_reproducer_basedir,
'tmp',
'install-kustomize.sh'
) | ansible.builtin.path_join
}}
mode: '0755'
validate_certs: false

- name: Execute the kustomize install script
ansible.builtin.command:
chdir: >-
{{
(ansible_user_dir, '.local', 'bin') | ansible.builtin.path_join
}}
cmd: >-
{{
(cifmw_reproducer_basedir, 'tmp', 'install-kustomize.sh')
| ansible.builtin.path_join
}}
creates: >-
{{
(ansible_user_dir, '.local', 'bin', 'kustomize')
| ansible.builtin.path_join
}}

0 comments on commit f4551b6

Please sign in to comment.