sahara-ci-config/system-configs/ansible/roles/jjb/tasks/main.yml
Evgeny Sikachev 1bceed5ff6 Added playbook for jjb
Change-Id: Ib5b539375fed1db99c7882f91cce34d0fbe6f520
2017-08-08 13:06:38 +00:00

41 lines
862 B
YAML

---
- name: Create jjb directories
file:
path: "{{ item }}"
owner: "{{ jenkins_user }}"
group: "{{ jenkins_user }}"
mode: 0755
state: directory
with_items:
- /etc/jenkins_jobs
- "{{ ci_dir }}/jjb"
- name: Clone jjb repo
git:
repo: "{{ jjb_git_url }}"
dest: "{{ ci_dir}}/jjb"
become: true
become_user: "{{ jenkins_user }}"
- name: Install jjb to virtualenv
command: tox -e venv --notest
args:
chdir: "{{ ci_dir }}/jjb"
become: true
become_user: "{{ jenkins_user }}"
- name: Copy configs
template:
src: "{{ item }}.j2"
dest: "/etc/jenkins_jobs/{{ item }}"
become: true
with_items:
- credentials.conf
- jenkins_jobs.ini
- name: Create jjb symlink
file:
src: "{{ ci_dir }}/jenkins-job-builder/.tox/venv/bin/jenkins-jobs"
dest: /usr/local/bin/jenkins-jobs
state: link