Skip to content

feature: support module include_vars#2717

Merged
kubesphere-prow[bot] merged 1 commit into
kubesphere:feature-gitopsfrom
zxs-test:feat/task-include-vars
Aug 22, 2025
Merged

feature: support module include_vars#2717
kubesphere-prow[bot] merged 1 commit into
kubesphere:feature-gitopsfrom
zxs-test:feat/task-include-vars

Conversation

@zuoxuesong-worker

@zuoxuesong-worker zuoxuesong-worker commented Aug 21, 2025

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

support module include_vars

Which issue(s) this PR fixes:

Fixes #

Special notes for reviewers:

None

Does this PR introduced a user-facing change?

support module include_vars

Additional documentation, usage docs, etc.:


@kubesphere-prow kubesphere-prow Bot added release-note kind/feature Categorizes issue or PR as related to a new feature. labels Aug 21, 2025
@kubesphere-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zuoxuesong-worker

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubesphere-prow kubesphere-prow Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 21, 2025
@zuoxuesong-worker

zuoxuesong-worker commented Aug 21, 2025

Copy link
Copy Markdown
Contributor Author

测试playbook:

---
- hosts:
    - localhost
  roles:
    - install/image

测试roles

- name: add args
  include_vars: "{{ .os.architecture }}/args_a.yaml"
- name: pull images
  image:
    pull:
      images_dir: "{{ .image_dir.path_a }}"
      platform: "{{ .image_pull.platform }}"
      username: "{{ .image_auth.username }}"
      password: "{{ .image_auth.password }}"
      manifests:
        - "harbor.dev.thingsdao.com/edgewize/edgewize-apiserver:v0.9.0"
- name: push images
  image:
    push:
      images_dir: "{{ .image_dir.path_a }}"
      username: "{{ .image_push.username }}"
      password: "{{ .image_push.password }}"
      dest: harbor.dev.thingsdao.com/test/{{ .module.image.src.reference.repository }}:{{ .module.image.src.reference.reference }}

参数文件结构:
|-- project
| |-- playbooks/
| | |-- vars/
| |-- roles/
| | |-- install/
| | | |-- image/
| | | | |-- vars/
| | | | | |-- x86_64/
| | | | | | |-- args_a.yml
| | | | |-- default/
| | | | | |-- main.yml
| | | | | |-- main
| | | | | | |-- a.yaml
| | | | | | |-- b.yaml
| | | | | | |-- password.yaml
| | | | |-- task/
| | | | | |-- main.yml

其中main.yaml

image_dir:
  path: /tmp/a/b/images/

a.yaml

image_auth:
  username: admin

b.yaml

image_pull:
  platform: linux/arm64
image_push:
  username: admin

password.yaml

image_auth:
  password: 112211
image_push:
  password: 112211

args_a.yaml

image_dir:
  path_a: /tmp/a/a/a/images/

@zuoxuesong-worker zuoxuesong-worker force-pushed the feat/task-include-vars branch 2 times, most recently from f0871e9 to 717c343 Compare August 21, 2025 06:33
@kubesphere-prow kubesphere-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 21, 2025
@kubesphere-prow kubesphere-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 21, 2025
@kubesphere-prow kubesphere-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 21, 2025
@zuoxuesong-worker zuoxuesong-worker force-pushed the feat/task-include-vars branch 3 times, most recently from 97df584 to 9de8a55 Compare August 21, 2025 07:19
Comment thread pkg/modules/include_vars.go
Comment thread pkg/modules/include_vars.go
@zuoxuesong-worker zuoxuesong-worker force-pushed the feat/task-include-vars branch 4 times, most recently from c837bb0 to a7bf80f Compare August 21, 2025 09:07
Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>

feature: support task include vars

Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>
@sonarqubecloud

Copy link
Copy Markdown

@redscholar redscholar changed the title feature: support task include vars feature: support module include_vars Aug 22, 2025
@redscholar

Copy link
Copy Markdown
Contributor

/lgtm

@kubesphere-prow kubesphere-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2025
@kubesphere-prow

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: e7356538804fc3912d38e3156169bf882b66616b

@kubesphere-prow kubesphere-prow Bot merged commit a8e533e into kubesphere:feature-gitops Aug 22, 2025
16 checks passed
@zuoxuesong-worker zuoxuesong-worker deleted the feat/task-include-vars branch August 29, 2025 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants