Commit 1ab59651 by Arbab Nazar Committed by GitHub

Merge pull request #3140 from edx/arbab/ops-1593

OPS-1593 As an operator, I want sudo_user converted to become user in…
parents f4f1306c acb7d21a
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
owner="{{ jenkins_user }}" owner="{{ jenkins_user }}"
group="{{ jenkins_group }}" group="{{ jenkins_group }}"
mode="755" mode="755"
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
notify: restart nat monitor notify: restart nat monitor
- name: create a supervisor config - name: create a supervisor config
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
src="nat-monitor.conf.j2" dest="{{ jenkins_supervisor_available_dir }}/nat-monitor.conf" src="nat-monitor.conf.j2" dest="{{ jenkins_supervisor_available_dir }}/nat-monitor.conf"
owner="{{ jenkins_user }}" owner="{{ jenkins_user }}"
group="{{ jenkins_group }}" group="{{ jenkins_group }}"
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
notify: restart nat monitor notify: restart nat monitor
- name: enable the supervisor config - name: enable the supervisor config
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
state=link state=link
force=yes force=yes
mode=0644 mode=0644
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
when: not disable_edx_services when: not disable_edx_services
notify: restart nat monitor notify: restart nat monitor
......
...@@ -154,8 +154,8 @@ ...@@ -154,8 +154,8 @@
repo: https://github.com/jenkinsci/job-dsl-plugin.git repo: https://github.com/jenkinsci/job-dsl-plugin.git
depth: 1 depth: 1
dest: "{{ jenkins_seed_job_root }}" dest: "{{ jenkins_seed_job_root }}"
sudo: yes become: yes
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
tags: tags:
- jenkins-seed-job - jenkins-seed-job
...@@ -173,8 +173,8 @@ ...@@ -173,8 +173,8 @@
shell: > shell: >
cd {{ jenkins_seed_job_root }} && cd {{ jenkins_seed_job_root }} &&
GRADLE_OPTS="-Dorg.gradle.daemon=true" ./gradlew run -Pargs={{ jenkins_seed_job_script }} GRADLE_OPTS="-Dorg.gradle.daemon=true" ./gradlew run -Pargs={{ jenkins_seed_job_script }}
sudo: yes become: yes
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
tags: tags:
- jenkins-seed-job - jenkins-seed-job
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
dest={{ jenkins_home }}/shallow-clone dest={{ jenkins_home }}/shallow-clone
version={{ jenkins_edx_platform_version }} version={{ jenkins_edx_platform_version }}
depth=1 depth=1
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
# pip-accel skipped due to conflicting versions of pip required # pip-accel skipped due to conflicting versions of pip required
# by the pip-accel package and edx-platform # by the pip-accel package and edx-platform
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
# name="{{ item }}" # name="{{ item }}"
# virtualenv={{ jenkins_home }}/edx-venv # virtualenv={{ jenkins_home }}/edx-venv
# virtualenv_command=virtualenv-2.7 # virtualenv_command=virtualenv-2.7
# sudo_user: "{{ jenkins_user }}" # become_user: "{{ jenkins_user }}"
# with_items: pip_accel_reqs # with_items: pip_accel_reqs
# Install the platform requirements using pip. # Install the platform requirements using pip.
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
- github.txt - github.txt
- base.txt - base.txt
- paver.txt - paver.txt
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
# These and the pip install below it can be removed some time after # These and the pip install below it can be removed some time after
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
# This will keep us from breaking after that gets merged. # This will keep us from breaking after that gets merged.
- stat: path="{{ jenkins_home }}/shallow-clone/requirements/edx/post.txt" - stat: path="{{ jenkins_home }}/shallow-clone/requirements/edx/post.txt"
register: post_requirements register: post_requirements
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
- name: Install edx-platform post requirements using pip - name: Install edx-platform post requirements using pip
pip: > pip: >
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
executable=pip executable=pip
with_items: with_items:
- post.txt - post.txt
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
when: post_requirements.stat.exists when: post_requirements.stat.exists
# Archive the current state of the virtualenv # Archive the current state of the virtualenv
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
command: > command: >
tar -cpzf edx-venv_clean.tar.gz edx-venv tar -cpzf edx-venv_clean.tar.gz edx-venv
chdir={{ jenkins_home }} chdir={{ jenkins_home }}
sudo_user: "{{ jenkins_user }}" become_user: "{{ jenkins_user }}"
# Remove the shallow-clone directory now that we are # Remove the shallow-clone directory now that we are
# done with it # done with it
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
# Edit the /etc/hosts file so that the Preview button will work in Studio # Edit the /etc/hosts file so that the Preview button will work in Studio
- name: add preview.localhost to /etc/hosts - name: add preview.localhost to /etc/hosts
shell: sed -i -r 's/^127.0.0.1\s+.*$/127.0.0.1 localhost preview.localhost/' /etc/hosts shell: sed -i -r 's/^127.0.0.1\s+.*$/127.0.0.1 localhost preview.localhost/' /etc/hosts
sudo: yes become: yes
# Npm registry must be pre-loaded or else setting it # Npm registry must be pre-loaded or else setting it
# with the Jenkins user will fail # with the Jenkins user will fail
......
...@@ -103,4 +103,4 @@ ...@@ -103,4 +103,4 @@
# Edit the /etc/hosts file so that the Preview button will work in Studio # Edit the /etc/hosts file so that the Preview button will work in Studio
- name: add preview.localhost to /etc/hosts - name: add preview.localhost to /etc/hosts
shell: sed -i -r 's/^127.0.0.1\s+.*$/127.0.0.1 localhost preview.localhost/' /etc/hosts shell: sed -i -r 's/^127.0.0.1\s+.*$/127.0.0.1 localhost preview.localhost/' /etc/hosts
sudo: yes become: yes
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
requirements="{{ locust_requirements_base }}/{{ item }}" requirements="{{ locust_requirements_base }}/{{ item }}"
virtualenv="{{ locust_home }}/venvs/{{ locust_service_name }}" virtualenv="{{ locust_home }}/venvs/{{ locust_service_name }}"
state=present state=present
sudo_user: "{{ locust_user }}" become_user: "{{ locust_user }}"
with_items: locust_requirements with_items: locust_requirements
- name: write supervisord config - name: write supervisord config
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
config={{ supervisor_cfg }} config={{ supervisor_cfg }}
name={{ locust_service_name }} name={{ locust_service_name }}
when: not disable_edx_services when: not disable_edx_services
sudo_user: "{{ supervisor_service_user }}" become_user: "{{ supervisor_service_user }}"
- name: increase file descriptor limit of the system (Session Logout and Login would be required) - name: increase file descriptor limit of the system (Session Logout and Login would be required)
lineinfile: lineinfile:
......
...@@ -38,27 +38,27 @@ ...@@ -38,27 +38,27 @@
shell: > shell: >
tar -xzf /tmp/{{ newrelic_npi_installer }} --strip-components=1 -C "{{NEWRELIC_NPI_PREFIX}}" tar -xzf /tmp/{{ newrelic_npi_installer }} --strip-components=1 -C "{{NEWRELIC_NPI_PREFIX}}"
when: download_npi_installer.changed when: download_npi_installer.changed
sudo_user: "{{ NEWRELIC_USER }}" become_user: "{{ NEWRELIC_USER }}"
- name: configure npi with the default user - name: configure npi with the default user
shell: > shell: >
{{ NEWRELIC_NPI_PREFIX }}/bin/node {{ NEWRELIC_NPI_PREFIX }}/npi.js "set user {{ NEWRELIC_USER }}" {{ NEWRELIC_NPI_PREFIX }}/bin/node {{ NEWRELIC_NPI_PREFIX }}/npi.js "set user {{ NEWRELIC_USER }}"
args: args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}" chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "{{ NEWRELIC_USER }}" become_user: "{{ NEWRELIC_USER }}"
- name: configure npi with the license key - name: configure npi with the license key
shell: > shell: >
./npi set license_key {{ NEWRELIC_LICENSE_KEY }} ./npi set license_key {{ NEWRELIC_LICENSE_KEY }}
args: args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}" chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "{{ NEWRELIC_USER }}" become_user: "{{ NEWRELIC_USER }}"
- name: configure npi with the distro - name: configure npi with the distro
shell: > shell: >
./npi set distro {{ NEWRELIC_NPI_DISTRO }} ./npi set distro {{ NEWRELIC_NPI_DISTRO }}
args: args:
chdir: "{{ NEWRELIC_NPI_PREFIX }}" chdir: "{{ NEWRELIC_NPI_PREFIX }}"
sudo_user: "{{ NEWRELIC_USER }}" become_user: "{{ NEWRELIC_USER }}"
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
- local_action: - local_action:
module: stat module: stat
path: "{{ NGINX_SSL_CERTIFICATE }}" path: "{{ NGINX_SSL_CERTIFICATE }}"
sudo: False become: False
register: ssl_cert register: ssl_cert
tags: tags:
- install - install
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
- local_action: - local_action:
module: stat module: stat
path: "{{ NGINX_SSL_KEY }}" path: "{{ NGINX_SSL_KEY }}"
sudo: False become: False
register: ssl_key register: ssl_key
tags: tags:
- install - install
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
dest={{ NOTIFIER_CODE_DIR }} repo={{ NOTIFIER_SOURCE_REPO }} dest={{ NOTIFIER_CODE_DIR }} repo={{ NOTIFIER_SOURCE_REPO }}
version={{ NOTIFIER_VERSION }} version={{ NOTIFIER_VERSION }}
accept_hostkey=yes accept_hostkey=yes
sudo: true become: true
sudo_user: "{{ notifier_user }}" become_user: "{{ notifier_user }}"
notify: notify:
- restart notifier-scheduler - restart notifier-scheduler
- restart notifier-celery-workers - restart notifier-celery-workers
...@@ -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 }}" become_user: "{{ notifier_user }}"
environment: environment:
GIT_SSH: "{{ notifier_git_ssh }}" GIT_SSH: "{{ notifier_git_ssh }}"
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
pip: pip:
requirements="{{ NOTIFIER_REQUIREMENTS_FILE }}" requirements="{{ NOTIFIER_REQUIREMENTS_FILE }}"
virtualenv="{{ NOTIFIER_VENV_DIR }}" state=present virtualenv="{{ NOTIFIER_VENV_DIR }}" state=present
sudo: true become: true
sudo_user: "{{ notifier_user }}" become_user: "{{ notifier_user }}"
notify: notify:
- restart notifier-scheduler - restart notifier-scheduler
- restart notifier-celery-workers - restart notifier-celery-workers
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
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 become: true
notify: notify:
- restart notifier-scheduler - restart notifier-scheduler
- restart notifier-celery-workers - restart notifier-celery-workers
...@@ -77,8 +77,8 @@ ...@@ -77,8 +77,8 @@
- name: syncdb - name: syncdb
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 become: true
sudo_user: "{{ notifier_user }}" become_user: "{{ notifier_user }}"
environment: notifier_env_vars environment: notifier_env_vars
notify: notify:
- restart notifier-scheduler - restart notifier-scheduler
......
...@@ -69,8 +69,8 @@ ...@@ -69,8 +69,8 @@
- name: ensure .bashrc exists - name: ensure .bashrc exists
shell: touch {{ notifier_app_dir }}/.bashrc shell: touch {{ notifier_app_dir }}/.bashrc
sudo: true become: true
sudo_user: "{{ notifier_user }}" become_user: "{{ notifier_user }}"
- name: add source of notifier_env to .bashrc - name: add source of notifier_env to .bashrc
lineinfile: lineinfile:
...@@ -110,26 +110,26 @@ ...@@ -110,26 +110,26 @@
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 }}" become_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 }}" become_user: "{{ notifier_user }}"
- name: write supervisord config for celery workers - name: write supervisord config for celery workers
template: > template: >
src=edx/app/supervisor/conf.d/notifier-celery-workers.conf.j2 src=edx/app/supervisor/conf.d/notifier-celery-workers.conf.j2
dest="{{ supervisor_available_dir }}/notifier-celery-workers.conf" dest="{{ supervisor_available_dir }}/notifier-celery-workers.conf"
sudo_user: "{{ supervisor_user }}" become_user: "{{ supervisor_user }}"
- name: write supervisord config for scheduler - name: write supervisord config for scheduler
template: > template: >
src=edx/app/supervisor/conf.d/notifier-scheduler.conf.j2 src=edx/app/supervisor/conf.d/notifier-scheduler.conf.j2
dest="{{ supervisor_available_dir }}/notifier-scheduler.conf" dest="{{ supervisor_available_dir }}/notifier-scheduler.conf"
sudo_user: "{{ supervisor_user }}" become_user: "{{ supervisor_user }}"
- name: enable supervisord config for celery workers - name: enable supervisord config for celery workers
file: > file: >
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
dest="{{ supervisor_cfg_dir }}/notifier-celery-workers.conf" dest="{{ supervisor_cfg_dir }}/notifier-celery-workers.conf"
state=link state=link
force=yes force=yes
sudo_user: "{{ supervisor_user }}" become_user: "{{ supervisor_user }}"
notify: restart notifier-celery-workers notify: restart notifier-celery-workers
when: not disable_edx_services when: not disable_edx_services
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
dest="{{ supervisor_cfg_dir }}/notifier-scheduler.conf" dest="{{ supervisor_cfg_dir }}/notifier-scheduler.conf"
state=link state=link
force=yes force=yes
sudo_user: "{{ supervisor_user }}" become_user: "{{ supervisor_user }}"
notify: restart notifier-scheduler notify: restart notifier-scheduler
when: not disable_edx_services when: not disable_edx_services
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
--client_id {{ item.id }} --client_id {{ item.id }}
--client_secret {{ item.secret }} --client_secret {{ item.secret }}
--trusted --trusted
sudo_user: "{{ edxapp_user }}" become_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
with_items: oauth_client_setup_oauth2_clients with_items: oauth_client_setup_oauth2_clients
when: item.name != 'None' when: item.name != 'None'
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
template: template:
src: edx/app/programs/programs_gunicorn.py.j2 src: edx/app/programs/programs_gunicorn.py.j2
dest: "{{ programs_home }}/programs_gunicorn.py" dest: "{{ programs_home }}/programs_gunicorn.py"
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
- name: install application requirements - name: install application requirements
pip: pip:
...@@ -33,25 +33,25 @@ ...@@ -33,25 +33,25 @@
# Ansible will initialize this virtualenv if it's missing. # Ansible will initialize this virtualenv if it's missing.
virtualenv: "{{ programs_venv_dir }}" virtualenv: "{{ programs_venv_dir }}"
state: present state: present
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
with_items: "{{ programs_requirements }}" with_items: "{{ programs_requirements }}"
- name: create nodeenv - name: create nodeenv
shell: > shell: >
creates={{ programs_nodeenv_dir }} creates={{ programs_nodeenv_dir }}
{{ programs_venv_dir }}/bin/nodeenv {{ programs_nodeenv_dir }} --prebuilt {{ programs_venv_dir }}/bin/nodeenv {{ programs_nodeenv_dir }} --prebuilt
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
- name: install node dependencies - name: install node dependencies
npm: executable={{ programs_nodeenv_bin }}/npm path={{ programs_code_dir }} production=yes npm: executable={{ programs_nodeenv_bin }}/npm path={{ programs_code_dir }} production=yes
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
environment: "{{ programs_environment }}" environment: "{{ programs_environment }}"
- name: install bower dependencies - name: install bower dependencies
shell: > shell: >
chdir={{ programs_code_dir }} chdir={{ programs_code_dir }}
. {{ programs_nodeenv_bin }}/activate && {{ programs_node_bin }}/bower install --production --config.interactive=false . {{ programs_nodeenv_bin }}/activate && {{ programs_node_bin }}/bower install --production --config.interactive=false
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
- name: migrate - name: migrate
shell: > shell: >
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
DB_MIGRATION_USER={{ COMMON_MYSQL_MIGRATE_USER }} DB_MIGRATION_USER={{ COMMON_MYSQL_MIGRATE_USER }}
DB_MIGRATION_PASS={{ COMMON_MYSQL_MIGRATE_PASS }} DB_MIGRATION_PASS={{ COMMON_MYSQL_MIGRATE_PASS }}
{{ programs_venv_dir }}/bin/python ./manage.py migrate --noinput {{ programs_venv_dir }}/bin/python ./manage.py migrate --noinput
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
environment: "{{ programs_environment }}" environment: "{{ programs_environment }}"
when: migrate_db is defined and migrate_db|lower == "yes" when: migrate_db is defined and migrate_db|lower == "yes"
...@@ -67,21 +67,21 @@ ...@@ -67,21 +67,21 @@
shell: > shell: >
chdir={{ programs_code_dir }} chdir={{ programs_code_dir }}
. {{ programs_nodeenv_bin }}/activate && {{ programs_node_bin }}/gulp css . {{ programs_nodeenv_bin }}/activate && {{ programs_node_bin }}/gulp css
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
when: not devstack when: not devstack
- name: run r.js optimizer - name: run r.js optimizer
shell: > shell: >
chdir={{ programs_code_dir }} chdir={{ programs_code_dir }}
. {{ programs_nodeenv_bin }}/activate && {{ programs_node_bin }}/r.js -o build.js . {{ programs_nodeenv_bin }}/activate && {{ programs_node_bin }}/r.js -o build.js
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
when: not devstack when: not devstack
- name: run collectstatic - name: run collectstatic
shell: > shell: >
chdir={{ programs_code_dir }} chdir={{ programs_code_dir }}
{{ programs_venv_dir }}/bin/python manage.py {{ item }} {{ programs_venv_dir }}/bin/python manage.py {{ item }}
sudo_user: "{{ programs_user }}" become_user: "{{ programs_user }}"
environment: "{{ programs_environment }}" environment: "{{ programs_environment }}"
with_items: with_items:
- "collectstatic --noinput" - "collectstatic --noinput"
...@@ -157,4 +157,4 @@ ...@@ -157,4 +157,4 @@
config: "{{ supervisor_cfg }}" config: "{{ supervisor_cfg }}"
name: "{{ programs_service_name }}" name: "{{ programs_service_name }}"
when: not disable_edx_services when: not disable_edx_services
sudo_user: "{{ supervisor_service_user }}" become_user: "{{ supervisor_service_user }}"
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
repo=https://github.com/sstephenson/rbenv.git repo=https://github.com/sstephenson/rbenv.git
dest={{ rbenv_dir }}/.rbenv version={{ rbenv_version }} dest={{ rbenv_dir }}/.rbenv version={{ rbenv_version }}
accept_hostkey=yes accept_hostkey=yes
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
tags: tags:
- install - install
- install:base - install:base
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
- name: ensure ruby_env exists - name: ensure ruby_env exists
template: > template: >
src=ruby_env.j2 dest={{ rbenv_dir }}/ruby_env src=ruby_env.j2 dest={{ rbenv_dir }}/ruby_env
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
tags: tags:
- install - install
- install:base - install:base
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
- name: create temporary directory - name: create temporary directory
command: mktemp -d command: mktemp -d
register: tempdir register: tempdir
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
when: rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers) when: rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers)
tags: tags:
- install - install
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
repo=https://github.com/sstephenson/ruby-build.git dest={{ tempdir.stdout }}/ruby-build repo=https://github.com/sstephenson/ruby-build.git dest={{ tempdir.stdout }}/ruby-build
accept_hostkey=yes accept_hostkey=yes
when: tempdir.stdout is defined and (rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers)) when: tempdir.stdout is defined and (rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers))
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
tags: tags:
- install - install
- install:base - install:base
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
- name: check ruby {{ rbenv_ruby_version }} installed - name: check ruby {{ rbenv_ruby_version }} installed
shell: "rbenv versions | grep {{ rbenv_ruby_version }}" shell: "rbenv versions | grep {{ rbenv_ruby_version }}"
register: ruby_installed register: ruby_installed
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
environment: "{{ rbenv_environment }}" environment: "{{ rbenv_environment }}"
ignore_errors: yes ignore_errors: yes
tags: tags:
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
- name: install ruby {{ rbenv_ruby_version }} - name: install ruby {{ rbenv_ruby_version }}
shell: "rbenv install {{ rbenv_ruby_version }} creates={{ rbenv_dir }}/.rbenv/versions/{{ rbenv_ruby_version }}" shell: "rbenv install {{ rbenv_ruby_version }} creates={{ rbenv_dir }}/.rbenv/versions/{{ rbenv_ruby_version }}"
when: ruby_installed|failed when: ruby_installed|failed
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
environment: "{{ rbenv_environment }}" environment: "{{ rbenv_environment }}"
tags: tags:
- install - install
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
- name: set global ruby {{ rbenv_ruby_version }} - name: set global ruby {{ rbenv_ruby_version }}
shell: "rbenv global {{ rbenv_ruby_version }}" shell: "rbenv global {{ rbenv_ruby_version }}"
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
environment: "{{ rbenv_environment }}" environment: "{{ rbenv_environment }}"
tags: tags:
- install - install
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
- name: install bundler - name: install bundler
shell: "gem install bundler -v {{ rbenv_bundler_version }}" shell: "gem install bundler -v {{ rbenv_bundler_version }}"
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
environment: "{{ rbenv_environment }}" environment: "{{ rbenv_environment }}"
tags: tags:
- install - install
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
- name: install rake gem - name: install rake gem
shell: "gem install rake -v {{ rbenv_rake_version }}" shell: "gem install rake -v {{ rbenv_rake_version }}"
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
environment: "{{ rbenv_environment }}" environment: "{{ rbenv_environment }}"
when: jenkins_worker is not defined or not jenkins_worker when: jenkins_worker is not defined or not jenkins_worker
tags: tags:
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
- name: update rubygems - name: update rubygems
shell: "gem install rubygems-update && update_rubygems" shell: "gem install rubygems-update && update_rubygems"
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
environment: "{{ rbenv_environment }}" environment: "{{ rbenv_environment }}"
tags: tags:
- install - install
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
- name: rehash - name: rehash
shell: "rbenv rehash" shell: "rbenv rehash"
sudo_user: "{{ rbenv_user }}" become_user: "{{ rbenv_user }}"
environment: "{{ rbenv_environment }}" environment: "{{ rbenv_environment }}"
tags: tags:
- install - install
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
- name: update snort - name: update snort
shell: oinkmaster -C /etc/oinkmaster.conf -o /etc/snort/rules/ shell: oinkmaster -C /etc/oinkmaster.conf -o /etc/snort/rules/
sudo: yes become: yes
- name: snort service - name: snort service
service: > service: >
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
virtualenv: "{{ supervisor_venv_dir }}" virtualenv: "{{ supervisor_venv_dir }}"
state: present state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}" extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo_user: "{{ supervisor_user }}" become_user: "{{ supervisor_user }}"
tags: tags:
- install - install
- install:base - install:base
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
pip: > pip: >
name={{ item }} virtualenv="{{ supervisor_venv_dir }}" state=present name={{ item }} virtualenv="{{ supervisor_venv_dir }}" state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo_user: "{{ supervisor_user }}" become_user: "{{ supervisor_user }}"
with_items: supervisor_pip_pkgs with_items: supervisor_pip_pkgs
tags: tags:
- install - install
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
src: xvfb.j2 src: xvfb.j2
owner: root owner: root
group: root group: root
mode: 755 mode: 0755
register: xvfb register: xvfb
tags: tags:
- install - install
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
repo=https://github.com/edx/edx-platform.git repo=https://github.com/edx/edx-platform.git
dest={{ test_build_server_repo_path }}/edx-platform-clone dest={{ test_build_server_repo_path }}/edx-platform-clone
version={{ test_edx_platform_version }} version={{ test_edx_platform_version }}
sudo_user: "{{ test_build_server_user }}" become_user: "{{ test_build_server_user }}"
- name: get xargs limit - name: get xargs limit
shell: "xargs --show-limits" shell: "xargs --show-limits"
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
shell: "bash test-development-environment.sh {{ item }}" shell: "bash test-development-environment.sh {{ item }}"
args: args:
chdir: "{{ test_build_server_repo_path }}/" chdir: "{{ test_build_server_repo_path }}/"
sudo_user: "{{ test_build_server_user }}" become_user: "{{ test_build_server_user }}"
with_items: with_items:
- "unit" - "unit"
- "js" - "js"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- name: import the test courses from github - name: import the test courses from github
shell: > shell: >
{{ demo_edxapp_venv_bin }}/python /edx/bin/manage.edxapp lms git_add_course --settings=aws "{{ item.github_url }}" {{ demo_edxapp_venv_bin }}/python /edx/bin/manage.edxapp lms git_add_course --settings=aws "{{ item.github_url }}"
sudo_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
when: item.install == True when: item.install == True
with_items: TESTCOURSES_EXPORTS with_items: TESTCOURSES_EXPORTS
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
shell: > shell: >
{{ demo_edxapp_venv_bin }}/python ./manage.py lms --settings=aws --service-variant lms enroll_user_in_course -e {{ item[0].email }} -c {{ item[1].course_id }} {{ demo_edxapp_venv_bin }}/python ./manage.py lms --settings=aws --service-variant lms enroll_user_in_course -e {{ item[0].email }} -c {{ item[1].course_id }}
chdir={{ demo_edxapp_code_dir }} chdir={{ demo_edxapp_code_dir }}
sudo_user: "{{ common_web_user }}" become_user: "{{ common_web_user }}"
when: item[1].install == True when: item[1].install == True
with_nested: with_nested:
- demo_test_users - demo_test_users
......
...@@ -36,5 +36,5 @@ ...@@ -36,5 +36,5 @@
- name: restart ssh - name: restart ssh
service: name=ssh state=restarted service: name=ssh state=restarted
sudo: True become: True
when: config_templates.changed when: config_templates.changed
...@@ -22,21 +22,21 @@ ...@@ -22,21 +22,21 @@
- name: "add gunicorn configuration file" - name: "add gunicorn configuration file"
template: > template: >
src=xqueue_gunicorn.py.j2 dest={{ xqueue_app_dir }}/xqueue_gunicorn.py src=xqueue_gunicorn.py.j2 dest={{ xqueue_app_dir }}/xqueue_gunicorn.py
sudo_user: "{{ xqueue_user }}" become_user: "{{ xqueue_user }}"
tags: tags:
- install - install
- install:configuration - install:configuration
- name: create xqueue application config - name: create xqueue application config
template: src=xqueue.env.json.j2 dest={{ xqueue_app_dir }}/xqueue.env.json mode=0644 template: src=xqueue.env.json.j2 dest={{ xqueue_app_dir }}/xqueue.env.json mode=0644
sudo_user: "{{ xqueue_user }}" become_user: "{{ xqueue_user }}"
tags: tags:
- install - install
- install:configuration - install:configuration
- name: create xqueue auth file - name: create xqueue auth file
template: src=xqueue.auth.json.j2 dest={{ xqueue_app_dir }}/xqueue.auth.json mode=0644 template: src=xqueue.auth.json.j2 dest={{ xqueue_app_dir }}/xqueue.auth.json mode=0644
sudo_user: "{{ xqueue_user }}" become_user: "{{ xqueue_user }}"
tags: tags:
- install - install
- install:configuration - install:configuration
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
git_2_0_1: > git_2_0_1: >
dest={{ xqueue_code_dir }} repo={{ xqueue_source_repo }} version={{ xqueue_version }} dest={{ xqueue_code_dir }} repo={{ xqueue_source_repo }} version={{ xqueue_version }}
accept_hostkey=yes accept_hostkey=yes
sudo_user: "{{ xqueue_user }}" become_user: "{{ xqueue_user }}"
register: xqueue_checkout register: xqueue_checkout
tags: tags:
- install - install
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
pip: > pip: >
requirements="{{ xqueue_pre_requirements_file }}" virtualenv="{{ xqueue_venv_dir }}" state=present requirements="{{ xqueue_pre_requirements_file }}" virtualenv="{{ xqueue_venv_dir }}" state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w"
sudo_user: "{{ xqueue_user }}" become_user: "{{ xqueue_user }}"
tags: tags:
- install - install
- install:app-requirements - install:app-requirements
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
pip: > pip: >
requirements="{{ xqueue_post_requirements_file }}" virtualenv="{{ xqueue_venv_dir }}" state=present requirements="{{ xqueue_post_requirements_file }}" virtualenv="{{ xqueue_venv_dir }}" state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w"
sudo_user: "{{ xqueue_user }}" become_user: "{{ xqueue_user }}"
tags: tags:
- install - install
- install:app-requirements - install:app-requirements
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
- name: migrate - name: migrate
shell: > shell: >
SERVICE_VARIANT=xqueue {{ xqueue_venv_bin }}/django-admin.py migrate --noinput --settings=xqueue.aws_migrate --pythonpath={{ xqueue_code_dir }} SERVICE_VARIANT=xqueue {{ xqueue_venv_bin }}/django-admin.py migrate --noinput --settings=xqueue.aws_migrate --pythonpath={{ xqueue_code_dir }}
sudo_user: "{{ xqueue_user }}" become_user: "{{ xqueue_user }}"
environment: environment:
DB_MIGRATION_USER: "{{ COMMON_MYSQL_MIGRATE_USER }}" DB_MIGRATION_USER: "{{ COMMON_MYSQL_MIGRATE_USER }}"
DB_MIGRATION_PASS: "{{ COMMON_MYSQL_MIGRATE_PASS }}" DB_MIGRATION_PASS: "{{ COMMON_MYSQL_MIGRATE_PASS }}"
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
- name: create users - name: create users
shell: > shell: >
SERVICE_VARIANT=xqueue {{ xqueue_venv_bin }}/django-admin.py update_users --settings=xqueue.aws_settings --pythonpath={{ xqueue_code_dir }} SERVICE_VARIANT=xqueue {{ xqueue_venv_bin }}/django-admin.py update_users --settings=xqueue.aws_settings --pythonpath={{ xqueue_code_dir }}
sudo_user: "{{ xqueue_user }}" become_user: "{{ xqueue_user }}"
tags: tags:
- manage - manage
- manage:app-users - manage:app-users
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
pip: > pip: >
requirements="{{ xqwatcher_requirements_file }}" requirements="{{ xqwatcher_requirements_file }}"
virtualenv="{{ xqwatcher_app_dir }}/venvs/{{ xqwatcher_service_name }}" state=present virtualenv="{{ xqwatcher_app_dir }}/venvs/{{ xqwatcher_service_name }}" state=present
sudo: true become: true
sudo_user: "{{ xqwatcher_user }}" become_user: "{{ xqwatcher_user }}"
tags: tags:
- install - install
- install:app-requirements - install:app-requirements
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
config={{ xqwatcher_supervisor_app_dir }}/supervisord.conf config={{ xqwatcher_supervisor_app_dir }}/supervisord.conf
name={{ xqwatcher_service_name }} name={{ xqwatcher_service_name }}
when: not disable_edx_services when: not disable_edx_services
sudo_user: "{{ xqwatcher_user }}" become_user: "{{ xqwatcher_user }}"
tags: tags:
- manage - manage
- manage:update - manage:update
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
- name: "add gunicorn configuration file" - name: "add gunicorn configuration file"
template: > template: >
src=xserver_gunicorn.py.j2 dest={{ xserver_app_dir }}/xserver_gunicorn.py src=xserver_gunicorn.py.j2 dest={{ xserver_app_dir }}/xserver_gunicorn.py
sudo_user: "{{ xserver_user }}" become_user: "{{ xserver_user }}"
notify: notify:
- restart xserver - restart xserver
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
git_2_0_1: > git_2_0_1: >
dest={{ xserver_code_dir }} repo={{ xserver_source_repo }} version={{xserver_version}} dest={{ xserver_code_dir }} repo={{ xserver_source_repo }} version={{xserver_version}}
accept_hostkey=yes accept_hostkey=yes
sudo_user: "{{ xserver_user }}" become_user: "{{ xserver_user }}"
register: xserver_checkout register: xserver_checkout
notify: restart xserver notify: restart xserver
...@@ -30,19 +30,19 @@ ...@@ -30,19 +30,19 @@
pip: > pip: >
requirements="{{ xserver_requirements_file }}" virtualenv="{{ xserver_venv_dir }}" state=present requirements="{{ xserver_requirements_file }}" virtualenv="{{ xserver_venv_dir }}" state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo_user: "{{ xserver_user }}" become_user: "{{ xserver_user }}"
notify: restart xserver notify: restart xserver
- name: install sandbox requirements - name: install sandbox requirements
pip: > pip: >
requirements="{{ xserver_requirements_file }}" virtualenv="{{ xserver_venv_sandbox_dir }}" state=present requirements="{{ xserver_requirements_file }}" virtualenv="{{ xserver_venv_sandbox_dir }}" state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo_user: "{{ xserver_user }}" become_user: "{{ xserver_user }}"
notify: restart xserver notify: restart xserver
- name: create xserver application config - name: create xserver application config
template: src=xserver.env.json.j2 dest={{ xserver_app_dir }}/env.json template: src=xserver.env.json.j2 dest={{ xserver_app_dir }}/env.json
sudo_user: "{{ xserver_user }}" become_user: "{{ xserver_user }}"
notify: restart xserver notify: restart xserver
- name: install read-only ssh key for the content repo that is required for grading - name: install read-only ssh key for the content repo that is required for grading
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
GIT_SSH: /tmp/git_ssh.sh GIT_SSH: /tmp/git_ssh.sh
notify: restart xserver notify: restart xserver
register: xserver_grader_checkout register: xserver_grader_checkout
sudo_user: "{{ xserver_user }}" become_user: "{{ xserver_user }}"
- name: remove read-only ssh key for the content repo - name: remove read-only ssh key for the content repo
file: path={{ xserver_git_identity }} state=absent file: path={{ xserver_git_identity }} state=absent
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
git_2_0_1: > git_2_0_1: >
dest="{{ xsy_code_dir }}" repo="{{ xsy_source_repo }}" dest="{{ xsy_code_dir }}" repo="{{ xsy_source_repo }}"
version="{{ xsy_version }}" accept_hostkey=yes version="{{ xsy_version }}" accept_hostkey=yes
sudo_user: "{{ xsy_user }}" become_user: "{{ xsy_user }}"
register: xsy_checkout register: xsy_checkout
notify: restart xsy notify: restart xsy
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
virtualenv="{{ xsy_venv_dir }}" virtualenv="{{ xsy_venv_dir }}"
state=present state=present
extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}" extra_args="-i {{ COMMON_PYPI_MIRROR_URL }}"
sudo_user: "{{ xsy_user }}" become_user: "{{ xsy_user }}"
notify: restart xsy notify: restart xsy
- name: create the supervisor wrapper - name: create the supervisor wrapper
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
src="{{ xsy_supervisor_wrapper|basename }}.j2" src="{{ xsy_supervisor_wrapper|basename }}.j2"
dest="{{ xsy_supervisor_wrapper }}" dest="{{ xsy_supervisor_wrapper }}"
mode=0755 mode=0755
sudo_user: "{{ xsy_user }}" become_user: "{{ xsy_user }}"
notify: restart xsy notify: restart xsy
- name: create a supervisor config - name: create a supervisor config
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
src=xsy.conf.j2 dest="{{ supervisor_available_dir }}/xsy.conf" src=xsy.conf.j2 dest="{{ supervisor_available_dir }}/xsy.conf"
owner="{{ supervisor_user }}" owner="{{ supervisor_user }}"
group="{{ supervisor_user }}" group="{{ supervisor_user }}"
sudo_user: "{{ supervisor_user }}" become_user: "{{ supervisor_user }}"
notify: restart xsy notify: restart xsy
- name: enable the supervisor config - name: enable the supervisor config
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
state=link state=link
force=yes force=yes
mode=0644 mode=0644
sudo_user: "{{ supervisor_user }}" become_user: "{{ supervisor_user }}"
when: not disable_edx_services when: not disable_edx_services
notify: restart xsy notify: restart xsy
......
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