-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
- name: Verify Jenkins systemd unit environment variables | ||
hosts: all | ||
tasks: | ||
- name: Read override.conf content | ||
ansible.builtin.slurp: | ||
src: /etc/systemd/system/jenkins.service.d/override.conf | ||
register: override_conf_content | ||
|
||
- name: Decode override.conf content | ||
ansible.builtin.set_fact: | ||
override_conf_decoded: "{{ override_conf_content.content | b64decode }}" | ||
|
||
- name: Print decoded override.conf content | ||
ansible.builtin.debug: | ||
var: override_conf_decoded | ||
|
||
- name: Assert JAVA_OPTS is present | ||
ansible.builtin.assert: | ||
that: | ||
- "'JAVA_OPTS=-Djenkins.install.runSetupWizard=false' in override_conf_decoded" | ||
fail_msg: "JAVA_OPTS is not set correctly in override.conf." | ||
|
||
- name: Assert JENKINS_LISTEN_ADDRESS is present | ||
ansible.builtin.assert: | ||
that: | ||
- "'JENKINS_LISTEN_ADDRESS=127.0.0.1' in override_conf_decoded" | ||
fail_msg: "JENKINS_LISTEN_ADDRESS is not set correctly in override.conf." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
[Service] | ||
{% for key, value in jenkins_systemd_unit_envs.items() %} | ||
Environment="{{ key | upper }}={{ value }}" | ||
{% endfor %} | ||
{% if jenkins_java_home is defined %} | ||
Environment="JAVA_HOME={{ jenkins_java_home }}" | ||
{% endif %} | ||
{% if jenkins_java_opts is defined %} | ||
Environment="JAVA_OPTS={{ jenkins_java_opts }}" | ||
{% endif %} | ||
{% if jenkins_listen_address is defined %} | ||
Environment="JENKINS_LISTEN_ADDRESS={{ jenkins_listen_address }}" | ||
{% endif %} | ||
{% if jenkins_secrets_file is defined %} | ||
Environment="SECRETS_FILE={{ jenkins_secrets_file }}" | ||
{% endif %} |