1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

Update main.yml

This commit is contained in:
A Holt 2018-10-31 01:13:15 -04:00 committed by GitHub
parent 6bc640fb52
commit 130b3a7d92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,30 +1,28 @@
- name: Install OSM required packages (debuntu) - name: Install 5 OSM required packages (debuntu)
package: package:
name: "{{ item }}" name:
- gcc
- python-dev
- liblzma-dev
- libapache2-mod-wsgi
- libapache2-mod-xsendfile
state: present state: present
with_items:
- gcc
- python-dev
- liblzma-dev
- libapache2-mod-wsgi
- libapache2-mod-xsendfile
when: is_debuntu when: is_debuntu
- name: Install OSM required packages (not debuntu) - name: Install 6 OSM required packages (not debuntu)
package: package:
name: "{{ item }}" name:
- python-pip
- gcc
- python-devel
- xz-devel
- mod_wsgi
- mod_xsendfile
state: present state: present
with_items:
- python-pip
- gcc
- python-devel
- xz-devel
- mod_wsgi
- mod_xsendfile
when: not is_debuntu when: not is_debuntu
# OSM wants a specific version do that first # OSM wants a specific version do that first
- name: Install Whoosh 2.6 (debuntu) - name: Install Whoosh 2.6 using pip, into virtualenv (debuntu)
pip: pip:
name: whoosh name: whoosh
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
@ -33,7 +31,7 @@
extra_args: "--no-cache-dir" extra_args: "--no-cache-dir"
when: internet_available and is_debuntu when: internet_available and is_debuntu
- name: Install Flask 0.12X (debuntu) - name: Install Flask 0.12.4 using pip, into virtualenv (debuntu)
pip: pip:
name: Flask name: Flask
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
@ -42,7 +40,7 @@
extra_args: "--no-cache-dir" extra_args: "--no-cache-dir"
when: internet_available and is_debuntu when: internet_available and is_debuntu
- name: Install OSM with dependencies (debuntu) - name: Install OSM with dependencies using pip, into virtualenv (debuntu)
pip: pip:
name: "{{ item }}" name: "{{ item }}"
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
@ -55,56 +53,56 @@
when: internet_available and is_debuntu when: internet_available and is_debuntu
# OSM wants a specific version do that first # OSM wants a specific version do that first
- name: Install Whoosh 2.6 (not debuntu) - name: Install Whoosh 2.6 using pip, into virtualenv (not debuntu)
pip: pip:
name: whoosh name: whoosh
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no virtualenv_site_packages: no
version: 2.6 version: 2.6
# extra_args="--no-cache-dir" #extra_args: "--no-cache-dir"
when: internet_available and not is_debuntu when: internet_available and not is_debuntu
- name: Install Flask 0.12X (not debuntu) - name: Install Flask 0.12.4 using pip, into virtualenv (not debuntu)
pip: pip:
name: Flask name: Flask
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no virtualenv_site_packages: no
version: 0.12.4 version: 0.12.4
# extra_args="--no-cache-dir" #extra_args: "--no-cache-dir"
when: internet_available and not is_debuntu when: internet_available and not is_debuntu
- name: Install OSM with dependencies (not debuntu) - name: Install OSM with dependencies using pip, into virtualenv (not debuntu)
pip: pip:
name: "{{ item }}" name: "{{ item }}"
virtualenv: "{{ osm_venv }}" virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no virtualenv_site_packages: no
# extra_args="--no-cache-dir" #extra_args: "--no-cache-dir"
with_items: with_items:
- MarkupSafe - MarkupSafe
- pytz - pytz
- Internet-in-a-Box - Internet-in-a-Box
when: internet_available and not is_debuntu when: internet_available and not is_debuntu
- name: Set osm_path (redhat) - name: Set osm_path fact (redhat)
set_fact: set_fact:
#osm_path: "{{ osm_venv }}/{{ python_path }}/iiab" #osm_path: "{{ osm_venv }}/{{ python_path }}/iiab"
osm_path: "{{ osm_venv }}{{ python_path }}/iiab" osm_path: "{{ osm_venv }}{{ python_path }}/iiab"
when: osm_enabled and is_redhat when: osm_enabled and is_redhat
- name: Set osm_path (debuntu) - name: Set osm_path fact (debuntu)
set_fact: set_fact:
#osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab" #osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab"
osm_path: "{{ osm_venv }}lib/python2.7/site-packages/iiab" osm_path: "{{ osm_venv }}lib/python2.7/site-packages/iiab"
when: osm_enabled and is_debuntu when: osm_enabled and is_debuntu
- name: Point wsgi to virtual environment (all OS's) - name: Point wsgi to virtual environment
lineinfile: lineinfile:
dest: "{{ osm_venv }}/bin/iiab.wsgi" path: "{{ osm_venv }}/bin/iiab.wsgi"
regexp: "path_to_virtualenv = None" regexp: "path_to_virtualenv = None"
line: "path_to_virtualenv = '/usr/local/osm'" line: "path_to_virtualenv = '/usr/local/osm'"
state: present state: present
- name: Copy OSM config file (all OS's) - name: Install /etc/{{ apache_config_dir }}/osm.conf from template
template: template:
src: osm.conf.j2 src: osm.conf.j2
dest: "/etc/{{ apache_config_dir }}/osm.conf" dest: "/etc/{{ apache_config_dir }}/osm.conf"
@ -114,41 +112,41 @@
backup: no backup: no
when: osm_enabled when: osm_enabled
- name: Create a link from sites-enabled to sites-available (debuntu) - name: Create softlink osm.conf from sites-enabled to sites-available (debuntu)
file: file:
src: "/etc/{{ apache_config_dir }}/osm.conf" src: "/etc/{{ apache_config_dir }}/osm.conf"
dest: /etc/apache2/sites-enabled/osm.conf path: /etc/apache2/sites-enabled/osm.conf
state: link state: link
when: osm_enabled and is_debuntu when: osm_enabled and is_debuntu
- name: Remove the link from sites-enabled to sites-available (debuntu) - name: Remove softlink osm.conf from sites-enabled (debuntu)
file: file:
dest: /etc/apache2/sites-enabled/osm.conf path: /etc/apache2/sites-enabled/osm.conf
state: absent state: absent
when: not osm_enabled and is_debuntu when: not osm_enabled and is_debuntu
- name: Remove the osm.conf (redhat) - name: Remove /{{ apache_config_dir }}/osm.conf (redhat)
file: file:
dest: "/{{ apache_config_dir }}/osm.conf" path: "/{{ apache_config_dir }}/osm.conf"
state: absent state: absent
when: not osm_enabled and is_redhat when: not osm_enabled and is_redhat
- name: Remove link to cgi (all OS's) - name: Remove link {{ doc_root }}/osm.wsgi
file: file:
dest: "{{ doc_root }}/osm.wsgi" path: "{{ doc_root }}/osm.wsgi"
state: absent state: absent
when: not osm_enabled when: not osm_enabled
- name: Create link to cgi (all OS's) - name: Create softlink osm.wsgi to iiab.cgi
file: file:
src: "{{ osm_venv }}/bin/iiab.wsgi" src: "{{ osm_venv }}/bin/iiab.wsgi"
dest: "{{ doc_root }}/osm.wsgi" path: "{{ doc_root }}/osm.wsgi"
owner: root owner: root
group: root group: root
state: link state: link
when: osm_enabled when: osm_enabled
- name: Create the knowledge data set folders - name: Create dir /library/knowledge/modules
file: file:
path: /library/knowledge/modules path: /library/knowledge/modules
state: directory state: directory
@ -156,7 +154,7 @@
group: "{{ apache_user }}" group: "{{ apache_user }}"
# the following was brought into OSM playbook from iiab-factory osm-fix script # the following was brought into OSM playbook from iiab-factory osm-fix script
- name: Copy the files - name: Install 6 files from templates
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
@ -174,9 +172,9 @@
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: restarted state: restarted
- name: Add 'osm' to list of services at {{ iiab_ini_file }} - name: Add 'osm' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: osm section: osm
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"