This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates Networks, subnets, security groups, etc. | |
- name: Create networks | |
hosts: localhost | |
gather_facts: False | |
pre_tasks: | |
- include_vars: "{{ playbook_dir }}/environments/{{ env }}.yml" | |
- name: Create network | |
local_action: | |
module: quantum_network | |
auth_url: "{{ os_auth_url }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import yaml | |
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) | |
# Setup variables for loading yaml settings | |
CONFIG_DEFAULT = os.path.abspath(os.path.join(BASE_DIR, '../etc')) | |
CONFIG_ROOT = os.environ.get('CONFIG_ROOT', CONFIG_DEFAULT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .devstack import * # pylint: disable=wildcard-import, unused-wildcard-import | |
from .common import INSTALLED_APPS, MIDDLEWARE_CLASSES | |
FEATURES['ENABLE_SYSADMIN_DASHBOARD'] = True | |
MODULESTORE = { | |
'default': { | |
'ENGINE': 'xmodule.modulestore.mongo.MongoModuleStore', | |
'OPTIONS': { | |
"collection": "modulestore", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Apply Upgrade for bash vulnerability in Ubuntu | |
hosts: all | |
sudo: yes | |
tasks: | |
- name: Check if we are vulnerable | |
shell: executable=/bin/bash chdir=/tmp foo='() { echo vulnerable; }' bash -c foo | |
register: test_vuln | |
ignore_errors: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
hostname=example.com | |
while true; do | |
ip=$(dig +short $hostname | tail -n 1) | |
if [ ! -n "$ip" ]; then | |
echo "Failed at $(date)" | |
fi | |
sleep 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# no startup msg | |
startup_message off | |
# always use a login shell | |
shell -$SHELL | |
# auto-log | |
logfile $HOME/log/screen-logs/%Y%m%d-%n.log | |
deflog on | |
escape ^Oo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Update libc6 and reboot | |
hosts: all | |
sudo: yes | |
# Comment out to apply to all servers | |
serial: 1 | |
tasks: | |
- name: "Install packages and update cache" | |
apt: name="{{ item }}" state=latest update_cache=yes | |
with_items: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def x_in_loop(): | |
x = range(500) | |
for i in x: | |
if x == 253: | |
return True | |
return False | |
def x_in_range(): | |
x = range(500) | |
return 253 in x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
edx_platform_repo: "https://github.com/mitocw/edx-platform.git" | |
edx_platform_version: "mitx-release" | |
edxapp_use_custom_theme: true | |
edxapp_theme_name: mitx | |
edxapp_theme_source_repo: 'https://{{ COMMON_GIT_MIRROR }}/mitocw/edx-theme.git' | |
edxapp_theme_version: 'mitx-loloadx' | |
EDXAPP_MKTG_URL_LINK_MAP: | |
CONTACT: !!null | |
FAQ: !!null | |
HONOR: !!null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Apply common configration to all nodes | |
hosts: all:&tag_org_mitx:&tag_status_production:&tag_env_{{ env }} | |
sudo: yes | |
vars_files: | |
- $playbook_dir/environments/{{ env }}.yml | |
roles: | |
- mitx-common | |
- name: Apply backup configuration | |
hosts: tag_group_backup:&tag_org_mitx:&tag_status_production:&tag_env_{{ env }} |
OlderNewer