Skip to content

Commit

Permalink
install plugins conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
zhan9san committed Oct 26, 2024
1 parent dddf161 commit a2c6ab4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jenkins_plugin_manager_url: "{{ jenkins_plugin_manager_url_prefix }}/{{ jenkins_
jenkins_tool_dir: /opt/jenkins_tool
jenkins_plugin_manager_path: "{{ jenkins_tool_dir }}/jenkins-plugin-manager.jar"

jenkins_plugin_file: plugins.txt
jenkins_plugin_file: ""
jenkins_plugin_file_path: "{{ jenkins_tool_dir }}/plugins.txt"

# For JCasc
Expand Down
14 changes: 8 additions & 6 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
- name: Converge
hosts: all
vars:
jdk_version: 21.0.2
java_home: /opt/jdk-21.0.2
jenkins_jcasc_template: jenkins.yaml.j2
jenkins_systemd_unit_envs:
java_home: "{{ java_home }}"
tasks:
- name: "Include zhan9san.java"
ansible.builtin.include_role:
name: "zhan9san.java"
vars:
jdk_version: 21.0.2

Check failure on line 9 in molecule/default/converge.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use role_name_ as a prefix. (vars: jdk_version)
- name: "Include zhan9san.jenkins"
ansible.builtin.include_role:
name: "zhan9san.jenkins"
vars:
java_home: /opt/jdk-21.0.2

Check failure on line 14 in molecule/default/converge.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

var-naming[no-role-prefix]

Variables names from within roles should use role_name_ as a prefix. (vars: java_home)
jenkins_plugin_file: plugins.txt
jenkins_jcasc_template: jenkins.yaml.j2
jenkins_systemd_unit_envs:
java_home: "{{ java_home }}"
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- name: Set up Plugin
ansible.builtin.include_tasks:
file: "setup-plugin.yml"
when: jenkins_plugin_file

- name: Set up JCasc
ansible.builtin.include_tasks:
Expand Down

0 comments on commit a2c6ab4

Please sign in to comment.