Files @ 3ec086a76011
Branch filter:

Location: majic-ansible-roles/roles/wsgi_website/molecule/default/playbook.yml - annotation

branko
MAR-159: Updated role reference documentation and release notes.
b68d19ad38a3
b68d19ad38a3
a1e0221d24e7
b5ed796b566a
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
80299693b896
b68d19ad38a3
b68d19ad38a3
80299693b896
80299693b896
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
80299693b896
80299693b896
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
80299693b896
80299693b896
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b5ed796b566a
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b7de8e615ffd
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b5ed796b566a
b68d19ad38a3
0bfda9b0c3fe
0bfda9b0c3fe
eba5d5d69e4f
eba5d5d69e4f
0bfda9b0c3fe
0bfda9b0c3fe
0bfda9b0c3fe
0bfda9b0c3fe
0bfda9b0c3fe
0bfda9b0c3fe
0bfda9b0c3fe
b68d19ad38a3
b68d19ad38a3
19f5f9cab189
19f5f9cab189
19f5f9cab189
c8d4251a6ea5
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b5ed796b566a
998aab91d6b4
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
998aab91d6b4
998aab91d6b4
19f5f9cab189
19f5f9cab189
80299693b896
80299693b896
b68d19ad38a3
a1e0221d24e7
b5ed796b566a
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
b68d19ad38a3
---

- hosts: wsgi-website
  become: true
  vars:
    # common
    ca_certificates:
      testca: "{{ lookup('file', 'tests/data/x509/ca/level1.cert.pem') }}"

    # web_server
    default_https_tls_certificate: "{{ lookup('file', 'tests/data/x509/server/wsgi-website_https.cert.pem') }}"
    default_https_tls_key: "{{ lookup('file', 'tests/data/x509/server/wsgi-website_https.key.pem') }}"

  roles:
    - role: wsgi_website
      fqdn: parameters-mandatory
      https_tls_certificate: "{{ lookup('file', 'tests/data/x509/server/parameters-mandatory_https.cert.pem') }}"
      https_tls_key: "{{ lookup('file', 'tests/data/x509/server/parameters-mandatory_https.key.pem') }}"
      wsgi_application: testapp:application

    - role: wsgi_website
      fqdn: parameters-optional.local
      https_tls_certificate: "{{ lookup('file', 'tests/data/x509/server/parameters-optional.local_https.cert.pem') }}"
      https_tls_key: "{{ lookup('file', 'tests/data/x509/server/parameters-optional.local_https.key.pem') }}"
      additional_nginx_config:
        - comment: Custom missing page.
          value: error_page 404 /my/own/error/page;
      admin_uid: 5000
      enforce_https: false
      environment_indicator:
        background_colour: "#ff0000"
        text_colour: "#00ff00"
        text: "parameters-optional"
      environment_variables:
        MY_ENV_VAR: "My environment variable"
      packages:
        - "libmariadbclient-dev-compat"
        - global
      proxy_headers:
        Accept-Encoding: '""'
      rewrites:
        - '^/rewrite1/(.*) /rewritten1/ last'
        - '^/rewrite2/(.*) /rewritten2/$1 last'
      static_locations:
        - /static/
        - /media/
      uid: 5001
      use_paste: false
      virtualenv_packages:
        # Main packages.
        - dnspython==1.15.0
        - ptpython==0.41
        - prompt-toolkit==1.0.15
        # Dependencies.
        - docopt==0.6.2
        - jedi==0.13.1
        - parso==0.3.1
        - Pygments==2.2.0
        - six==1.11.0
        - wcwidth==0.1.7
      website_mail_recipients: user
      wsgi_application: testapp:application
      wsgi_requirements:
        - futures==3.1.1
        - gunicorn==20.0.4
      python_version: 3

    - role: wsgi_website
      fqdn: parameters-paste-req
      use_paste: true
      virtualenv_packages:
        - click==6.7
        - Flask==0.12.2
        - itsdangerous==0.24
        - Jinja2==2.9.6
        - MarkupSafe==1.0
        - Paste==2.0.3
        - PasteDeploy==1.5.2
        - PasteScript==2.0.2
        - six==1.10.0
        - Werkzeug==0.12.2
      wsgi_application: config.ini
      wsgi_requirements:
        - futures==3.1.1
        - gunicorn==19.8.1
      https_tls_certificate: "{{ lookup('file', 'tests/data/x509/server/parameters-paste-req_https.cert.pem') }}"
      https_tls_key: "{{ lookup('file', 'tests/data/x509/server/parameters-paste-req_https.key.pem') }}"

- hosts: wsgi-website
  become: true
  tasks:
    # parameters-mandatory application
    - name: Set-up directories where application files are hosted at
      file:
        path: "/var/www/parameters-mandatory/{{ item }}"
        state: directory
        owner: admin-parameters-mandatory
        group: web-parameters-mandatory
        mode: 02750
      with_items:
        - htdocs/static
        - htdocs/media
        - code
    - name: Deploy WSGI application
      copy:
        src: "tests/data/python/wsgi/testapp.py"
        dest: "/var/www/parameters-mandatory/code/testapp.py"
        owner: admin-parameters-mandatory
        group: web-parameters-mandatory
        mode: 0640
      notify:
        - Restart parameters-mandatory
    - name: Deploy a static file
      copy:
        src: "tests/data/static_file.txt"
        dest: "/var/www/parameters-mandatory/htdocs/static/static_file.txt"
        owner: admin-parameters-mandatory
        group: web-parameters-mandatory
        mode: 0640
    - name: Deploy a media file
      copy:
        src: "tests/data/media_file.txt"
        dest: "/var/www/parameters-mandatory/htdocs/media/media_file.txt"
        owner: admin-parameters-mandatory
        group: web-parameters-mandatory
        mode: 0640

    # parameters-optional application
    - name: Set-up directories where application files are hosted at
      file:
        path: "/var/www/parameters-optional.local/{{ item }}"
        state: directory
        owner: admin-parameters-optional_local
        group: web-parameters-optional_local
        mode: 02750
      with_items:
        - htdocs/static
        - htdocs/media
        - code
    - name: Deploy WSGI application
      copy:
        src: "tests/data/python/wsgi/testapp.py"
        dest: "/var/www/parameters-optional.local/code/testapp.py"
        owner: admin-parameters-optional_local
        group: web-parameters-optional_local
        mode: 0640
      notify:
        - Restart parameters-optional.local
    - name: Deploy a static file
      copy:
        src: "tests/data/static_file.txt"
        dest: "/var/www/parameters-optional.local/htdocs/static/static_file.txt"
        owner: admin-parameters-optional_local
        group: web-parameters-optional_local
        mode: 0640
    - name: Deploy a media file
      copy:
        src: "tests/data/media_file.txt"
        dest: "/var/www/parameters-optional.local/htdocs/media/media_file.txt"
        owner: admin-parameters-optional_local
        group: web-parameters-optional_local
        mode: 0640

    # parameters-paste-req application
    - name: Set-up directories where application files are hosted at
      file:
        path: "/var/www/parameters-paste-req/{{ item }}"
        state: directory
        owner: admin-parameters-paste-req
        group: web-parameters-paste-req
        mode: 02750
      with_items:
        - htdocs/static
        - htdocs/media
        - code
    - name: Deploy WSGI application
      copy:
        src: "tests/data/python/paste/{{ item }}"
        dest: "/var/www/parameters-paste-req/code/{{ item }}"
        owner: admin-parameters-paste-req
        group: web-parameters-paste-req
        mode: 0640
      with_items:
        - config.ini
        - testapp.py
        - wsgi.py
      notify:
        - Restart parameters-paste-req
    - name: Deploy a static file
      copy:
        src: "tests/data/static_file.txt"
        dest: "/var/www/parameters-paste-req/htdocs/static/static_file.txt"
        owner: admin-parameters-paste-req
        group: web-parameters-paste-req
        mode: 0640
    - name: Deploy a media file
      copy:
        src: "tests/data/media_file.txt"
        dest: "/var/www/parameters-paste-req/htdocs/media/media_file.txt"
        owner: admin-parameters-paste-req
        group: web-parameters-paste-req
        mode: 0640

  handlers:
    - name: Restart parameters-mandatory
      service:
        name: parameters-mandatory
        state: restarted
    - name: Restart parameters-optional.local
      service:
        name: parameters-optional.local
        state: restarted
    - name: Restart parameters-paste-req
      service:
        name: parameters-paste-req
        state: restarted