From 8eb63957425f62dfe6463988f39325ecaa092e6f Mon Sep 17 00:00:00 2001 From: Jack Zhang Date: Fri, 25 Oct 2024 22:29:02 +0800 Subject: [PATCH] Set up casc conditionally --- defaults/main.yml | 2 +- molecule/default/converge.yml | 3 ++- tasks/main.yml | 1 + templates/{jenkins.yml.j2 => jenkins.yaml.j2} | 0 4 files changed, 4 insertions(+), 2 deletions(-) rename templates/{jenkins.yml.j2 => jenkins.yaml.j2} (100%) diff --git a/defaults/main.yml b/defaults/main.yml index 0c8c006..1d91147 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -42,7 +42,7 @@ jenkins_plugin_file: plugins.txt jenkins_plugin_file_path: "{{ jenkins_tool_dir }}/plugins.txt" # For JCasc -jenkins_jcasc_template: "jenkins.yml.j2" +jenkins_jcasc_template: "" jenkins_ldap_managed_dn: "" jenkins_ldap_manager_password_secret: "" diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index c47f9c5..f6fb5ca 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -3,7 +3,8 @@ hosts: all vars: jdk_version: 21.0.2 - java_home: "/opt/jdk-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: diff --git a/tasks/main.yml b/tasks/main.yml index be040ad..9fa7b11 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -47,6 +47,7 @@ - name: Set up JCasc ansible.builtin.include_tasks: file: "setup-jcasc.yml" + when: jenkins_jcasc_template - name: Set up Seed job ansible.builtin.include_tasks: diff --git a/templates/jenkins.yml.j2 b/templates/jenkins.yaml.j2 similarity index 100% rename from templates/jenkins.yml.j2 rename to templates/jenkins.yaml.j2