image-serve

image-serve

Role Documentation

Welcome to the “image-serve” role documentation.

Role Variables: main.yml

metadata:
  description: Verify that image-serve service is ready
  groups:
  - pre-upgrade
  - post-deployment
  - post-upgrade
  name: Image-serve availability

Molecule Scenarios

Molecule is being used to test the “image-serve” role. The following section highlights the drivers in service and provides an example playbook showing how the role is leveraged.

Scenario: default

Example default configuration
driver:
  name: docker
lint:
  enabled: false
log: true
platforms:
- command: python -m SimpleHTTPServer 8787
  easy_install:
  - pip
  environment:
    http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
    https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
  hostname: centos7
  image: centos:7
  name: centos7
  override_command: true
  pkg_extras: python-setuptools python-enum34 python-netaddr epel-release ruby
- command: python3 -m http.server 8787
  environment:
    http_proxy: '{{ lookup(''env'', ''http_proxy'') }}'
    https_proxy: '{{ lookup(''env'', ''https_proxy'') }}'
  hostname: fedora28
  image: fedora:28
  name: fedora28
  override_command: true
  pkg_extras: python*-setuptools python*-enum python*-netaddr ruby
provisioner:
  env:
    ANSIBLE_LIBRARY: ../../../../library
    ANSIBLE_STDOUT_CALLBACK: yaml
  log: true
  name: ansible
scenario:
  test_sequence:
  - destroy
  - create
  - prepare
  - converge
  - verify
  - destroy
verifier:
  lint:
    name: flake8
  name: testinfra
Example default playbook
- gather_facts: false
  hosts: all
  name: Converge
  tasks:
  - block:
    - include_role:
        name: image-serve
      name: run validation for wrong port
      vars:
        container_registry_port: 9999
    name: detect wrong port
    rescue:
    - meta: clear_host_errors
      name: Clear host errors
    - debug:
        msg: Detected faulty port!
      name: Status message
  - block:
    - include_role:
        name: image-serve
      name: run validation for 404
    name: Ensure we detect faulty tree
    rescue:
    - meta: clear_host_errors
      name: Clear host errors
    - debug:
        msg: Detected faulty image serve tree!
      name: Status message
    - meta: end_play
      name: End play
  - fail:
      msg: 'The image-serve role should have detected httpd wasn''t running or

        index.json is absent.

        '
    name: Fail the test
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.