{"id":20806154,"url":"https://github.com/meffie/molecule-proxmox","last_synced_at":"2025-04-07T07:01:39.637Z","repository":{"id":46242637,"uuid":"453309764","full_name":"meffie/molecule-proxmox","owner":"meffie","description":"Molecule driver for Proxmox VE","archived":false,"fork":false,"pushed_at":"2025-03-29T16:34:14.000Z","size":103,"stargazers_count":40,"open_issues_count":8,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-04T14:08:08.580Z","etag":null,"topics":["ansible","ansible-molecule","ansible-testing","molecule-driver","proxmox","proxmox-ve"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meffie.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-29T05:52:57.000Z","updated_at":"2025-03-25T18:49:00.000Z","dependencies_parsed_at":"2024-01-02T23:50:28.289Z","dependency_job_id":"3f77c8b3-1d3c-46dc-86e0-d81d19b9bd47","html_url":"https://github.com/meffie/molecule-proxmox","commit_stats":{"total_commits":48,"total_committers":1,"mean_commits":48.0,"dds":0.0,"last_synced_commit":"96de07e22c57118c3c99a39e0e6462ff59728117"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meffie%2Fmolecule-proxmox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meffie%2Fmolecule-proxmox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meffie%2Fmolecule-proxmox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meffie%2Fmolecule-proxmox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meffie","download_url":"https://codeload.github.com/meffie/molecule-proxmox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608150,"owners_count":20965952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-molecule","ansible-testing","molecule-driver","proxmox","proxmox-ve"],"created_at":"2024-11-17T19:18:20.889Z","updated_at":"2025-04-07T07:01:39.601Z","avatar_url":"https://github.com/meffie.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"***********************\nMolecule Proxmox Plugin\n***********************\n\nThis is an Ansible Molecule Driver plugin to manage instances on a\n`Proxmox VE`_ hypervisor cluster.  Only virtual machines are supported at this\ntime.\n\nRequirements\n============\n\n* Access to a `Proxmox VE`_ cluster\n* One or more virtual machine templates with required setup\n* Python package `proxmoxer`_\n* Ansible module `community.general.proxmox_kvm`_\n\nThe required Python packages are automatically installed when\n``molecule-proxmox`` is installed with ``pip``.\n\nThe ``proxmox_kvm`` module is included with the Community.General collection\nand is automatically installed when Ansible is installed with ``pip``.\n\n\nVirtual machine template requirements\n-------------------------------------\n\nThe molecule instances are created by cloning Proxmox virtual machine\ntemplates.  You will need to create one or more templates.\n\nTemplates have the following requirements.\n\n* A cloud-init drive if any cloud-init settings are used\n* networking configured\n* Python installed for Ansible\n* qemu-guest-agent installed and enabled in Proxmox\n* ssh server installed\n* user account for Ansible\n* An ssh public key must be added to the ``authorized_keys`` for the Ansible user account.\n* If a non-root user is used for the Ansible user (recommended), that user should be\n  added to the sudoers. (This is not needed for the driver, but will likely be needed\n  for the ``converge`` playbook.)\n\nInstallation\n============\n\nThe ``molecule-proxmox`` plugin may be installed with Python ``pip``. A virtualenv\nis recommended.  The following commands install Ansible, Molecule, and the\nMolecule Proxmox plugin in a virtualenv called ``venv``.\n\nPlease note that due to a recent change in molecule this plugin \nwill not work out of the box with molecule \u003e=25.2.0. \nTherefore you will have to pin the dependency to 25.1.0 or less, until #28 is merged.\n\n.. code-block:: bash\n\n    $ python3 -m venv venv\n    $ . venv/bin/activate\n    $ pip3 install ansible-core molecule==25.1.0 molecule-proxmox\n\nExamples\n========\n\n.. code-block:: yaml\n\n   driver:\n     name: molecule-proxmox\n     options:\n        api_host: \u003chostname\u003e        # e.g. pve01.example.com\n        api_user: \u003cname\u003e@\u003crealm\u003e    # e.g. root@pam\n        api_password: \"********\"\n        node: pve01\n        ssh_user: tester\n        ssh_port: 22022             # default to 22\n        ssh_identity_file: /path/to/id_rsa\n   platforms:\n     - name: test01\n       template_name: debian11\n     - name: test02\n       template_name: alma8\n\n.. code-block:: yaml\n\n   driver:\n     name: molecule-proxmox\n     options:\n        api_host: \u003chostname\u003e        # e.g. pve01.example.com\n        api_port: 18006             # custom proxmox port number\n        api_user: \u003cname\u003e@\u003crealm\u003e    # e.g. root@pam\n        # Optional: Use an API token for Proxmox authentication.\n        api_token_id: \"********\"\n        api_token_secret: \"*******************************\"\n        node: pve01\n        ssh_user: tester\n        ssh_port: 22022             # default to 22\n        ssh_identity_file: /path/to/id_rsa\n        # Optional: The default template name.\n        template_name: debian11\n        # Optional: Set the hostname after cloning.\n        sethostname: yes\n        # Optional: Create the VMs in the pool.\n        pool: test\n        # Optional: Create Linked clone instead of Full clone.\n        full: false\n   platforms:\n     - name: test01\n       # Optional: Specify the VM id of the clone.\n       newid: 216\n     - name: test02\n       # Optional: Specify the VM id of the clone.\n       newid: 217\n\n.. code-block:: yaml\n\n   driver:\n     name: molecule-proxmox\n     options:\n        proxmox_secrets: /path/to/proxmox_secrets.yml\n        node: pve01\n        ssh_user: tester\n        ssh_port: 22022             # default to 22\n        ssh_identity_file: /path/to/id_rsa\n        template_name: debian11\n   platforms:\n     - name: test01\n     - name: test02\n\nThe ``proxmox_secrets`` setting specifies the path to an external file with\nsettings for the proxmox API connection, such as api_password. If this is a regular\nfile, it should be a yaml file with the settings to be included. If the file is\nan executable, the file will be run and the stdout will be combined with the\ndriver options. The output of the script needs to be valid yaml\nconsisting of dictionary keys and values (e.g. ``api_password: foobar``).\n\nThe value of ``proxmox_secrets`` will be passed into ``ansible.builtin.cmd``.\nTherefore, any additional argument values will be passed to the script as well.\n\nThis allows you to use an external password manager to store\nthe Proxmox API connection settings.  For example with a script:\n\n.. code-block:: yaml\n\n   driver:\n     name: molecule-proxmox\n     options:\n        debug: true  # Enable logging proxmox_secrets tasks for troubleshooting\n        proxmox_secrets: /usr/local/bin/proxmox_secrets.sh\n        node: pve01\n\n.. code-block:: bash\n\n    $ cat /usr/local/bin/proxmox_secrets.sh\n    #!/bin/sh\n    pass proxmox/pve01\n\nOr with a file (which **must** not be executable):\n\n.. code-block:: yaml\n\n   driver:\n     name: molecule-proxmox\n     options:\n        debug: true  # Enable logging proxmox_secrets tasks for troubleshooting\n        proxmox_secrets: $HOME/proxmox_secrets.yaml\n        node: pve01\n\n.. code-block:: yaml\n\n    $ cat $HOME/proxmox_secrets.yaml\n    ---\n    api_host: my-proxmox-host\n    api_user: my-proxmox-user@pam\n    api_password: my-secret-password\n\nFinally, a configuration example with many features enabled:\n\n.. code-block:: yaml\n\n   driver:\n     name: molecule-proxmox\n     options:\n        proxmox_secrets: /path/to/proxmox_secrets.yml\n        node: pve01\n        ssh_user: tester\n        ssh_port: 22022             # default to 22\n        ssh_identity_file: /path/to/id_rsa\n        template_name: debian11\n   platforms:\n     - name: test01\n       newid: 1000\n       template_name: debian11\n       # See https://docs.ansible.com/ansible/latest/collections/community/general/proxmox_kvm_module.html\n       # for cloud-init options.\n       ciuser: some_user\n       cipassword: some_password\n       ipconfig:\n         ipconfig0: 'ip=192.168.0.2/24,gw=192.168.0.1'\n       nameservers:\n         - 192.169.0.245\n\nDevelopment\n===========\n\nTo checkout the source code:\n\n.. code-block:: bash\n\n    $ git clone https://github.com/meffie/molecule-proxmox\n    $ cd molecule-proxmox\n\nA `Makefile` and `tox.ini` are provided to facilitate development and testing.\nA Python virtualenv environment may be created with the `init` target.\n\n.. code-block:: bash\n\n    $ make init\n    $ source .venv/bin/activate\n\nExport the following shell environment variables to run the unit tests.\n\n.. code-block:: bash\n\n    # General\n    export TEST_PROXMOX_DEBUG=\"true\"|\"false\"\n\n    # Connection info:\n    export TEST_PROXMOX_HOST=\u003cproxmox hostname\u003e\n    export TEST_PROXMOX_PORT=\u003cproxmox port\u003e\n    export TEST_PROXMOX_USER=\u003cusername@realm\u003e   # e.g. root@pam\n    export TEST_PROXMOX_PASSWORD=\u003cpassword\u003e\n    export TEST_PROXMOX_TOKEN_ID=\u003cid\u003e\n    export TEST_PROXMOX_TOKEN_SECRET=\u003csecret\u003e\n    export TEST_PROXMOX_SECRETS_FILE=\u003cpath to proxmox secrets yaml file\u003e\n    export TEST_PROXMOX_SECRETS_SCRIPT=\u003cpath to proxmox secrets script file\u003e\n    export TEST_PROXMOX_NODE=\u003cproxmox node name\u003e\n    export TEST_PROXMOX_SSH_USER=\u003cusername\u003e\n    export TEST_PROXMOX_SSH_IDENTITY_FILE=\u003cssh key file for username\u003e\n\n    # Template id and names for unit tests:\n    export TEST_PROXMOX_TEMPLATE_VMID=\u003ctemplate vmid to be cloned in by-vmid scenario\u003e\n    export TEST_PROXMOX_TEMPLATE_NAME=\u003ctemplate name to be cloned in by-name scenario\u003e\n\nTo run the unit tests in verbose mode:\n\n.. code-block:: bash\n\n    $ make test\n\nTo run the unit tests in quiet mode:\n\n.. code-block:: bash\n\n    $ make check\n\n\nAuthors\n=======\n\nMolecule Proxmox Plugin was created by Michael Meffie based on code from\nMolecule.\n\nLicense\n=======\n\nThe `MIT`_ License.\n\n\n.. _`Proxmox VE`: https://www.proxmox.com/en/proxmox-ve\n.. _`proxmoxer`: https://pypi.org/project/proxmoxer/\n.. _`community.general.proxmox_kvm`: https://docs.ansible.com/ansible/latest/collections/community/general/proxmox_kvm_module.html\n.. _`MIT`: https://github.com/meffie/molecule-proxmox/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeffie%2Fmolecule-proxmox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeffie%2Fmolecule-proxmox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeffie%2Fmolecule-proxmox/lists"}