diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 9ef6914..b1cde4f 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -6,8 +6,6 @@ jenkins_java_home: /opt/jdk-21.0.2 jenkins_plugin_file: plugins.txt jenkins_jcasc_template: jenkins.yaml.j2 - jenkins_systemd_unit_envs: - java_home: "{{ jenkins_java_home }}" tasks: - name: "Include zhan9san.java" ansible.builtin.include_role: diff --git a/tasks/main.yml b/tasks/main.yml index 9994eb8..8569428 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,20 +20,18 @@ - name: Install Jenkins ansible.builtin.include_tasks: "setup-{{ ansible_os_family | lower }}.yml" +- name: Ensure Jenkins systemd unit file dir exists + ansible.builtin.file: + path: /etc/systemd/system/jenkins.service.d + state: directory + mode: "0755" + - name: Update Jenkins systemd unit file - when: jenkins_systemd_unit_envs is defined and jenkins_systemd_unit_envs - block: - - name: Ensure Jenkins systemd unit file dir exists - ansible.builtin.file: - path: /etc/systemd/system/jenkins.service.d - state: directory - mode: "0755" - - name: Update Jenkins systemd unit file - ansible.builtin.template: - src: override.conf.j2 - dest: /etc/systemd/system/jenkins.service.d/override.conf - mode: "0644" - notify: Reload systemd units + ansible.builtin.template: + src: override.conf.j2 + dest: /etc/systemd/system/jenkins.service.d/override.conf + mode: "0644" + notify: Reload systemd units - name: Set up Nginx ansible.builtin.include_tasks: