diff --git a/README.md b/README.md index ad139f1..81244c6 100644 --- a/README.md +++ b/README.md @@ -97,12 +97,12 @@ Followiing things includes in this role: ```yaml pritunl_version: "latest" pritunl_path: "/opt/pritunl" - pritunl_mongo_path: "/opt/pritunl/mongo" pritunl_log: "/var/log/pritunl.log" pritunl_user: pritunl pritunl_group: pritunl - pritunl_mongo_user: mongo - pritunl_mongo_group: mongo + mongo_path: "/opt/pritunl/mongo" + mongo_user: mongo + mongo_group: mongo ``` diff --git a/README.yaml b/README.yaml index 4f3e2a8..c8ed8c0 100644 --- a/README.yaml +++ b/README.yaml @@ -64,12 +64,12 @@ variables: |- ```yaml pritunl_version: "latest" pritunl_path: "/opt/pritunl" - pritunl_mongo_path: "/opt/pritunl/mongo" pritunl_log: "/var/log/pritunl.log" pritunl_user: pritunl pritunl_group: pritunl - pritunl_mongo_user: mongo - pritunl_mongo_group: mongo + mongo_path: "/opt/pritunl/mongo" + mongo_user: mongo + mongo_group: mongo ``` # How to install project diff --git a/defaults/main.yml b/defaults/main.yml index 3e5a66e..7b96768 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,10 +5,11 @@ pritunl_version: "latest" # Pritunl settings pritunl_path: "/opt/pritunl" -pritunl_mongo_path: "/opt/pritunl/mongo" pritunl_log: "/var/log/pritunl.log" - pritunl_user: pritunl pritunl_group: pritunl -pritunl_mongo_user: mongo -pritunl_mongo_group: mongo + +# Mongo settings +mongo_path: "/opt/pritunl/mongo" +mongo_user: mongo +mongo_group: mongo diff --git a/tasks/configure.yml b/tasks/configure.yml index 2eb8e7f..89626c1 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -15,12 +15,12 @@ file: path: "{{ item|safe|trim }}" state: directory - owner: "{{ pritunl_mongo_user }}" - group: "{{ pritunl_mongo_group }}" + owner: "{{ mongo_user }}" + group: "{{ mongo_group }}" mode: 0755 recurse: true with_items: - - "{{ pritunl_mongo_path }}" + - "{{ mongo_path }}" - name: transfer pritunl.conf template: diff --git a/tasks/users.yml b/tasks/users.yml index 65a89e0..3d922e0 100644 --- a/tasks/users.yml +++ b/tasks/users.yml @@ -13,11 +13,11 @@ - name: setup group group: - name: "{{ pritunl_mongo_group }}" + name: "{{ mongo_group }}" system: false - name: setup user user: - name: "{{ pritunl_mongo_user }}" + name: "{{ mongo_user }}" system: false - group: "{{ pritunl_mongo_group }}" + group: "{{ mongo_group }}" diff --git a/templates/pritunl b/templates/pritunl index 1901fd4..6c1f3a6 100644 --- a/templates/pritunl +++ b/templates/pritunl @@ -9,7 +9,7 @@ docker rm -f -v pritunl || : docker run -u root --net=host --rm --name pritunl \ -v "{{ pritunl_path }}":/var/lib/pritunl \ - -v "{{ pritunl_mongo_path }}":/var/lib/mongodb \ + -v "{{ mongo_path }}":/var/lib/mongodb \ -v "{{ pritunl_path }}/pritunl.conf":/etc/pritunl.conf \ -v "{{ pritunl_log }}":{{ pritunl_log }} \ clouddrove/pritunl:{{ pritunl_version }}