Add playbook to run Apache2
Change-Id: Iae46bef8c7722c3a956ffba9dc0a299da116c874
This commit is contained in:
parent
86d68a361d
commit
72059adb10
32
system-configs/ansible/roles/apache/tasks/main.yml
Normal file
32
system-configs/ansible/roles/apache/tasks/main.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
- name: Copy files
|
||||||
|
command: cp -r /root/sahara-ci-config/system-configs/sites-available /etc/apache2/sites-available
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Connection of modules
|
||||||
|
apache2_module:
|
||||||
|
name: "{{ item }}"
|
||||||
|
with_items:
|
||||||
|
- proxy
|
||||||
|
- proxy_http
|
||||||
|
- proxy_connect
|
||||||
|
- rewrite
|
||||||
|
- dav
|
||||||
|
- dav_fs
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Connection of cgi modules
|
||||||
|
shell: a2dismod mpm_event | a2enmod mpm_prefork | service apache2 restart | a2enmod cgi
|
||||||
|
|
||||||
|
- name: Restart Apache
|
||||||
|
service:
|
||||||
|
name: apache2
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: Connection of hosts modules
|
||||||
|
shell: for host in $(/etc/apache2/sites-available/*); do sudo a2ensite $(basename $host); done
|
||||||
|
|
||||||
|
- name: Reload Apache
|
||||||
|
service:
|
||||||
|
name: apache2
|
||||||
|
state: reloaded
|
@ -1,40 +0,0 @@
|
|||||||
---
|
|
||||||
- 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
|
|
@ -1,6 +0,0 @@
|
|||||||
[jenkins]
|
|
||||||
user={{ jjb_auth_username }}
|
|
||||||
password={{ jjb_auth_password }}
|
|
||||||
url=http://127.0.0.1/jenkins
|
|
||||||
[job_builder]
|
|
||||||
ignore_cache=True
|
|
@ -4,6 +4,11 @@
|
|||||||
roles:
|
roles:
|
||||||
- common
|
- common
|
||||||
|
|
||||||
|
- name: Prepare Apache
|
||||||
|
hosts: localhost
|
||||||
|
roles:
|
||||||
|
- apache
|
||||||
|
|
||||||
- name: Install Jenkins
|
- name: Install Jenkins
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
roles:
|
roles:
|
||||||
|
Loading…
Reference in New Issue
Block a user