OPS-1593 As an operator, I want sudo_user converted to become user in roles and…

OPS-1593 As an operator, I want sudo_user converted to become user in roles and plays, for compatibility with Ansible 2.x
parent bcebe5be
- name: Deploy aide IDS
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
......@@ -2,7 +2,7 @@
# Usage: ansible-playbook alton.yml -i <admin-host>, -e <secure-repo>/admin/edx_admin.yml -e <secure-repo>/admin/admin.yml
- name: Configure instance(s)
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Deploy all analytics services to a single node
hosts: all
sudo: True
become: True
gather_facts: True
vars:
migrate_db: "yes"
......
- name: Deploy Analytics API
hosts: all
sudo: True
become: True
gather_facts: True
vars:
ENABLE_DATADOG: False
......
- name: Deploy Antivirus Scanner
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
- name: Deploy Asqatasun
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- mysql
......
- name: Deploy aws
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Deploy certs
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
......@@ -2,7 +2,7 @@
# ansible-playbook -i ec2.py cluster_rabbitmq.yml --limit tag_Name_stage-edx-commoncluster -e@/path/to/vars/env-deployment.yml -T 30 --list-hosts
- hosts: all
sudo: True
become: True
serial: 1
vars:
# By default take instances in and out of the elb(s) they
......@@ -23,7 +23,7 @@
region: us-east-1
state: absent
wait_timeout: 60
sudo: False
become: False
when: elb_pre_post
tasks:
- debug: msg="{{ ansible_ec2_local_ipv4 }}"
......@@ -44,5 +44,5 @@
state: present
wait_timeout: 60
with_items: ec2_elbs
sudo: False
become: False
when: elb_pre_post
- name: Deploy common
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
# ansible-playbook -i ec2.py commoncluster.yml --limit tag_Name_stage-edx-commoncluster -e@/path/to/vars/env-deployment.yml -T 30 --list-hosts
- hosts: all
sudo: True
become: True
serial: 1
vars:
# By default take instances in and out of the elb(s) they
......@@ -23,7 +23,7 @@
region: us-east-1
state: absent
wait_timeout: 60
sudo: False
become: False
when: elb_pre_post
roles:
- aws
......@@ -52,7 +52,7 @@
state: present
wait_timeout: 60
with_items: ec2_elbs
sudo: False
become: False
when: elb_pre_post
#
# In order to reconfigure the host resolution we are issuing a
......@@ -60,7 +60,7 @@
# TODO: We should probably poll to ensure the host comes back before moving
# to the next host so that we don't reboot all of the servers simultaneously
- hosts: all
sudo: True
become: True
serial: 1
vars:
reboot: False
......
- name: connect a sandbox to production data
hosts: all
gather_facts: False
sudo: True
become: True
tasks:
# WARNING - calling lineinfile on a symlink
......
......@@ -3,7 +3,7 @@
# to be run on a real system
- name: Create all user types (test play)
hosts: all
sudo: True
become: True
gather_facts: False
vars_files:
- 'roles/edxapp/defaults/main.yml'
......@@ -13,7 +13,7 @@
pre_tasks:
- fail: msg="You must pass a user into this play"
when: user is not defined
- name: give access with no sudo
- name: give access with no become
set_fact:
CUSTOM_USER_INFO:
- name: "{{ user }}"
......@@ -23,10 +23,10 @@
- name: test-normal-user
- name: test-restricted-user-edxapp
type: restricted
sudoers_template: 99-edxapp-manage-cmds.j2
becomeers_template: 99-edxapp-manage-cmds.j2
- name: test-restricted-user-anayltics
type: restricted
sudoers_template: 99-analytics-manage-cmds.j2
becomeers_template: 99-analytics-manage-cmds.j2
roles:
- role: user
user_info: "{{ CUSTOM_USER_INFO }}"
# Creates a single user on a server
# By default no super-user privileges
# Example: ansible-playbook -i "jarv.sandbox.edx.org," ./create_user.yml -e "user=jarv"
# Create a user with sudo privileges
# Example: ansible-playbook -i "jarv.sandbox.edx.org," ./create_user.yml -e "user=jarv" -e "give_sudo=true"
# Create a user with become privileges
# Example: ansible-playbook -i "jarv.sandbox.edx.org," ./create_user.yml -e "user=jarv" -e "give_become=true"
- name: Create a single user
hosts: all
sudo: True
become: True
gather_facts: False
pre_tasks:
- fail: msg="You must pass a user into this play"
when: user is not defined
- name: give access with no sudo
- name: give access with no become
set_fact:
CUSTOM_USER_INFO:
- name: "{{ user }}"
github: true
when: give_sudo is not defined
- name: give access with sudo
when: give_become is not defined
- name: give access with become
set_fact:
CUSTOM_USER_INFO:
- name: "{{ user }}"
type: admin
github: true
when: give_sudo is defined
when: give_become is defined
roles:
- role: user
user_info: "{{ CUSTOM_USER_INFO }}"
- name: Deploy edX Credentials Service
hosts: all
sudo: True
become: True
gather_facts: True
vars:
ENABLE_DATADOG: False
......
- name: Deploy demo course
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Configure instance(s)
hosts: all
sudo: True
become: True
gather_facts: False
vars_files:
- roles/edxapp/defaults/main.yml
......
- name: Deploy edX Course Discovery Service
hosts: all
sudo: True
become: True
gather_facts: True
vars:
ENABLE_DATADOG: False
......
- name: Deploy edX Ecommerce
hosts: all
sudo: True
become: True
gather_facts: True
vars:
ENABLE_DATADOG: False
......
- name: Deploy edX Ecommerce Worker
hosts: all
sudo: True
become: True
gather_facts: True
vars:
ENABLE_DATADOG: False
......
- name: Deploy the edx_ansible on AWS
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Configure instance(s)
hosts: all
sudo: True
become: True
gather_facts: True
serial: 10
vars:
......
- name: Configure instance(s)
hosts: jenkins_test
sudo: True
become: True
gather_facts: True
vars:
migrate_db: "yes"
......
# ansible-playbook --limit tag_Name_mirror edx_mirror.yml --user ubuntu -i ec2.py
- name: Configure instance(s)
hosts: all
sudo: True
become: True
gather_facts: False
roles:
- role: nginx
......
- name: Configure stage instance(s)
hosts: notifier_stage
sudo: True
become: True
vars_files:
- "{{ secure_dir }}/vars/stage/notifier.yml"
- "{{ secure_dir }}/vars/users.yml"
......@@ -15,7 +15,7 @@
- name: Configure loadtest instance(s)
hosts: notifier_loadtest
sudo: True
become: True
vars_files:
- "{{ secure_dir }}/vars/loadtest/notifier.yml"
- "{{ secure_dir }}/vars/users.yml"
......@@ -30,7 +30,7 @@
- name: Configure stage edge instance(s)
hosts: notifier_edge_stage
sudo: True
become: True
vars_files:
- "{{ secure_dir }}/vars/edge_stage/notifier.yml"
- "{{ secure_dir }}/vars/users.yml"
......@@ -45,7 +45,7 @@
- name: Configure prod instance(s)
hosts: notifier_prod
sudo: True
become: True
vars_files:
- "{{ secure_dir }}/vars/prod/notifier.yml"
- "{{ secure_dir }}/vars/users.yml"
......@@ -60,7 +60,7 @@
- name: Configure edge prod instance(s)
hosts: notifier_edge_prod
sudo: True
become: True
vars_files:
- "{{ secure_dir }}/vars/edge_prod/notifier.yml"
- "{{ secure_dir }}/vars/users.yml"
......
......@@ -41,7 +41,7 @@
- name: Configure instance(s)
hosts: launched
sudo: True
become: True
gather_facts: True
vars:
elb: false
......@@ -79,7 +79,7 @@
- Name: "{{ name_tag }}"
register: ec2_info
when: elb
sudo: False
become: False
- name: register instance into an elb if one was provided
local_action:
module: ec2_elb
......@@ -89,4 +89,4 @@
ec2_elbs:
- "{{ elb }}"
when: elb
sudo: False
become: False
- name: Deploy edxapp
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Run edxapp migrations
hosts: all
sudo: False
become: False
gather_facts: False
vars:
db_dry_run: "--list"
......
- hosts: all
sudo: True
become: True
vars:
# By default take instances in and out of the elb(s) they
# are attached to
......@@ -21,7 +21,7 @@
region: us-east-1
state: absent
wait_timeout: 60
sudo: False
become: False
when: elb_pre_post
roles:
- common
......@@ -40,5 +40,5 @@
state: present
wait_timeout: 60
with_items: ec2_elbs
sudo: False
become: False
when: elb_pre_post
- name: Deploy celery flower (monitoring tool)
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Deploy forum
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Deploy Harstorage
hosts: all
sudo: True
become: True
gather_facts: True
vars:
nginx_default_sites:
......
- name: Deploy Insights
hosts: all
sudo: True
become: True
gather_facts: True
vars:
ENABLE_DATADOG: False
......
# Configure an instance with the admin jenkins.
- name: Configure instance(s)
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
......@@ -4,7 +4,7 @@
- name: Configure instance(s)
hosts: jenkins_master
sudo: True
become: True
gather_facts: True
vars:
COMMON_DATA_DIR: "/mnt2"
......@@ -56,4 +56,4 @@
- role: splunkforwarder
when: COMMON_ENABLE_SPLUNKFORWARDER
tags: splunkonly
sudo: True
become: True
# Configure an instance with the tool jenkins.
- name: Configure Jenkins instance(s)
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
......@@ -4,7 +4,7 @@
- name: Configure instance(s)
hosts: jenkins_worker
sudo: True
become: True
gather_facts: True
vars:
mongo_enable_journal: False
......
......@@ -4,7 +4,7 @@
- name: Configure instance(s)
hosts: jenkins_worker
sudo: True
become: True
gather_facts: True
vars:
mongo_enable_journal: False
......
# ansible-playbook -i ec2.py --limit="tag_cluster_certificates:&tag_environment_loadtest" legacy_certificates.yml
- name: Deploy legacy_certs
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Deploy Locust
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
- name: Deploy edxapp
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Deploy MongoDB
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
......@@ -12,7 +12,7 @@
# ansible-playbook mongo_3_0.yml -i 10.1.1.1,10.2.2.2,new-machine-ip -e@/path/to/edx.yml -e@/path/to/ed.yml
- name: Deploy MongoDB
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
- name: Deploy MySQL
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- mysql
......@@ -2,7 +2,7 @@
# ansible-playbook -i ec2.py --limit "tag_cluster_mongo" newrelic.yml -e NEWRELIC_LICENSE_KEY='SET_ME' -v
- name: Deploy Newrelic Server Monitoring
hosts: all
sudo: True
become: True
gather_facts: True
vars:
CLUSTER_NAME: 'edxapp'
......
- name: Deploy edX Notes API
hosts: all
sudo: True
become: True
gather_facts: True
vars:
ENABLE_DATADOG: False
......
- name: Configure notifier instance
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
- name: Configure OAuth2 clients
hosts: all
sudo: True
become: True
gather_facts: True
vars_files:
- "roles/common_vars/defaults/main.yml"
......
......@@ -5,7 +5,7 @@
- name: Update edx-ora2
hosts: all
sudo: True
become: True
gather_facts: True
vars:
- edxapp_venv_dir: "/edx/app/edxapp/venvs/edxapp"
......@@ -25,7 +25,7 @@
chdir={{ edxapp_code_dir }}
environment:
PATH: "{{ edxapp_deploy_path }}"
sudo_user: "{{ edxapp_user }}"
become_user: "{{ edxapp_user }}"
notify:
- "restart edxapp"
- "restart workers"
......
- name: Deploy edX Programs Service
hosts: all
sudo: True
become: True
gather_facts: True
vars:
ENABLE_DATADOG: False
......
- name: Deploy rabbitmq
hosts: all
sudo: True
become: True
# The rabbitmq role depends on
# ansible_default_ipv4 so
# gather_facts must be set to True
......@@ -26,7 +26,7 @@
region: us-east-1
state: absent
wait_timeout: 60
sudo: False
become: False
when: elb_pre_post
roles:
- aws
......@@ -43,5 +43,5 @@
state: present
wait_timeout: 60
with_items: ec2_elbs
sudo: False
become: False
when: elb_pre_post
- name: restarts supervisor
hosts: all
sudo: True
become: True
gather_facts: False
vars_files:
- roles/common_vars/defaults/main.yml
......
......@@ -10,7 +10,7 @@
#
- name: Stop all services
hosts: "{{TARGET}}"
sudo: True
become: True
gather_facts: False
vars:
STOP_ALL_EDX_SERVICES_EXTRA_ARGS: "--no-wait"
......@@ -19,7 +19,7 @@
- name: Server retirement workflow
hosts: "{{TARGET}}"
sudo: True
become: True
gather_facts: False
tasks:
- name: Terminate existing s3 log sync
......@@ -42,7 +42,7 @@
- name: Run minos verification
hosts: "{{TARGET}}"
sudo: True
become: True
gather_facts: False
tasks:
- name: Run minos
......
......@@ -3,7 +3,7 @@
- name: Set hostname
hosts: all
sudo: True
become: True
gather_facts: False
tasks:
- name: "Ensure we have a hostname"
......
- name: Deploy Sitespeed.io
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
- name: Deploy snort IDS
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
......@@ -2,7 +2,7 @@
- name: Deploy Splunk
hosts: all
sudo: True
become: True
gather_facts: True
vars:
roles:
......
- name: Stop all services
hosts: all
sudo: True
become: True
gather_facts: False
vars:
serial_count: 1
......
- name: Deploy Tanaguru
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
- hosts: all
sudo: true
become: true
vars:
# By default take instances in and out of the elb(s) they
# are attached to
......@@ -20,7 +20,7 @@
region: us-east-1
state: absent
wait_timeout: 60
sudo: False
become: False
when: elb_pre_post
tasks:
- shell: echo "test"
......@@ -36,5 +36,5 @@
state: present
wait_timeout: 60
with_items: ec2_elbs
sudo: False
become: False
when: elb_pre_post
- name: Create courses for testing
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
......@@ -4,7 +4,7 @@
# ansible-playbook -i 'reporting.example.com,' ./tools-gp.yml --tags users -e@/var/path/users.yml -e@/vars/path/environnment-deployment.yml
- name: Deploy Ad Hoc Reporting Scripts
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
......@@ -2,7 +2,7 @@
# Configure an admin instance with jenkins and asgard.
- name: Configure instance(s)
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
- name: Deploy worker
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
- name: Deploy xqueue
hosts: all
sudo: True
become: True
gather_facts: True
vars:
# By default take instances in and out of the elb(s) they
......@@ -23,7 +23,7 @@
region: us-east-1
state: absent
wait_timeout: 60
sudo: False
become: False
when: elb_pre_post
roles:
- aws
......@@ -49,5 +49,5 @@
state: present
wait_timeout: 60
with_items: ec2_elbs
sudo: False
become: False
when: elb_pre_post
- name: Deploy xqueue-watcher
hosts: all
sudo: True
become: True
gather_facts: True
vars:
COMMON_APP_DIR: "/edx/app"
......
- name: Deploy xserver
hosts: all
sudo: True
become: True
gather_facts: True
vars:
serial_count: 1
......
# Configure an admin instance with jenkins and asgard.
- name: Configure instance(s)
hosts: all
sudo: True
become: True
gather_facts: True
roles:
- aws
......
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