summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Belanger <pabelanger@redhat.com>2015-12-11 13:10:12 -0500
committerPaul Belanger <pabelanger@redhat.com>2015-12-11 13:42:22 -0500
commitcc889939dc147d015a398ef5d25c51b66714b3a1 (patch)
treef657ad3c695beee85ec0fb9635d1dafc0769a27d
parent52df7fc47f6aaf4752b0a1d5641b37d72afbd9f5 (diff)
Create required directories
This is the first step to start templating the jjb configuration. Change-Id: I536f2a705d2c70ccf285ac45ba876b52b28aa3d5 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Paul Belanger <pabelanger@redhat.com> Workflow+1: Paul Belanger <pabelanger@redhat.com> Submitted-by: Jenkins Submitted-at: Fri, 11 Dec 2015 20:12:57 +0000 Reviewed-on: https://review.openstack.org/256617 Project: openstack/ansible-role-jenkins-job-builder Branch: refs/heads/master
-rw-r--r--README.rst14
-rw-r--r--defaults/main.yaml5
-rw-r--r--tasks/config.yaml8
-rw-r--r--tests/test.yaml15
4 files changed, 42 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index 7eea9b0..0c3acfa 100644
--- a/README.rst
+++ b/README.rst
@@ -29,6 +29,20 @@ do not manage them.
29Role Variables 29Role Variables
30-------------- 30--------------
31 31
32.. code-block:: yaml
33
34 # Name of the user to be used.
35 # Default: root
36 jenkins_job_builder_user_name: root
37
38 # Name of the group to be used.
39 # Default: root
40 jenkins_job_builder_user_group: root
41
42 # Path of home directory to be used.
43 # Default: /var/lib/jenkins_job_builder
44 jenkins_job_builder_user_home: /var/lib/jenkins_job_builder
45
32Dependencies 46Dependencies
33------------ 47------------
34 48
diff --git a/defaults/main.yaml b/defaults/main.yaml
index 30c1a84..9769b26 100644
--- a/defaults/main.yaml
+++ b/defaults/main.yaml
@@ -12,6 +12,11 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14--- 14---
15# tasks/config.yaml
16jenkins_job_builder_user_name: root
17jenkins_job_builder_user_group: "{{ jenkins_job_builder_user_name }}"
18jenkins_job_builder_user_home: /var/lib/jenkins_job_builder
19
15# tasks/install.yaml 20# tasks/install.yaml
16jenkins_job_builder_git_dest: /opt/ansible-role-jenkins-job-builder/git/openstack-infra/jenkins-job-builder 21jenkins_job_builder_git_dest: /opt/ansible-role-jenkins-job-builder/git/openstack-infra/jenkins-job-builder
17jenkins_job_builder_git_uri: https://git.openstack.org/openstack-infra/jenkins-job-builder 22jenkins_job_builder_git_uri: https://git.openstack.org/openstack-infra/jenkins-job-builder
diff --git a/tasks/config.yaml b/tasks/config.yaml
index ca41d99..9e51ebf 100644
--- a/tasks/config.yaml
+++ b/tasks/config.yaml
@@ -12,3 +12,11 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14--- 14---
15- name: Create required directories.
16 file:
17 group: "{{ jenkins_job_builder_user_group }}"
18 owner: "{{ jenkins_job_builder_user_name }}"
19 path: "{{ item }}"
20 state: directory
21 with_items:
22 - "{{ jenkins_job_builder_user_home }}"
diff --git a/tests/test.yaml b/tests/test.yaml
index 5fa16b8..98be0ec 100644
--- a/tests/test.yaml
+++ b/tests/test.yaml
@@ -25,3 +25,18 @@
25 25
26 roles: 26 roles:
27 - "{{ rolename }}" 27 - "{{ rolename }}"
28
29 post_tasks:
30 - name: Register jenkins_job_builder_user_home.
31 stat:
32 path: /var/lib/jenkins_job_builder
33 register: jenkins_job_builder_user_home_stat
34
35 - name: Assert jenkins_job_builder_user_home tests.
36 assert:
37 that:
38 - jenkins_job_builder_user_home_stat.stat.exists
39 - jenkins_job_builder_user_home_stat.stat.isdir
40 - jenkins_job_builder_user_home_stat.stat.pw_name == 'root'
41 - jenkins_job_builder_user_home_stat.stat.gr_name == 'root'
42 - jenkins_job_builder_user_home_stat.stat.mode == '0755'