123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- ---
- - name: Create HopGlass directory if not existent
- file:
- path: /opt/hopglass/client
- state: directory
- - name: Git for HopGlass
- git:
- repo: https://github.com/FreiFunkMuenster/hopglass.git
- dest: /opt/hopglass/client
- force: yes
- version: ffms
- register: hopglass_git_clone
- - name: Create hwpics directory if not exists
- file:
- path: /opt/hopglass/hwpics
- state: directory
- - name: Clone meshviewer hwpics repo
- git:
- repo: https://github.com/Moorviper/meshviewer_hwpics.git
- dest: /opt/hopglass/hwpics
- update: yes
- register: hopglass_git_clone
- - name: Add nodejs repo keys
- apt_key:
- id: 1655A0AB68576280
- url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
- state: present
- - name: Add repo for nodejs
- apt_repository:
- repo: "{{ item }}"
- state: present
- update_cache: yes
- with_items:
- - "deb https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main"
- - "deb-src https://deb.nodesource.com/node_6.x {{ ansible_distribution_release }} main"
- - name: Install nodejs
- apt:
- pkg: nodejs
- state: installed
- - name: Install dependencies
- shell: npm install
- args:
- chdir: /opt/hopglass/client
- when: hopglass_git_clone.changed
- - name: Install grunt-cli
- shell: npm install grunt-cli
- args:
- chdir: /opt/hopglass/client
- when: hopglass_git_clone.changed
- - name: Build HopGlass
- shell: node_modules/.bin/grunt
- args:
- chdir: /opt/hopglass/client
- when: hopglass_git_clone.changed
- - name: Adjust permissions
- file:
- path: /opt/hopglass/client
- owner: hopglass
- group: hopglass
- recurse: yes
- when: hopglass_git_clone.changed
- - name: Create directory
- file:
- path: /opt/hopglass/client/build/
- state: directory
- - name: Deploy config.json
- template:
- src: config.json.j2
- dest: /opt/hopglass/client/build/config.json
- owner: hopglass
- group: hopglass
- mode: 0644
- - name: Create directory for domainspecific config files
- file:
- path: /opt/hopglass/client/build/config/
- state: directory
- - name: Deploy config.json domainspecific
- template:
- src: configdom.json.j2
- dest: "/opt/hopglass/client/build/config/config_{{item[0]}}.json"
- owner: hopglass
- group: hopglass
- mode: 0644
- with_items:
- - "{{domaenen|dictsort}}"
- - name: Generate list of all community names
- set_fact:
- communities: "{{ domaenen | list | map('extract', domaenen, 'community') | list | unique | sort }}"
- - name: Deploy config.json configcommunity
- template:
- src: configcommunity.json.j2
- dest: "/opt/hopglass/client/build/config/config_{{item}}.json"
- owner: hopglass
- group: hopglass
- mode: 0644
- when: item != "None"
- with_items:
- - "{{communities}}"
|