oasis_roles.molecule_openstack_ci

This Role is No Longer Supported: Please use the version in the oasis_roles.system Ansible Collection

Build Status

molecule_openstack_ci

This role is used to create and delete OpenStack resources for running Molecule in a shared CI environment. It adds a combination of the Molecule role name, the current scenario, and the executing user to generated resources to avoid name clashes when two users are testing the same role scenario at the same time.

Requirements

  • Ansible version 2.4 or higher
  • Red Hat Enterprise Linux 7 or similar
  • Valid Red Hat subscriptions

Role Variables

The following variables can be set:

General

  • molecule_openstack_ci_ssh_user - The username to log in to the created instance; defaults to "cloud-user".
  • molecule_openstack_ci_ssh_port - The SSH port to connect to the instance; defaults to 22.
  • molecule_openstack_ci_security_group_name - The prefix for the security group name; defaults to "molecule". The actual created security groups will have a unique identifier added to their name.
  • molecule_openstack_ci_security_group_description - The description for the security group; defaults to "Security group for testing Molecule".
  • molecule_openstack_ci_security_group_rules - A list of rules for the security group, which by default allows all access to Molecule instances.
  • molecule_openstack_ci_keypair_name - The prefix for the SSH key pair name; defaults to "molecule_key". The actual key pair will also have a unique identifier added to its name.
  • molecule_openstack_ci_cloud - The name of the OpenStack cloud to connect to; defaults to the environment variable "OS_CLOUD" if set, or "default" if not.
  • molecule_openstack_ci_state - Whether to create (present) or delete (absent) Molecule resources; defaults to present.

Dependencies

  • python-openstacksdk must be installed on the machine running Molecule, as the OpenStack configuration is loaded using the openstack.config module.

Example Playbooks

Molecule scenario create.yml:

- name: Create
  hosts: localhost
  connection: local
  gather_facts: false
  roles:
    - role: oasis_roles.molecule_openstack_ci
      # You can set other variables here, e.g.
      # molecule_openstack_ci_ssh_user: yourcloudusername

Molecule scenario destroy.yml:

- name: Destroy
  hosts: localhost
  connection: local
  gather_facts: false
  roles:
    - role: oasis_roles.molecule_openstack_ci
      molecule_openstack_ci_state: absent

Note: Don't forget to add oasis_roles.molecule_openstack_ci to your Molecule scenario dependencies.

License

GPLv3

Author Information

Sean Myers sean.myers@redhat.com

Informazioni sul progetto

Ansible role to manage the creation and destruction of openstack resources for running molecule in a shared CI environment.

Installa
ansible-galaxy install oasis_roles.molecule_openstack_ci
Licenza
gpl-3.0
Download
10.3k
Proprietario