Skip to content

Commit

Permalink
Add parameter to copy custom init.d scripts. Closes #151.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianludwig committed Aug 9, 2017
1 parent 4c63ef2 commit b1480ab
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ env:
prefix: ''
http_port: 8080

# tests/test-plugins-with-pinning.yml
- distro: ubuntu1604
playbook: test-initd-scripts.yml
prefix: ''
http_port: 8080

script:
# Configure test script so we can run extra tests after playbook is run.
- export container_id=$(date +%s)
Expand Down
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jenkins_admin_token_file: ""
jenkins_process_user: jenkins
jenkins_process_group: "{{ jenkins_process_user }}"

jenkins_initd_files: []

jenkins_init_changes:
- option: "JENKINS_ARGS"
value: "--prefix={{ jenkins_url_prefix }}"
Expand Down
9 changes: 9 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
# Configure Jenkins init settings.
- include: settings.yml

- name: Copy init.d scripts
copy:
src: "{{ item }}"
dest: "{{ jenkins_home }}/init.groovy.d/"
owner: "{{ jenkins_process_user }}"
group: "{{ jenkins_process_group }}"
mode: 0664
with_items: "{{ jenkins_initd_files }}"

# Make sure Jenkins starts, then configure Jenkins.
- name: Ensure Jenkins is started and runs on startup.
service: name=jenkins state=started enabled=yes
Expand Down
13 changes: 13 additions & 0 deletions tests/test-initd-scripts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- hosts: all

vars:
jenkins_initd_files:
- "{{ role_path }}/tests/README.md"

pre_tasks:
- include: java-8.yml

roles:
- geerlingguy.java
- role_under_test

0 comments on commit b1480ab

Please sign in to comment.