Remove ansible-container files
authorLorin Hochstein <lhochstein@netflix.com>
Sun, 5 Feb 2017 01:14:26 +0000 (17:14 -0800)
committerLorin Hochstein <lhochstein@netflix.com>
Sun, 5 Feb 2017 01:14:26 +0000 (17:14 -0800)
38 files changed:
ch13/ansible/ansible.cfg [deleted file]
ch13/ansible/container.yml [deleted file]
ch13/ansible/main.yml [deleted file]
ch13/ansible/meta.yml [deleted file]
ch13/ansible/requirements.txt [deleted file]
ch13/ansible/requirements.yml [deleted file]
ch13/ansible/roles/memcached/.travis.yml [deleted file]
ch13/ansible/roles/memcached/README.md [deleted file]
ch13/ansible/roles/memcached/defaults/main.yml [deleted file]
ch13/ansible/roles/memcached/handlers/main.yml [deleted file]
ch13/ansible/roles/memcached/meta/main.yml [deleted file]
ch13/ansible/roles/memcached/tasks/main.yml [deleted file]
ch13/ansible/roles/memcached/tests/inventory [deleted file]
ch13/ansible/roles/memcached/tests/test.yml [deleted file]
ch13/ansible/roles/memcached/vars/main.yml [deleted file]
ch13/ansible/roles/mezzanine/.travis.yml [deleted file]
ch13/ansible/roles/mezzanine/README.md [deleted file]
ch13/ansible/roles/mezzanine/defaults/main.yml [deleted file]
ch13/ansible/roles/mezzanine/files/entrypoint.sh [deleted file]
ch13/ansible/roles/mezzanine/files/setadmin.py [deleted file]
ch13/ansible/roles/mezzanine/files/setsite.py [deleted file]
ch13/ansible/roles/mezzanine/files/wait_for_db.py [deleted file]
ch13/ansible/roles/mezzanine/handlers/main.yml [deleted file]
ch13/ansible/roles/mezzanine/meta/main.yml [deleted file]
ch13/ansible/roles/mezzanine/tasks/main.yml [deleted file]
ch13/ansible/roles/mezzanine/tests/inventory [deleted file]
ch13/ansible/roles/mezzanine/tests/test.yml [deleted file]
ch13/ansible/roles/mezzanine/vars/main.yml [deleted file]
ch13/ansible/roles/nginx/.travis.yml [deleted file]
ch13/ansible/roles/nginx/README.md [deleted file]
ch13/ansible/roles/nginx/defaults/main.yml [deleted file]
ch13/ansible/roles/nginx/files/nginx.conf [deleted file]
ch13/ansible/roles/nginx/handlers/main.yml [deleted file]
ch13/ansible/roles/nginx/meta/main.yml [deleted file]
ch13/ansible/roles/nginx/tasks/main.yml [deleted file]
ch13/ansible/roles/nginx/tests/inventory [deleted file]
ch13/ansible/roles/nginx/tests/test.yml [deleted file]
ch13/ansible/roles/nginx/vars/main.yml [deleted file]

diff --git a/ch13/ansible/ansible.cfg b/ch13/ansible/ansible.cfg
deleted file mode 100644 (file)
index 460145a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# Set any ansible.cfg overrides in this file.
-# See: https://docs.ansible.com/ansible/intro_configuration.html#explanation-of-values-by-section
diff --git a/ch13/ansible/container.yml b/ch13/ansible/container.yml
deleted file mode 100644 (file)
index 0738bc8..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-version: "2"
-defaults:
-  DATABASE_NAME: mezzanine
-  DATABASE_USER: mezzanine
-  DATABASE_PASSWORD: mezzanine
-  ADMIN_PASSWORD: mezzanine
-
-services:
-  memcached:
-    image: ubuntu:xenial
-    expose:
-      - "11211"
-    entrypoint: [memcached]
-    command: ["-m", "128"]
-    user: daemon
-  nginx:
-    image: nginx:1.11
-    command: ["nginx", "-g", "daemon off;"]
-    expose:
-      - "80"
-      - "443"
-    dev_overrides:
-      links:
-        - mezzanine
-      volumes:
-        - ${PWD}/certs:/certs
-      volumes_from:
-        - mezzanine
-      ports:
-        - "8080:80"
-        - "8443:443"
-  mezzanine:
-    image: ubuntu:xenial
-    entrypoint: [/srv/bin/entrypoint.sh]
-    command: [/usr/local/bin/gunicorn, '-b', '0.0.0.0:8000', 'mezzanine_example.wsgi:application']
-    working_dir: /srv/project
-    expose:
-      - "8000"
-    dev_overrides:
-      links:
-        - postgres
-        - memcached
-      depends_on:
-        - postgres
-        - memcached
-      environment:
-        SECRET_KEY: dummysecretkey
-        PROJECT_DIR: /srv/project
-        PROJECT_APP: mezzanine_example
-        WEBSITE_DOMAIN: localhost
-        ADMIN_PASSWORD: "{{ ADMIN_PASSWORD }}"
-        DATABASE_NAME: "{{ DATABASE_NAME }}"
-        DATABASE_USER: "{{ DATABASE_USER }}"
-        DATABASE_PASSWORD: "{{ DATABASE_PASSWORD }}"
-      volumes:
-        - ${PWD}/static:/srv/project/static
-  postgres:
-    image: postgres:9.6
-    dev_overrides:
-      environment:
-        POSTGRES_DB: "{{ DATABASE_NAME }}"
-        POSTGRES_USER: "{{ DATABASE_USER }}"
-        POSTGRES_PASSWORD: "{{ DATABASE_PASSWORD }}"
-        PGDATA: /var/lib/postgresql/data/pgdata
-      volumes:
-        - ${PWD}/pgdata:/var/lib/postgresql/data/pgdata
-
diff --git a/ch13/ansible/main.yml b/ch13/ansible/main.yml
deleted file mode 100644 (file)
index fbcffb3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-- hosts: memcached
-  gather_facts: false
-  pre_tasks:
-    - name: update apt cache
-      raw: apt-get update
-    - name: install python
-      raw: apt-get -y install python
-  roles:
-    - memcached
-
-- hosts: mezzanine
-  gather_facts: false
-  pre_tasks:
-    - name: update apt cache
-      raw: apt-get update
-    - name: install python
-      raw: apt-get -y install python
-  roles:
-    - mezzanine
-
-- hosts: nginx
-  gather_facts: false
-  pre_tasks:
-    - name: update apt cache
-      raw: apt-get update
-    - name: install python
-      raw: apt-get -y install python
-  roles:
-    - nginx
diff --git a/ch13/ansible/meta.yml b/ch13/ansible/meta.yml
deleted file mode 100644 (file)
index 3ef38e4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-galaxy_info:
-  author: Your name
-  description: Describe your awesome application here.
-  company: Your company
-
-  # If the issue tracker for your role is not on GitHub, uncomment the
-  # next line and provide a value
-  # issue_tracker_url: 
-
-  # Some suggested licenses:
-  # - BSD (default)
-  # - MIT
-  # - GPLv2
-  # - GPLv3
-  # - Apache
-  # - CC-BY
-  license: license (GPLv2, CC-BY, etc)
-
-  min_ansible_container_version: 0.3.0-pre
-
-  # Optionally specify the branch Galaxy will use when accessing the GitHub
-  # repo for this role. During role install, if no tags are available,
-  # Galaxy will use this branch. During import Galaxy will access files on
-  # this branch. If travis integration is cofigured, only notification for this
-  # branch will be accepted. Otherwise, in all cases, the repo's default branch
-  # (usually master) will be used.
-  #github_branch:
-
-  tags: []
-    # List tags for your app here, one per line. A tag is a keyword that describes and categorizes the app.
-    # Users will find your app by searching for tags. Be sure to remove the '[]' above.
-    #
-    # NOTE: A tag is limited to a single word comprised of alphanumeric characters. Maximum 20 tags.
diff --git a/ch13/ansible/requirements.txt b/ch13/ansible/requirements.txt
deleted file mode 100644 (file)
index 854d21d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# These are the python requirements for your Ansible Container builder.
-# You do not need to include Ansible itself in this file.
-docker-py==1.10.6
\ No newline at end of file
diff --git a/ch13/ansible/requirements.yml b/ch13/ansible/requirements.yml
deleted file mode 100644 (file)
index fa5c693..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# Install Ansible Roles
-# ---------------------
-# When the build process starts `ansible-galaxy install -r requirements.yml` is executed
-# using this file. Follow the instructions at http://docs.ansible.com/ansible/galaxy.html
-# to include any roles you want intalled prior to running main.yml.
\ No newline at end of file
diff --git a/ch13/ansible/roles/memcached/.travis.yml b/ch13/ansible/roles/memcached/.travis.yml
deleted file mode 100644 (file)
index 36bbf62..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
----
-language: python
-python: "2.7"
-
-# Use the new container infrastructure
-sudo: false
-
-# Install ansible
-addons:
-  apt:
-    packages:
-    - python-pip
-
-install:
-  # Install ansible
-  - pip install ansible
-
-  # Check ansible version
-  - ansible --version
-
-  # Create ansible.cfg with correct roles_path
-  - printf '[defaults]\nroles_path=../' >ansible.cfg
-
-script:
-  # Basic role syntax check
-  - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
-
-notifications:
-  webhooks: https://galaxy.ansible.com/api/v1/notifications/
\ No newline at end of file
diff --git a/ch13/ansible/roles/memcached/README.md b/ch13/ansible/roles/memcached/README.md
deleted file mode 100644 (file)
index 225dd44..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Role Name
-=========
-
-A brief description of the role goes here.
-
-Requirements
-------------
-
-Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
-
-Role Variables
---------------
-
-A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
-
-Dependencies
-------------
-
-A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
-
-Example Playbook
-----------------
-
-Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
-
-    - hosts: servers
-      roles:
-         - { role: username.rolename, x: 42 }
-
-License
--------
-
-BSD
-
-Author Information
-------------------
-
-An optional section for the role authors to include contact information, or a website (HTML is not allowed).
diff --git a/ch13/ansible/roles/memcached/defaults/main.yml b/ch13/ansible/roles/memcached/defaults/main.yml
deleted file mode 100644 (file)
index 9a0b583..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# defaults file for memcached
diff --git a/ch13/ansible/roles/memcached/handlers/main.yml b/ch13/ansible/roles/memcached/handlers/main.yml
deleted file mode 100644 (file)
index 5a7ef56..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# handlers file for memcached
diff --git a/ch13/ansible/roles/memcached/meta/main.yml b/ch13/ansible/roles/memcached/meta/main.yml
deleted file mode 100644 (file)
index 2e1a914..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-galaxy_info:
-  author: your name
-  description: your description
-  company: your company (optional)
-
-  # If the issue tracker for your role is not on github, uncomment the
-  # next line and provide a value
-  # issue_tracker_url: http://example.com/issue/tracker
-
-  # Some suggested licenses:
-  # - BSD (default)
-  # - MIT
-  # - GPLv2
-  # - GPLv3
-  # - Apache
-  # - CC-BY
-  license: license (GPLv2, CC-BY, etc)
-
-  min_ansible_version: 1.2
-
-  # Optionally specify the branch Galaxy will use when accessing the GitHub
-  # repo for this role. During role install, if no tags are available,
-  # Galaxy will use this branch. During import Galaxy will access files on
-  # this branch. If travis integration is cofigured, only notification for this
-  # branch will be accepted. Otherwise, in all cases, the repo's default branch
-  # (usually master) will be used.
-  #github_branch:
-
-  #
-  # Below are all platforms currently available. Just uncomment
-  # the ones that apply to your role. If you don't see your
-  # platform on this list, let us know and we'll get it added!
-  #
-  #platforms:
-  #- name: OpenBSD
-  #  versions:
-  #  - all
-  #  - 5.6
-  #  - 5.7
-  #  - 5.8
-  #  - 5.9
-  #  - 6.0
-  #- name: Fedora
-  #  versions:
-  #  - all
-  #  - 16
-  #  - 17
-  #  - 18
-  #  - 19
-  #  - 20
-  #  - 21
-  #  - 22
-  #  - 23
-  #  - 24
-  #  - 25
-  #- name: DellOS
-  #  versions:
-  #  - all
-  #  - 10
-  #  - 6
-  #  - 9
-  #- name: MacOSX
-  #  versions:
-  #  - all
-  #  - 10.10
-  #  - 10.11
-  #  - 10.12
-  #  - 10.7
-  #  - 10.8
-  #  - 10.9
-  #- name: Synology
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Junos
-  #  versions:
-  #  - all
-  #  - any
-  #- name: GenericBSD
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Void Linux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: GenericLinux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: NXOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: IOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Amazon
-  #  versions:
-  #  - all
-  #  - 2013.03
-  #  - 2013.09
-  #  - 2016.03
-  #  - 2016.09
-  #- name: ArchLinux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: FreeBSD
-  #  versions:
-  #  - all
-  #  - 10.0
-  #  - 10.1
-  #  - 10.2
-  #  - 10.3
-  #  - 11.0
-  #  - 8.0
-  #  - 8.1
-  #  - 8.2
-  #  - 8.3
-  #  - 8.4
-  #  - 9.0
-  #  - 9.1
-  #  - 9.1
-  #  - 9.2
-  #  - 9.3
-  #- name: Ubuntu
-  #  versions:
-  #  - all
-  #  - lucid
-  #  - maverick
-  #  - natty
-  #  - oneiric
-  #  - precise
-  #  - quantal
-  #  - raring
-  #  - saucy
-  #  - trusty
-  #  - utopic
-  #  - vivid
-  #  - wily
-  #  - xenial
-  #  - yakkety
-  #- name: Debian
-  #  versions:
-  #  - all
-  #  - etch
-  #  - jessie
-  #  - lenny
-  #  - sid
-  #  - squeeze
-  #  - stretch
-  #  - wheezy
-  #- name: Alpine
-  #  versions:
-  #  - all
-  #  - any
-  #- name: EL
-  #  versions:
-  #  - all
-  #  - 5
-  #  - 6
-  #  - 7
-  #- name: Windows
-  #  versions:
-  #  - all
-  #  - 2012R2
-  #- name: SmartOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: opensuse
-  #  versions:
-  #  - all
-  #  - 12.1
-  #  - 12.2
-  #  - 12.3
-  #  - 13.1
-  #  - 13.2
-  #- name: SLES
-  #  versions:
-  #  - all
-  #  - 10SP3
-  #  - 10SP4
-  #  - 11
-  #  - 11SP1
-  #  - 11SP2
-  #  - 11SP3
-  #  - 11SP4
-  #  - 12
-  #  - 12SP1
-  #- name: GenericUNIX
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Solaris
-  #  versions:
-  #  - all
-  #  - 10
-  #  - 11.0
-  #  - 11.1
-  #  - 11.2
-  #  - 11.3
-  #- name: eos
-  #  versions:
-  #  - all
-  #  - Any
-
-  galaxy_tags: []
-    # List tags for your role here, one per line. A tag is
-    # a keyword that describes and categorizes the role.
-    # Users find roles by searching for tags. Be sure to
-    # remove the '[]' above if you add tags to this list.
-    #
-    # NOTE: A tag is limited to a single word comprised of
-    # alphanumeric characters. Maximum 20 tags per role.
-
-dependencies: []
-  # List your role dependencies here, one per line.
-  # Be sure to remove the '[]' above if you add dependencies
-  # to this list.
\ No newline at end of file
diff --git a/ch13/ansible/roles/memcached/tasks/main.yml b/ch13/ansible/roles/memcached/tasks/main.yml
deleted file mode 100644 (file)
index 3305c86..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
----
-- name: install memcached package
-  apt: name=memcached
diff --git a/ch13/ansible/roles/memcached/tests/inventory b/ch13/ansible/roles/memcached/tests/inventory
deleted file mode 100644 (file)
index d18580b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-localhost
\ No newline at end of file
diff --git a/ch13/ansible/roles/memcached/tests/test.yml b/ch13/ansible/roles/memcached/tests/test.yml
deleted file mode 100644 (file)
index 4a4114a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- hosts: localhost
-  remote_user: root
-  roles:
-    - memcached
\ No newline at end of file
diff --git a/ch13/ansible/roles/memcached/vars/main.yml b/ch13/ansible/roles/memcached/vars/main.yml
deleted file mode 100644 (file)
index 15d4e91..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# vars file for memcached
diff --git a/ch13/ansible/roles/mezzanine/.travis.yml b/ch13/ansible/roles/mezzanine/.travis.yml
deleted file mode 100644 (file)
index 36bbf62..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
----
-language: python
-python: "2.7"
-
-# Use the new container infrastructure
-sudo: false
-
-# Install ansible
-addons:
-  apt:
-    packages:
-    - python-pip
-
-install:
-  # Install ansible
-  - pip install ansible
-
-  # Check ansible version
-  - ansible --version
-
-  # Create ansible.cfg with correct roles_path
-  - printf '[defaults]\nroles_path=../' >ansible.cfg
-
-script:
-  # Basic role syntax check
-  - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
-
-notifications:
-  webhooks: https://galaxy.ansible.com/api/v1/notifications/
\ No newline at end of file
diff --git a/ch13/ansible/roles/mezzanine/README.md b/ch13/ansible/roles/mezzanine/README.md
deleted file mode 100644 (file)
index 225dd44..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Role Name
-=========
-
-A brief description of the role goes here.
-
-Requirements
-------------
-
-Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
-
-Role Variables
---------------
-
-A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
-
-Dependencies
-------------
-
-A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
-
-Example Playbook
-----------------
-
-Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
-
-    - hosts: servers
-      roles:
-         - { role: username.rolename, x: 42 }
-
-License
--------
-
-BSD
-
-Author Information
-------------------
-
-An optional section for the role authors to include contact information, or a website (HTML is not allowed).
diff --git a/ch13/ansible/roles/mezzanine/defaults/main.yml b/ch13/ansible/roles/mezzanine/defaults/main.yml
deleted file mode 100644 (file)
index acab180..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# defaults file for mezzanine
diff --git a/ch13/ansible/roles/mezzanine/files/entrypoint.sh b/ch13/ansible/roles/mezzanine/files/entrypoint.sh
deleted file mode 100644 (file)
index 96fec6c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Adapted from https://github.com/ansible/django-gulp-nginx
-# https://github.com/ansible/django-gulp-nginx/blob/master/ansible/roles/django-gunicorn/files/entrypoint.sh
-MANAGE=/srv/project/manage.py
-BINDIR=/srv/bin
-
-set -x
-
-if [[ $@ == *"gunicorn"* || $@ == *"runserver"* ]]; then
-       if [[ -f $MANAGE ]]; then
-        $BINDIR/wait_for_db.py
-        if [[ $? == 0 ]]; then
-            $MANAGE migrate --noinput
-            $MANAGE collectstatic --noinput
-            $BINDIR/setsite.py
-            $BINDIR/setadmin.py
-        fi
-       fi
-fi
-
-# Run the actual server
-exec "$@"
diff --git a/ch13/ansible/roles/mezzanine/files/setadmin.py b/ch13/ansible/roles/mezzanine/files/setadmin.py
deleted file mode 100644 (file)
index 4ddba5b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# A script to set the admin credentials
-# Assumes two environment variables
-#
-# PROJECT_DIR: the project directory (e.g., ~/projname)
-# PROJECT_APP: name of the project app
-# ADMIN_PASSWORD: admin user's password
-
-import os
-import sys
-
-# Add the project directory to system path
-proj_dir = os.path.expanduser(os.environ['PROJECT_DIR'])
-sys.path.append(proj_dir)
-
-proj_app = os.environ['PROJECT_APP']
-os.environ['DJANGO_SETTINGS_MODULE'] = proj_app + '.settings'
-import django
-django.setup()
-from django.contrib.auth import get_user_model
-User = get_user_model()
-u, _ = User.objects.get_or_create(username='admin')
-u.is_staff = u.is_superuser = True
-u.set_password(os.environ['ADMIN_PASSWORD'])
-u.save()
diff --git a/ch13/ansible/roles/mezzanine/files/setsite.py b/ch13/ansible/roles/mezzanine/files/setsite.py
deleted file mode 100644 (file)
index 83e3d8b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-# A script to set the site domain
-# Assumes two environment variables
-#
-# WEBSITE_DOMAIN: the domain of the site (e.g., www.example.com)
-# PROJECT_DIR: root directory of the project
-# PROJECT_APP: name of the project app
-import os
-import sys
-
-# Add the project directory to system path
-proj_dir = os.path.expanduser(os.environ['PROJECT_DIR'])
-sys.path.append(proj_dir)
-
-proj_app = os.environ['PROJECT_APP']
-os.environ['DJANGO_SETTINGS_MODULE'] = proj_app + '.settings'
-import django
-django.setup()
-from django.conf import settings
-from django.contrib.sites.models import Site
-domain = os.environ['WEBSITE_DOMAIN']
-Site.objects.filter(id=settings.SITE_ID).update(domain=domain)
-Site.objects.get_or_create(domain=domain)
diff --git a/ch13/ansible/roles/mezzanine/files/wait_for_db.py b/ch13/ansible/roles/mezzanine/files/wait_for_db.py
deleted file mode 100644 (file)
index ed80aec..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-import os
-import psycopg2
-import sys
-import time
-
-dbname = os.environ.get("DATABASE_NAME", "")
-user = os.environ.get("DATABASE_USER", "")
-password = os.environ.get("DATABASE_PASSWORD", "")
-host = os.environ.get("DATABASE_HOST", "postgres")
-port = int(os.environ.get("DATABASE_PORT", "5432"))
-
-attempts = 0
-max_attempts = 20
-
-while True:
-    try:
-        conn = psycopg2.connect(dbname=dbname, user=user, password=password, host=host, port=port)
-        # If we reach here, we're done
-        print("Connected to database {}".format(host))
-        sys.exit(0)
-    except Exception as e:
-        attempts += 1
-        if attempts > max_attempts:
-            print("Unable to connect to database")
-            print(e)
-            sys.exit(1)
-
-        time.sleep(3)
-
-
-
diff --git a/ch13/ansible/roles/mezzanine/handlers/main.yml b/ch13/ansible/roles/mezzanine/handlers/main.yml
deleted file mode 100644 (file)
index 910ac89..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# handlers file for mezzanine
diff --git a/ch13/ansible/roles/mezzanine/meta/main.yml b/ch13/ansible/roles/mezzanine/meta/main.yml
deleted file mode 100644 (file)
index 2e1a914..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-galaxy_info:
-  author: your name
-  description: your description
-  company: your company (optional)
-
-  # If the issue tracker for your role is not on github, uncomment the
-  # next line and provide a value
-  # issue_tracker_url: http://example.com/issue/tracker
-
-  # Some suggested licenses:
-  # - BSD (default)
-  # - MIT
-  # - GPLv2
-  # - GPLv3
-  # - Apache
-  # - CC-BY
-  license: license (GPLv2, CC-BY, etc)
-
-  min_ansible_version: 1.2
-
-  # Optionally specify the branch Galaxy will use when accessing the GitHub
-  # repo for this role. During role install, if no tags are available,
-  # Galaxy will use this branch. During import Galaxy will access files on
-  # this branch. If travis integration is cofigured, only notification for this
-  # branch will be accepted. Otherwise, in all cases, the repo's default branch
-  # (usually master) will be used.
-  #github_branch:
-
-  #
-  # Below are all platforms currently available. Just uncomment
-  # the ones that apply to your role. If you don't see your
-  # platform on this list, let us know and we'll get it added!
-  #
-  #platforms:
-  #- name: OpenBSD
-  #  versions:
-  #  - all
-  #  - 5.6
-  #  - 5.7
-  #  - 5.8
-  #  - 5.9
-  #  - 6.0
-  #- name: Fedora
-  #  versions:
-  #  - all
-  #  - 16
-  #  - 17
-  #  - 18
-  #  - 19
-  #  - 20
-  #  - 21
-  #  - 22
-  #  - 23
-  #  - 24
-  #  - 25
-  #- name: DellOS
-  #  versions:
-  #  - all
-  #  - 10
-  #  - 6
-  #  - 9
-  #- name: MacOSX
-  #  versions:
-  #  - all
-  #  - 10.10
-  #  - 10.11
-  #  - 10.12
-  #  - 10.7
-  #  - 10.8
-  #  - 10.9
-  #- name: Synology
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Junos
-  #  versions:
-  #  - all
-  #  - any
-  #- name: GenericBSD
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Void Linux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: GenericLinux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: NXOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: IOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Amazon
-  #  versions:
-  #  - all
-  #  - 2013.03
-  #  - 2013.09
-  #  - 2016.03
-  #  - 2016.09
-  #- name: ArchLinux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: FreeBSD
-  #  versions:
-  #  - all
-  #  - 10.0
-  #  - 10.1
-  #  - 10.2
-  #  - 10.3
-  #  - 11.0
-  #  - 8.0
-  #  - 8.1
-  #  - 8.2
-  #  - 8.3
-  #  - 8.4
-  #  - 9.0
-  #  - 9.1
-  #  - 9.1
-  #  - 9.2
-  #  - 9.3
-  #- name: Ubuntu
-  #  versions:
-  #  - all
-  #  - lucid
-  #  - maverick
-  #  - natty
-  #  - oneiric
-  #  - precise
-  #  - quantal
-  #  - raring
-  #  - saucy
-  #  - trusty
-  #  - utopic
-  #  - vivid
-  #  - wily
-  #  - xenial
-  #  - yakkety
-  #- name: Debian
-  #  versions:
-  #  - all
-  #  - etch
-  #  - jessie
-  #  - lenny
-  #  - sid
-  #  - squeeze
-  #  - stretch
-  #  - wheezy
-  #- name: Alpine
-  #  versions:
-  #  - all
-  #  - any
-  #- name: EL
-  #  versions:
-  #  - all
-  #  - 5
-  #  - 6
-  #  - 7
-  #- name: Windows
-  #  versions:
-  #  - all
-  #  - 2012R2
-  #- name: SmartOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: opensuse
-  #  versions:
-  #  - all
-  #  - 12.1
-  #  - 12.2
-  #  - 12.3
-  #  - 13.1
-  #  - 13.2
-  #- name: SLES
-  #  versions:
-  #  - all
-  #  - 10SP3
-  #  - 10SP4
-  #  - 11
-  #  - 11SP1
-  #  - 11SP2
-  #  - 11SP3
-  #  - 11SP4
-  #  - 12
-  #  - 12SP1
-  #- name: GenericUNIX
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Solaris
-  #  versions:
-  #  - all
-  #  - 10
-  #  - 11.0
-  #  - 11.1
-  #  - 11.2
-  #  - 11.3
-  #- name: eos
-  #  versions:
-  #  - all
-  #  - Any
-
-  galaxy_tags: []
-    # List tags for your role here, one per line. A tag is
-    # a keyword that describes and categorizes the role.
-    # Users find roles by searching for tags. Be sure to
-    # remove the '[]' above if you add tags to this list.
-    #
-    # NOTE: A tag is limited to a single word comprised of
-    # alphanumeric characters. Maximum 20 tags per role.
-
-dependencies: []
-  # List your role dependencies here, one per line.
-  # Be sure to remove the '[]' above if you add dependencies
-  # to this list.
\ No newline at end of file
diff --git a/ch13/ansible/roles/mezzanine/tasks/main.yml b/ch13/ansible/roles/mezzanine/tasks/main.yml
deleted file mode 100644 (file)
index cc35bc3..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
----
-- name: install apt packages
-  apt: pkg={{ item }}
-  with_items:
-    - libjpeg-dev
-    - libpq-dev
-    - python-dev
-    - python-pip
-    - python-psycopg2
-    - rsync
-- name: install pip packages
-  pip: name={{ item }}
-  with_items:
-    - gunicorn
-    - setproctitle
-    - psycopg2
-    - django-compressor
-    - python-memcached
-- name: copy project files
-  synchronize:
-    src: "{{ lookup('pipe', 'dirname `pwd`') }}/mezzanine_example/"
-    dest: /srv/project
-- name: install project requirements
-  pip: requirements=/srv/project/requirements.txt
-- name: create /srv/bin directory
-  file:
-    path: /srv/bin
-    state: directory
-- name: copy scripts
-  copy:
-    src: "{{ role_path }}/files/{{ item }}"
-    dest: "/srv/bin/{{ item }}"
-    mode: "u=rwx,g=rx,o=rx"
-  with_items:
-    - entrypoint.sh
-    - setsite.py
-    - setadmin.py
-    - wait_for_db.py
diff --git a/ch13/ansible/roles/mezzanine/tests/inventory b/ch13/ansible/roles/mezzanine/tests/inventory
deleted file mode 100644 (file)
index d18580b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-localhost
\ No newline at end of file
diff --git a/ch13/ansible/roles/mezzanine/tests/test.yml b/ch13/ansible/roles/mezzanine/tests/test.yml
deleted file mode 100644 (file)
index bd4fe2a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- hosts: localhost
-  remote_user: root
-  roles:
-    - mezzanine
\ No newline at end of file
diff --git a/ch13/ansible/roles/mezzanine/vars/main.yml b/ch13/ansible/roles/mezzanine/vars/main.yml
deleted file mode 100644 (file)
index ae6b679..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# vars file for mezzanine
diff --git a/ch13/ansible/roles/nginx/.travis.yml b/ch13/ansible/roles/nginx/.travis.yml
deleted file mode 100644 (file)
index 36bbf62..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
----
-language: python
-python: "2.7"
-
-# Use the new container infrastructure
-sudo: false
-
-# Install ansible
-addons:
-  apt:
-    packages:
-    - python-pip
-
-install:
-  # Install ansible
-  - pip install ansible
-
-  # Check ansible version
-  - ansible --version
-
-  # Create ansible.cfg with correct roles_path
-  - printf '[defaults]\nroles_path=../' >ansible.cfg
-
-script:
-  # Basic role syntax check
-  - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
-
-notifications:
-  webhooks: https://galaxy.ansible.com/api/v1/notifications/
\ No newline at end of file
diff --git a/ch13/ansible/roles/nginx/README.md b/ch13/ansible/roles/nginx/README.md
deleted file mode 100644 (file)
index 225dd44..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Role Name
-=========
-
-A brief description of the role goes here.
-
-Requirements
-------------
-
-Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
-
-Role Variables
---------------
-
-A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
-
-Dependencies
-------------
-
-A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
-
-Example Playbook
-----------------
-
-Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
-
-    - hosts: servers
-      roles:
-         - { role: username.rolename, x: 42 }
-
-License
--------
-
-BSD
-
-Author Information
-------------------
-
-An optional section for the role authors to include contact information, or a website (HTML is not allowed).
diff --git a/ch13/ansible/roles/nginx/defaults/main.yml b/ch13/ansible/roles/nginx/defaults/main.yml
deleted file mode 100644 (file)
index 78c8c76..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# defaults file for nginx
diff --git a/ch13/ansible/roles/nginx/files/nginx.conf b/ch13/ansible/roles/nginx/files/nginx.conf
deleted file mode 100644 (file)
index c58bebb..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-upstream mezzanine {
-    server mezzanine:8000;
-}
-
-server {
-
-    listen 80;
-
-    listen 443 ssl;
-
-    client_max_body_size 10M;
-    keepalive_timeout    15;
-
-    ssl_certificate      /certs/nginx.crt;
-    ssl_certificate_key  /certs/nginx.key;
-    ssl_session_cache    shared:SSL:10m;
-    ssl_session_timeout  10m;
-    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK;
-    ssl_prefer_server_ciphers on;
-
-    location / {
-        proxy_redirect      off;
-        proxy_set_header    Host                    $host;
-        proxy_set_header    X-Real-IP               $remote_addr;
-        proxy_set_header    X-Forwarded-For         $proxy_add_x_forwarded_for;
-        proxy_set_header    X-Forwarded-Protocol    $scheme;
-        proxy_pass          http://mezzanine;
-    }
-
-    location /static/ {
-        root            /srv/project;
-        access_log      off;
-        log_not_found   off;
-    }
-
-    location /robots.txt {
-        root            /srv/project/static;
-        access_log      off;
-        log_not_found   off;
-    }
-
-    location /favicon.ico {
-        root            /srv/project/static/img;
-        access_log      off;
-        log_not_found   off;
-    }
-}
diff --git a/ch13/ansible/roles/nginx/handlers/main.yml b/ch13/ansible/roles/nginx/handlers/main.yml
deleted file mode 100644 (file)
index ad79151..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# handlers file for nginx
diff --git a/ch13/ansible/roles/nginx/meta/main.yml b/ch13/ansible/roles/nginx/meta/main.yml
deleted file mode 100644 (file)
index 2e1a914..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-galaxy_info:
-  author: your name
-  description: your description
-  company: your company (optional)
-
-  # If the issue tracker for your role is not on github, uncomment the
-  # next line and provide a value
-  # issue_tracker_url: http://example.com/issue/tracker
-
-  # Some suggested licenses:
-  # - BSD (default)
-  # - MIT
-  # - GPLv2
-  # - GPLv3
-  # - Apache
-  # - CC-BY
-  license: license (GPLv2, CC-BY, etc)
-
-  min_ansible_version: 1.2
-
-  # Optionally specify the branch Galaxy will use when accessing the GitHub
-  # repo for this role. During role install, if no tags are available,
-  # Galaxy will use this branch. During import Galaxy will access files on
-  # this branch. If travis integration is cofigured, only notification for this
-  # branch will be accepted. Otherwise, in all cases, the repo's default branch
-  # (usually master) will be used.
-  #github_branch:
-
-  #
-  # Below are all platforms currently available. Just uncomment
-  # the ones that apply to your role. If you don't see your
-  # platform on this list, let us know and we'll get it added!
-  #
-  #platforms:
-  #- name: OpenBSD
-  #  versions:
-  #  - all
-  #  - 5.6
-  #  - 5.7
-  #  - 5.8
-  #  - 5.9
-  #  - 6.0
-  #- name: Fedora
-  #  versions:
-  #  - all
-  #  - 16
-  #  - 17
-  #  - 18
-  #  - 19
-  #  - 20
-  #  - 21
-  #  - 22
-  #  - 23
-  #  - 24
-  #  - 25
-  #- name: DellOS
-  #  versions:
-  #  - all
-  #  - 10
-  #  - 6
-  #  - 9
-  #- name: MacOSX
-  #  versions:
-  #  - all
-  #  - 10.10
-  #  - 10.11
-  #  - 10.12
-  #  - 10.7
-  #  - 10.8
-  #  - 10.9
-  #- name: Synology
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Junos
-  #  versions:
-  #  - all
-  #  - any
-  #- name: GenericBSD
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Void Linux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: GenericLinux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: NXOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: IOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Amazon
-  #  versions:
-  #  - all
-  #  - 2013.03
-  #  - 2013.09
-  #  - 2016.03
-  #  - 2016.09
-  #- name: ArchLinux
-  #  versions:
-  #  - all
-  #  - any
-  #- name: FreeBSD
-  #  versions:
-  #  - all
-  #  - 10.0
-  #  - 10.1
-  #  - 10.2
-  #  - 10.3
-  #  - 11.0
-  #  - 8.0
-  #  - 8.1
-  #  - 8.2
-  #  - 8.3
-  #  - 8.4
-  #  - 9.0
-  #  - 9.1
-  #  - 9.1
-  #  - 9.2
-  #  - 9.3
-  #- name: Ubuntu
-  #  versions:
-  #  - all
-  #  - lucid
-  #  - maverick
-  #  - natty
-  #  - oneiric
-  #  - precise
-  #  - quantal
-  #  - raring
-  #  - saucy
-  #  - trusty
-  #  - utopic
-  #  - vivid
-  #  - wily
-  #  - xenial
-  #  - yakkety
-  #- name: Debian
-  #  versions:
-  #  - all
-  #  - etch
-  #  - jessie
-  #  - lenny
-  #  - sid
-  #  - squeeze
-  #  - stretch
-  #  - wheezy
-  #- name: Alpine
-  #  versions:
-  #  - all
-  #  - any
-  #- name: EL
-  #  versions:
-  #  - all
-  #  - 5
-  #  - 6
-  #  - 7
-  #- name: Windows
-  #  versions:
-  #  - all
-  #  - 2012R2
-  #- name: SmartOS
-  #  versions:
-  #  - all
-  #  - any
-  #- name: opensuse
-  #  versions:
-  #  - all
-  #  - 12.1
-  #  - 12.2
-  #  - 12.3
-  #  - 13.1
-  #  - 13.2
-  #- name: SLES
-  #  versions:
-  #  - all
-  #  - 10SP3
-  #  - 10SP4
-  #  - 11
-  #  - 11SP1
-  #  - 11SP2
-  #  - 11SP3
-  #  - 11SP4
-  #  - 12
-  #  - 12SP1
-  #- name: GenericUNIX
-  #  versions:
-  #  - all
-  #  - any
-  #- name: Solaris
-  #  versions:
-  #  - all
-  #  - 10
-  #  - 11.0
-  #  - 11.1
-  #  - 11.2
-  #  - 11.3
-  #- name: eos
-  #  versions:
-  #  - all
-  #  - Any
-
-  galaxy_tags: []
-    # List tags for your role here, one per line. A tag is
-    # a keyword that describes and categorizes the role.
-    # Users find roles by searching for tags. Be sure to
-    # remove the '[]' above if you add tags to this list.
-    #
-    # NOTE: A tag is limited to a single word comprised of
-    # alphanumeric characters. Maximum 20 tags per role.
-
-dependencies: []
-  # List your role dependencies here, one per line.
-  # Be sure to remove the '[]' above if you add dependencies
-  # to this list.
\ No newline at end of file
diff --git a/ch13/ansible/roles/nginx/tasks/main.yml b/ch13/ansible/roles/nginx/tasks/main.yml
deleted file mode 100644 (file)
index 7a246c2..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
----
-- name: remove default config files
-  file: path={{ item }} state=absent
-  with_items:
-    - /etc/nginx/conf.d/default.conf
-    - /etc/nginx/conf.d/example_ssl.conf
-- name: add mezzanine config
-  copy: src=nginx.conf dest=/etc/nginx/conf.d/mezzanine.conf
diff --git a/ch13/ansible/roles/nginx/tests/inventory b/ch13/ansible/roles/nginx/tests/inventory
deleted file mode 100644 (file)
index d18580b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-localhost
\ No newline at end of file
diff --git a/ch13/ansible/roles/nginx/tests/test.yml b/ch13/ansible/roles/nginx/tests/test.yml
deleted file mode 100644 (file)
index 3055ba5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- hosts: localhost
-  remote_user: root
-  roles:
-    - nginx
\ No newline at end of file
diff --git a/ch13/ansible/roles/nginx/vars/main.yml b/ch13/ansible/roles/nginx/vars/main.yml
deleted file mode 100644 (file)
index d45faf6..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
----
-# vars file for nginx