diff --git a/.gitignore b/.gitignore index f15f427..c1aaee5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,9 +3,6 @@ *.pyd *.egg-info/ __pycache__/ -.*/ +.* dist/ build/ - -# test artifacts -.env.yml diff --git a/README.rst b/README.rst index 0115ac1..a0c939f 100644 --- a/README.rst +++ b/README.rst @@ -43,7 +43,7 @@ Installation ============ The ``molecule-proxmox`` plugin may be installed with Python ``pip``. A virtualenv -is recommended. The following commands install Anisble, Molecule, and the +is recommended. The following commands install Ansible, Molecule, and the Molecule Proxmox plugin in a virtualenv called ``venv``. .. code-block:: bash @@ -107,6 +107,42 @@ Example - name: test02 template_vmid: 9000 +Development +=========== + +To checkout the source code: + + $ git clone https://github.com/meffie/molecule-proxmox + $ cd molecule-proxmox + +A `Makefile` is provided to facilitate development and testing. A Python +virtualenv environment may be created with the `init` target. + + $ make init + $ source .venv/bin/activate + +Export the following shell environment variables to run the unit tests. + + export PROXMOX_SECRETS= + export PROXMOX_NODE= + export PROXMOX_SSH_USER= + export PROXMOX_SSH_IDENTITY_FILE= + +The secrets file should contain the proxmox login credentials, either the +username and password, or a Proxmox API token id and value. This file should +be encrypted with `ansible-vault`. The ssh user and identity file should match +the user and public key installed when the virtual machine template was +created. + +To run the unit tests in verbose mode: + + $ make test + +To run the unit tests in quiet mode: + + $ make check + + Authors ======= diff --git a/tests/proxmox_driver/molecule/default/molecule.yml b/tests/proxmox_driver/molecule/default/molecule.yml index 599275d..17ccfdb 100644 --- a/tests/proxmox_driver/molecule/default/molecule.yml +++ b/tests/proxmox_driver/molecule/default/molecule.yml @@ -5,25 +5,23 @@ driver: name: proxmox options: # Creds file path. May be encrypted with ansible-vault. - proxmox_secrets: "${HOME}/proxmox_secrets.yml" + proxmox_secrets: "${PROXMOX_SECRETS}" #api_host: "*********" #api_user: "*********" #api_password: "********" #api_token_id: "********" #api_token_secret: "*******************************" - node: "morty" - ssh_user: "molecule" - ssh_identity_file: "${HOME}/.ssh/id_rsa" + node: "${PROXMOX_NODE}" + ssh_user: "${PROXMOX_SSH_USER}" + ssh_identity_file: "${PROXMOX_SSH_IDENTITY_FILE}" clone_delay: 2 - box2vmid: - "generic/alma8": 9000 platforms: - name: m01 template_vmid: 9000 - - name: m02 - template_vmid: 9000 - - name: m03 - box: generic/alma8 + #- name: m02 + # template_vmid: 9000 + #- name: m03 + # box: generic/alma8 provisioner: name: ansible