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>
This commit is contained in:
Paul Belanger 2015-12-11 13:10:12 -05:00
parent 52df7fc47f
commit cc889939dc
4 changed files with 42 additions and 0 deletions

View File

@ -29,6 +29,20 @@ do not manage them.
Role Variables
--------------
.. code-block:: yaml
# Name of the user to be used.
# Default: root
jenkins_job_builder_user_name: root
# Name of the group to be used.
# Default: root
jenkins_job_builder_user_group: root
# Path of home directory to be used.
# Default: /var/lib/jenkins_job_builder
jenkins_job_builder_user_home: /var/lib/jenkins_job_builder
Dependencies
------------

View File

@ -12,6 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
---
# tasks/config.yaml
jenkins_job_builder_user_name: root
jenkins_job_builder_user_group: "{{ jenkins_job_builder_user_name }}"
jenkins_job_builder_user_home: /var/lib/jenkins_job_builder
# tasks/install.yaml
jenkins_job_builder_git_dest: /opt/ansible-role-jenkins-job-builder/git/openstack-infra/jenkins-job-builder
jenkins_job_builder_git_uri: https://git.openstack.org/openstack-infra/jenkins-job-builder

View File

@ -12,3 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Create required directories.
file:
group: "{{ jenkins_job_builder_user_group }}"
owner: "{{ jenkins_job_builder_user_name }}"
path: "{{ item }}"
state: directory
with_items:
- "{{ jenkins_job_builder_user_home }}"

View File

@ -25,3 +25,18 @@
roles:
- "{{ rolename }}"
post_tasks:
- name: Register jenkins_job_builder_user_home.
stat:
path: /var/lib/jenkins_job_builder
register: jenkins_job_builder_user_home_stat
- name: Assert jenkins_job_builder_user_home tests.
assert:
that:
- jenkins_job_builder_user_home_stat.stat.exists
- jenkins_job_builder_user_home_stat.stat.isdir
- jenkins_job_builder_user_home_stat.stat.pw_name == 'root'
- jenkins_job_builder_user_home_stat.stat.gr_name == 'root'
- jenkins_job_builder_user_home_stat.stat.mode == '0755'