Commit 113233a8 by Max Rothman

Refactor NOTIFIER_USER to notifier_user

parent aeb951c0
- Role: notifier
- Refactored NOTIFIER_HOME to notifier_app_dir to match other roles. This shouldn't change anything since you should've only been overriding COMMON_HOME.
- Refactored `NOTIFIER_HOME` and `NOTIFIER_USER` to `notifier_app_dir` and `notifier_user` to match other roles. This shouldn't change anything since users should've only been overriding COMMON_HOME.
- Role: gitreload
- New role added for running
......
---
NOTIFIER_USER: "notifier"
NOTIFIER_WEB_USER: "www-data"
NOTIFIER_VENV_DIR: "{{ notifier_app_dir }}/virtualenvs/notifier"
NOTIFIER_DB_DIR: "{{ notifier_app_dir }}/db"
......@@ -61,6 +60,7 @@ NOTIFIER_DD_API_KEY: "NOT_USED" # data dog
notifier_app_dir: "{{ COMMON_APP_DIR }}/notifier"
notifier_user: "notifier"
notifier_debian_pkgs:
- apparmor-utils
......
......@@ -6,7 +6,7 @@
version={{ NOTIFIER_VERSION }}
accept_hostkey=yes
sudo: true
sudo_user: "{{ NOTIFIER_USER }}"
sudo_user: "{{ notifier_user }}"
notify:
- restart notifier-scheduler
- restart notifier-celery-workers
......@@ -15,19 +15,19 @@
- name: create ssh script for git (not authenticated)
template: >
src=git_ssh_noauth.sh.j2 dest={{ notifier_git_ssh }}
owner={{ NOTIFIER_USER }} mode=750
owner={{ notifier_user }} mode=750
when: NOTIFIER_GIT_IDENTITY == ""
- name: create ssh script for git (authenticated)
template: >
src=git_ssh_auth.sh.j2 dest={{ notifier_git_ssh }}
owner={{ NOTIFIER_USER }} mode=750
owner={{ notifier_user }} mode=750
when: NOTIFIER_GIT_IDENTITY != ""
- name: install read-only ssh key
copy: >
content="{{ NOTIFIER_GIT_IDENTITY }}" dest={{ notifier_git_identity }}
force=yes owner={{ NOTIFIER_USER }} mode=0600
force=yes owner={{ notifier_user }} mode=0600
when: NOTIFIER_GIT_IDENTITY != ""
- name: checkout theme
......@@ -37,7 +37,7 @@
version={{ NOTIFIER_THEME_VERSION }}
accept_hostkey=yes
when: NOTIFIER_THEME_NAME != ''
sudo_user: "{{ NOTIFIER_USER }}"
sudo_user: "{{ notifier_user }}"
environment:
GIT_SSH: "{{ notifier_git_ssh }}"
......@@ -59,7 +59,7 @@
requirements="{{ NOTIFIER_REQUIREMENTS_FILE }}"
virtualenv="{{ NOTIFIER_VENV_DIR }}" state=present
sudo: true
sudo_user: "{{ NOTIFIER_USER }}"
sudo_user: "{{ notifier_user }}"
notify:
- restart notifier-scheduler
- restart notifier-celery-workers
......@@ -69,7 +69,7 @@
# place with proper perms first.
- name: fix permissions on notifer db file
file: >
path={{ NOTIFIER_DB_DIR }}/notifier.db state=touch owner={{ NOTIFIER_USER }} group={{ NOTIFIER_WEB_USER }}
path={{ NOTIFIER_DB_DIR }}/notifier.db state=touch owner={{ notifier_user }} group={{ NOTIFIER_WEB_USER }}
mode=0664
sudo: true
notify:
......@@ -82,7 +82,7 @@
shell: >
cd {{ NOTIFIER_CODE_DIR }} && {{ NOTIFIER_VENV_DIR }}/bin/python manage.py syncdb
sudo: true
sudo_user: "{{ NOTIFIER_USER }}"
sudo_user: "{{ notifier_user }}"
environment: notifier_env_vars
notify:
- restart notifier-scheduler
......
......@@ -57,20 +57,20 @@
- name: setup the notifier env
template:
src=notifier_env.j2 dest={{ notifier_app_dir }}/notifier_env
owner="{{ NOTIFIER_USER }}" group="{{ NOTIFIER_USER }}"
owner="{{ notifier_user }}" group="{{ notifier_user }}"
mode=655
- name: drop a bash_profile
copy: >
src=../../common/files/bash_profile
dest={{ notifier_app_dir }}/.bash_profile
owner={{ NOTIFIER_USER }}
group={{ NOTIFIER_USER }}
owner={{ notifier_user }}
group={{ notifier_user }}
- name: ensure .bashrc exists
shell: touch {{ notifier_app_dir }}/.bashrc
sudo: true
sudo_user: "{{ NOTIFIER_USER }}"
sudo_user: "{{ notifier_user }}"
- name: add source of notifier_env to .bashrc
lineinfile:
......@@ -86,15 +86,15 @@
- name: create notifier DB directory
file:
path="{{ NOTIFIER_DB_DIR }}" mode=2775 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_WEB_USER }}
path="{{ NOTIFIER_DB_DIR }}" mode=2775 state=directory owner={{ notifier_user }} group={{ NOTIFIER_WEB_USER }}
- name: create notifier/bin directory
file:
path="{{ notifier_app_dir }}/bin" mode=2775 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_USER }}
path="{{ notifier_app_dir }}/bin" mode=2775 state=directory owner={{ notifier_user }} group={{ notifier_user }}
- name: create notifier/.ssh directory
file:
path="{{ notifier_app_dir }}/.ssh" mode=2700 state=directory owner={{ NOTIFIER_USER }} group={{ NOTIFIER_USER }}
path="{{ notifier_app_dir }}/.ssh" mode=2700 state=directory owner={{ notifier_user }} group={{ notifier_user }}
- name: create service log dir
file: >
......@@ -110,14 +110,14 @@
src=notifier-celery-workers-supervisor.sh.j2
dest="{{ notifier_app_dir }}/notifier-celery-workers-supervisor.sh"
mode=0775
sudo_user: "{{ NOTIFIER_USER }}"
sudo_user: "{{ notifier_user }}"
- name: write supervisord wrapper for scheduler
template: >
src=notifier-scheduler-supervisor.sh.j2
dest="{{ notifier_app_dir }}/notifier-scheduler-supervisor.sh"
mode=0775
sudo_user: "{{ NOTIFIER_USER }}"
sudo_user: "{{ notifier_user }}"
- name: write supervisord config for celery workers
template: >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment