src.dualinventive.com/devops/ansible-dtap/rootnet-roles/highcharts/tasks/main.yml

30 lines
1.0 KiB
YAML

# NOTE: it gives an exeception when it is not correctly installed
- name: Execute and check if phantomjs works
command: /usr/lib/node_modules/highcharts-export-server/node_modules/phantomjs-prebuilt/bin/phantomjs
register: phantomjs_cmd
ignore_errors: yes
- name: Remove old highcharts-export-server
npm:
name: highcharts-export-server
global: yes
state: absent
when: phantomjs_cmd.rc != 0
- name: Check if highcharts-export-server is installed
shell: "npm list -g | grep highcharts-export-server@2.0.24"
register: npmlist
ignore_errors: yes
# NOTE: we are unable to use the npm ansible module because we need --unsafe-perm and is not supported
# by rootnet ansible 2.4 and they are unable to upgrade
- name: Install highcharts-export-server
command: "npm install highcharts-export-server@2.0.24 -g --unsafe-perm"
environment:
ACCEPT_HIGHCHARTS_LICENSE: true
HIGHCHARTS_VERSION: "latest"
HIGHCHARTS_USE_STYLED: false
HIGHCHARTS_USE_MAPS: false
HIGHCHARTS_MOMENT: false
when: npmlist.rc == 1