diff --git a/roles/osm/tasks/main.yml b/roles/osm/tasks/main.yml index 2789a2dd5..a0d34e321 100644 --- a/roles/osm/tasks/main.yml +++ b/roles/osm/tasks/main.yml @@ -1,6 +1,7 @@ - name: Install OSM required packages - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - gcc - python-dev @@ -10,8 +11,9 @@ when: is_debuntu - name: Install OSM required packages - package: name={{ item }} - state=present + package: + name: "{{ item }}" + state: present with_items: - python-pip - gcc @@ -23,26 +25,29 @@ # OSM wants a specific version do that first - name: Install Whoosh 2.6 - pip: name=whoosh - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - version=2.6 - extra_args="--no-cache-dir" + pip: + name=whoosh + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + version: 2.6 + extra_args: "--no-cache-dir" when: internet_available and is_debuntu - name: Install Flask 0.12X - pip: name=Flask - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - version=0.12.4 - extra_args="--no-cache-dir" + pip: + name: Flask + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + version: 0.12.4 + extra_args: "--no-cache-dir" when: internet_available and is_debuntu - name: Install OSM with dependencies - pip: name={{ item }} - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - extra_args="--no-cache-dir" + pip: + name: "{{ item }}" + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + extra_args: "--no-cache-dir" with_items: - MarkupSafe - pytz @@ -51,25 +56,28 @@ # OSM wants a specific version do that first - name: Install Whoosh 2.6 - pip: name=whoosh - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - version=2.6 + pip: + name: whoosh + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + version: 2.6 # extra_args="--no-cache-dir" when: internet_available and not is_debuntu - name: Install Flask 0.12X - pip: name=Flask - virtualenv={{ osm_venv }} - virtualenv_site_packages=no - version=0.12.4 + pip: + name=Flask + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no + version: 0.12.4 # extra_args="--no-cache-dir" when: internet_available and not is_debuntu - name: Install OSM with dependencies - pip: name={{ item }} - virtualenv={{ osm_venv }} - virtualenv_site_packages=no + pip: + name: "{{ item }}" + virtualenv: "{{ osm_venv }}" + virtualenv_site_packages: no # extra_args="--no-cache-dir" with_items: - MarkupSafe @@ -79,79 +87,90 @@ - name: Set osm_path set_fact: - osm_path: "{{ osm_venv }}/{{ python_path }}/iiab" + osm_path: "{{ osm_venv }}/{{ python_path }}/iiab" when: osm_enabled and is_redhat - name: Set osm_path set_fact: - 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 - name: Point wsgi to virtual environment (all OS's) - lineinfile: dest={{ osm_venv }}/bin/iiab.wsgi - regexp="path_to_virtualenv = None" - line="path_to_virtualenv = '/usr/local/osm'" - state=present + lineinfile: + dest: "{{ osm_venv }}/bin/iiab.wsgi" + regexp: "path_to_virtualenv = None" + line: "path_to_virtualenv = '/usr/local/osm'" + state: present - name: Copy OSM config file (all OS's) - template: backup=no - src=osm.conf.j2 - dest=/etc/{{ apache_config_dir }}/osm.conf - owner=root - group=root - mode=0644 + template: + src: osm.conf.j2 + dest: "/etc/{{ apache_config_dir }}/osm.conf" + owner: root + group: root + mode: 0644 + backup: no when: osm_enabled - name: Create a link from sites-enabled to sites-available (debuntu) - file: src=/etc/{{ apache_config_dir }}/osm.conf - dest=/etc/apache2/sites-enabled/osm.conf - state=link + file: + src: "/etc/{{ apache_config_dir }}/osm.conf" + dest: /etc/apache2/sites-enabled/osm.conf + state: link when: osm_enabled and is_debuntu - name: Remove the link from sites-enabled to sites-available (debuntu) - file: dest=/etc/apache2/sites-enabled/osm.conf - state=absent + file: + dest: /etc/apache2/sites-enabled/osm.conf + state: absent when: not osm_enabled and is_debuntu - name: Remove the osm.conf (redhat) - file: dest=/{{ apache_config_dir }}/osm.conf - state=absent + file: + dest: "/{{ apache_config_dir }}/osm.conf" + state: absent when: not osm_enabled and is_redhat - name: Remove link to cgi (all OS's) - file: dest={{ doc_root }}/osm.wsgi - state=absent + file: + dest: "{{ doc_root }}/osm.wsgi" + state: absent when: not osm_enabled - name: Create link to cgi (all OS's) - file: src={{ osm_venv }}/bin/iiab.wsgi - dest={{ doc_root }}/osm.wsgi - owner=root - group=root - state=link + file: + src: "{{ osm_venv }}/bin/iiab.wsgi" + dest: "{{ doc_root }}/osm.wsgi" + owner: root + group: root + state: link when: osm_enabled - name: Create the knowledge data set folders - file: path=/library/knowledge/modules - state=directory - owner={{ apache_user }} - group={{ apache_user }} + file: + path: /library/knowledge/modules + state: directory + owner: "{{ apache_user }}" + group: "{{ apache_user }}" # the following was brought into OSM playbook from iiab-factory osm-fix script - name: Copy the files - template: src={{ item.src }} dest={{ item.dest }} + template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" with_items: - - { src: 'defaults.ini', dest: "{{ osm_path }}/" } - - { src: 'etc.iiab.conf', dest: '/etc/iiab.conf' } - - { src: 'map_search.py', dest: "{{ osm_path }}/map_search.py" } - - { src: 'map.html', dest: "{{ osm_path }}/static/map.html" } - - { src: 'l.control.geosearch.js', dest: "{{ osm_path }}/static/lib/leaflet/geosearch/l.control.geosearch.js" } - - { src: '{{ osm_path }}/static/map.html', dest: "{{ osm_path }}/static/index.html" } + - { src: 'defaults.ini', dest: "{{ osm_path }}/" } + - { src: 'etc.iiab.conf', dest: '/etc/iiab.conf' } + - { src: 'map_search.py', dest: "{{ osm_path }}/map_search.py" } + - { src: 'map.html', dest: "{{ osm_path }}/static/map.html" } + - { src: 'l.control.geosearch.js', dest: "{{ osm_path }}/static/lib/leaflet/geosearch/l.control.geosearch.js" } + - { src: "{{ osm_path }}/static/map.html", dest: "{{ osm_path }}/static/index.html" } when: osm_enabled - name: Restart httpd service - service: name={{ apache_service }} - state=restarted + service: + name: "{{ apache_service }}" + state: restarted - name: Add 'osm' to list of services at /etc/iiab/iiab.ini ini_file: