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