Commit 113233a8 by Max Rothman

Refactor NOTIFIER_USER to notifier_user

parent aeb951c0
- Role: notifier - 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 - Role: gitreload
- New role added for running - New role added for running
......
--- ---
NOTIFIER_USER: "notifier"
NOTIFIER_WEB_USER: "www-data" NOTIFIER_WEB_USER: "www-data"
NOTIFIER_VENV_DIR: "{{ notifier_app_dir }}/virtualenvs/notifier" NOTIFIER_VENV_DIR: "{{ notifier_app_dir }}/virtualenvs/notifier"
NOTIFIER_DB_DIR: "{{ notifier_app_dir }}/db" NOTIFIER_DB_DIR: "{{ notifier_app_dir }}/db"
...@@ -61,6 +60,7 @@ NOTIFIER_DD_API_KEY: "NOT_USED" # data dog ...@@ -61,6 +60,7 @@ NOTIFIER_DD_API_KEY: "NOT_USED" # data dog
notifier_app_dir: "{{ COMMON_APP_DIR }}/notifier" notifier_app_dir: "{{ COMMON_APP_DIR }}/notifier"
notifier_user: "notifier"
notifier_debian_pkgs: notifier_debian_pkgs:
- apparmor-utils - apparmor-utils
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
version={{ NOTIFIER_VERSION }} version={{ NOTIFIER_VERSION }}
accept_hostkey=yes accept_hostkey=yes
sudo: true sudo: true
sudo_user: "{{ NOTIFIER_USER }}" sudo_user: "{{ notifier_user }}"
notify: notify:
- restart notifier-scheduler - restart notifier-scheduler
- restart notifier-celery-workers - restart notifier-celery-workers
...@@ -15,19 +15,19 @@ ...@@ -15,19 +15,19 @@
- name: create ssh script for git (not authenticated) - name: create ssh script for git (not authenticated)
template: > template: >
src=git_ssh_noauth.sh.j2 dest={{ notifier_git_ssh }} src=git_ssh_noauth.sh.j2 dest={{ notifier_git_ssh }}
owner={{ NOTIFIER_USER }} mode=750 owner={{ notifier_user }} mode=750
when: NOTIFIER_GIT_IDENTITY == "" when: NOTIFIER_GIT_IDENTITY == ""
- name: create ssh script for git (authenticated) - name: create ssh script for git (authenticated)
template: > template: >
src=git_ssh_auth.sh.j2 dest={{ notifier_git_ssh }} src=git_ssh_auth.sh.j2 dest={{ notifier_git_ssh }}
owner={{ NOTIFIER_USER }} mode=750 owner={{ notifier_user }} mode=750
when: NOTIFIER_GIT_IDENTITY != "" when: NOTIFIER_GIT_IDENTITY != ""
- name: install read-only ssh key - name: install read-only ssh key
copy: > copy: >
content="{{ NOTIFIER_GIT_IDENTITY }}" dest={{ notifier_git_identity }} 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 != "" when: NOTIFIER_GIT_IDENTITY != ""
- name: checkout theme - name: checkout theme
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
version={{ NOTIFIER_THEME_VERSION }} version={{ NOTIFIER_THEME_VERSION }}
accept_hostkey=yes accept_hostkey=yes
when: NOTIFIER_THEME_NAME != '' when: NOTIFIER_THEME_NAME != ''
sudo_user: "{{ NOTIFIER_USER }}" sudo_user: "{{ notifier_user }}"
environment: environment:
GIT_SSH: "{{ notifier_git_ssh }}" GIT_SSH: "{{ notifier_git_ssh }}"
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
requirements="{{ NOTIFIER_REQUIREMENTS_FILE }}" requirements="{{ NOTIFIER_REQUIREMENTS_FILE }}"
virtualenv="{{ NOTIFIER_VENV_DIR }}" state=present virtualenv="{{ NOTIFIER_VENV_DIR }}" state=present
sudo: true sudo: true
sudo_user: "{{ NOTIFIER_USER }}" sudo_user: "{{ notifier_user }}"
notify: notify:
- restart notifier-scheduler - restart notifier-scheduler
- restart notifier-celery-workers - restart notifier-celery-workers
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
# place with proper perms first. # place with proper perms first.
- name: fix permissions on notifer db file - name: fix permissions on notifer db file
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 mode=0664
sudo: true sudo: true
notify: notify:
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
shell: > shell: >
cd {{ NOTIFIER_CODE_DIR }} && {{ NOTIFIER_VENV_DIR }}/bin/python manage.py syncdb cd {{ NOTIFIER_CODE_DIR }} && {{ NOTIFIER_VENV_DIR }}/bin/python manage.py syncdb
sudo: true sudo: true
sudo_user: "{{ NOTIFIER_USER }}" sudo_user: "{{ notifier_user }}"
environment: notifier_env_vars environment: notifier_env_vars
notify: notify:
- restart notifier-scheduler - restart notifier-scheduler
......
...@@ -57,20 +57,20 @@ ...@@ -57,20 +57,20 @@
- name: setup the notifier env - name: setup the notifier env
template: template:
src=notifier_env.j2 dest={{ notifier_app_dir }}/notifier_env src=notifier_env.j2 dest={{ notifier_app_dir }}/notifier_env
owner="{{ NOTIFIER_USER }}" group="{{ NOTIFIER_USER }}" owner="{{ notifier_user }}" group="{{ notifier_user }}"
mode=655 mode=655
- name: drop a bash_profile - name: drop a bash_profile
copy: > copy: >
src=../../common/files/bash_profile src=../../common/files/bash_profile
dest={{ notifier_app_dir }}/.bash_profile dest={{ notifier_app_dir }}/.bash_profile
owner={{ NOTIFIER_USER }} owner={{ notifier_user }}
group={{ NOTIFIER_USER }} group={{ notifier_user }}
- name: ensure .bashrc exists - name: ensure .bashrc exists
shell: touch {{ notifier_app_dir }}/.bashrc shell: touch {{ notifier_app_dir }}/.bashrc
sudo: true sudo: true
sudo_user: "{{ NOTIFIER_USER }}" sudo_user: "{{ notifier_user }}"
- name: add source of notifier_env to .bashrc - name: add source of notifier_env to .bashrc
lineinfile: lineinfile:
...@@ -86,15 +86,15 @@ ...@@ -86,15 +86,15 @@
- name: create notifier DB directory - name: create notifier DB directory
file: 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 - name: create notifier/bin directory
file: 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 - name: create notifier/.ssh directory
file: 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 - name: create service log dir
file: > file: >
...@@ -110,14 +110,14 @@ ...@@ -110,14 +110,14 @@
src=notifier-celery-workers-supervisor.sh.j2 src=notifier-celery-workers-supervisor.sh.j2
dest="{{ notifier_app_dir }}/notifier-celery-workers-supervisor.sh" dest="{{ notifier_app_dir }}/notifier-celery-workers-supervisor.sh"
mode=0775 mode=0775
sudo_user: "{{ NOTIFIER_USER }}" sudo_user: "{{ notifier_user }}"
- name: write supervisord wrapper for scheduler - name: write supervisord wrapper for scheduler
template: > template: >
src=notifier-scheduler-supervisor.sh.j2 src=notifier-scheduler-supervisor.sh.j2
dest="{{ notifier_app_dir }}/notifier-scheduler-supervisor.sh" dest="{{ notifier_app_dir }}/notifier-scheduler-supervisor.sh"
mode=0775 mode=0775
sudo_user: "{{ NOTIFIER_USER }}" sudo_user: "{{ notifier_user }}"
- name: write supervisord config for celery workers - name: write supervisord config for celery workers
template: > 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