head plugin creates a dedicated user

This commit is contained in:
Jérémy Lecour 2016-11-21 17:30:25 +01:00 committed by Jérémy Lecour
parent cfd1e690fb
commit ae47a8e030
2 changed files with 26 additions and 24 deletions

View file

@ -1,3 +1,4 @@
elasticsearch_plugin_head_install_path: /var/www2/elasticsearch-head elasticsearch_plugin_head_home: /home/elasticsearch-head
elasticsearch_plugin_head_owner: "www-data" elasticsearch_plugin_head_clone_dir: "{{ elasticsearch_plugin_head_home }}/www"
elasticsearch_plugin_head_group: "www-data" elasticsearch_plugin_head_owner: "elasticsearch-head"
elasticsearch_plugin_head_group: "elasticsearch-head"

View file

@ -36,29 +36,30 @@
- packages - packages
- npm - npm
- name: Head repository is check-out - name: "User {{ elasticsearch_plugin_head_owner }} is present"
git: user:
repo: "git://github.com/mobz/elasticsearch-head.git" name: "{{ elasticsearch_plugin_head_owner }}"
dest: "{{ elasticsearch_plugin_head_install_path }}" home: "{{ elasticsearch_plugin_head_home }}"
clone: yes createhome: yes
tags: system: yes
- elasticsearch shell: /bin/false
- name: NPM packages for head are installed - block:
npm: - name: Head repository is check-out
path: "{{ elasticsearch_plugin_head_install_path }}" git:
tags: repo: "git://github.com/mobz/elasticsearch-head.git"
- packages dest: "{{ elasticsearch_plugin_head_clone_dir }}"
- npm clone: yes
tags:
- packages
- name: "Directory is owned by {{ elasticsearch_plugin_head_owner }}" - name: NPM packages for head are installed
file: npm:
path: "{{ elasticsearch_plugin_head_install_path }}" path: "{{ elasticsearch_plugin_head_clone_dir }}"
owner: "{{ elasticsearch_plugin_head_owner }}" tags:
group: "{{ elasticsearch_plugin_head_group }}" - packages
state: directory - npm
tags: become_user: "{{ elasticsearch_plugin_head_owner }}"
- elasticsearch
- name: Elasticsearch HTTP/CORS are enabled - name: Elasticsearch HTTP/CORS are enabled
lineinfile: lineinfile: