{"id":21518159,"url":"https://github.com/ucloud/packer-plugin-ucloud","last_synced_at":"2025-04-09T21:45:01.952Z","repository":{"id":37847849,"uuid":"358037537","full_name":"ucloud/packer-plugin-ucloud","owner":"ucloud","description":"Packer plugin for UCloud Image Builder","archived":false,"fork":false,"pushed_at":"2024-03-15T19:44:18.000Z","size":434,"stargazers_count":6,"open_issues_count":4,"forks_count":6,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-23T23:36:07.269Z","etag":null,"topics":["packer","packer-plugin","ucloud"],"latest_commit_sha":null,"homepage":"https://www.packer.io/docs/builders/ucloud-uhost","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ucloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-14T20:44:09.000Z","updated_at":"2024-09-29T13:06:55.000Z","dependencies_parsed_at":"2023-07-27T22:11:42.195Z","dependency_job_id":"99363bfb-1945-4dd3-9d93-c0d1100fbc41","html_url":"https://github.com/ucloud/packer-plugin-ucloud","commit_stats":null,"previous_names":["hashicorp/packer-plugin-ucloud"],"tags_count":11,"template":false,"template_full_name":"hashicorp/packer-plugin-scaffolding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fpacker-plugin-ucloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fpacker-plugin-ucloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fpacker-plugin-ucloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ucloud%2Fpacker-plugin-ucloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ucloud","download_url":"https://codeload.github.com/ucloud/packer-plugin-ucloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119439,"owners_count":21050754,"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":["packer","packer-plugin","ucloud"],"created_at":"2024-11-24T00:50:22.241Z","updated_at":"2025-04-09T21:45:01.916Z","avatar_url":"https://github.com/ucloud.png","language":"Go","readme":"# Packer Plugin Ucloud\nThe `Ucloud` multi-component plugin can be used with HashiCorp\n[Packer](https://www.packer.io) to create custom images. For the full list of\navailable features for this plugin see [docs](docs).\n\n## Installation\n\n### Using pre-built releases\n\n#### Using the `packer init` command\n\nStarting from version 1.7, Packer supports a new `packer init` command allowing\nautomatic installation of Packer plugins. Read the\n[Packer documentation](https://www.packer.io/docs/commands/init) for more information.\n\nTo install this plugin, copy and paste this code into your Packer configuration .\nThen, run [`packer init`](https://www.packer.io/docs/commands/init).\n\n```hcl\npacker {\n  required_plugins {\n    ucloud = {\n      version = \"\u003e= 1.0.9\"\n      source  = \"github.com/ucloud/ucloud\"\n    }\n  }\n}\n```\n\n\n#### Manual installation\n\nYou can find pre-built binary releases of the plugin\n[here](https://github.com/ucloud/packer-plugin-ucloud/releases). Once you have\ndownloaded the latest archive corresponding to your target OS, uncompress it to\nretrieve the plugin binary file corresponding to your platform. To install the\nplugin, please follow the Packer documentation on [installing a\nplugin](https://www.packer.io/docs/extending/plugins/#installing-plugins).\n\n\n### From Sources\n\nIf you prefer to build the plugin from sources, clone the GitHub repository\nlocally and run the command `go build` from the root\ndirectory. Upon successful compilation, a `packer-plugin-ucloud` plugin\nbinary file can be found in the root directory.\nTo install the compiled plugin, please follow the official Packer documentation\non [installing a plugin](https://www.packer.io/docs/extending/plugins/#installing-plugins).\n\n\n### Configuration\n\nFor more information on how to configure the plugin, please read the\ndocumentation located in the [`docs/`](docs) directory.\n\n## Usage Example\n\nBefore you try the example in this section, you should get public, private key\nand project id from UCloud console and export the following environment varialbes:\n\n- `UCLOUD_PRIVATE_KEY`\n- `UCLOUD_PUBLIC_KEY`\n- `UCLOUD_PROJECT_ID`\n\nThen create a packer instruction file in HCL syntax as follows:\n\n\n    packer {\n      required_plugins {\n        ucloud = {\n          version = \"\u003e= 1.0.9\"\n          source  = \"github.com/ucloud/ucloud\"\n        }\n      }\n    }\n\n    variable \"ucloud_private_key\" {\n      type    = string\n      default = \"${env(\"UCLOUD_PRIVATE_KEY\")}\"\n    }\n\n    variable \"ucloud_project_id\" {\n      type    = string\n      default = \"${env(\"UCLOUD_PROJECT_ID\")}\"\n    }\n\n    variable \"ucloud_public_key\" {\n      type    = string\n      default = \"${env(\"UCLOUD_PUBLIC_KEY\")}\"\n    }\n\n    source \"ucloud-uhost\" \"centos7-image-seed\" {\n      availability_zone = \"cn-sh2-02\"\n      image_name        = \"uk8s-centos-7.9\"\n      instance_type     = \"o-standard-2\"\n      private_key       = \"${var.ucloud_private_key}\"\n      project_id        = \"${var.ucloud_project_id}\"\n      public_key        = \"${var.ucloud_public_key}\"\n      region            = \"cn-sh2\"\n      source_image_id   = \"uimage-vj5ui3\"\n      ssh_username      = \"root\"\n    }\n\n    build {\n      name = \"UK8S-Centos7-BaseImage\"\n      sources = [\"source.ucloud-uhost.centos7-image-seed\"]\n\n\n      provisioner \"shell\" {\n          inline = [\"echo hello\"]\n      }\n\n      provisioner \"ansible\" {\n        playbook_file = \"./playbook-centos.yml\"\n      }\n    }\n\nName the file as `xxx.pkr.hcl` and run `packer init` command under the\ndirectory where the above file located:\n\n    packer init xxx.pkr.hcl\n\nPacker will install the required plugins automatically. Then you run packer to\nbuild the image for uhost. It is recommended that you enable the packer log to\naid diagnosis if something goes wrong. You run commands as follows:\n\n\n    export UCLOUD_PRIVATE_KEY=\"****************\"\n    export UCLOUD_PUBLIC_KEY=\"******************\"\n    export UCLOUD_PROJECT_ID=\"xxx\"\n    export PACKER_LOG=1\n    export PACKER_LOG_PATH=\"packer.log\"\n    packer build xxx.pkr.hcl\n\n## Contributing\n\n* If you think you've found a bug in the code or you have a question regarding\n  the usage of this software, please reach out to us by opening an issue in\n  this GitHub repository.\n* Contributions to this project are welcome: if you want to add a feature or a\n  fix a bug, please do so by opening a Pull Request in this GitHub repository.\n  In case of feature contribution, we kindly ask you to open an issue to\n  discuss it beforehand.\n\n## GPG public key\nYou may verify the released binaries with this GPG public key:\n\n    -----BEGIN PGP PUBLIC KEY BLOCK-----\n\n    mDMEZCbtBxYJKwYBBAHaRw8BAQdAzED5JgKHHe17uuPWzoU8IJRK0bqBF9S+KdVn\n    aCq1tg+0N0p1c3RpbiBaaGFuZyAoVUNsb3VkIHdvcmsgR1BHKSA8anVzdGluLnpo\n    YW5nQHVjbG91ZC5jbj6ImgQTFgoAQhYhBPi+ba2/BwN794NuPH7pFs0ifsLFBQJk\n    Ju0HAhsDBQkDwmcABQsJCAcCAyICAQYVCgkICwIEFgIDAQIeBwIXgAAKCRB+6RbN\n    In7CxTwnAQD739fTMO0e4LSvBYYqMT0OEel4/MYJMVXdftLB9CnfQAEAkel163cV\n    YCaW553KyQOJCI9aJSasopYju3lIUvkWfgGJATMEEAEIAB0WIQRFzhtgzKPwfHuQ\n    /nYgH5GJOOn1+gUCZCwziwAKCRAgH5GJOOn1+nG4CACT066mVIGq2dBPmf/7oNQS\n    JTZt1IdbYAkP3E7YhLolCDinDHjaw25JevR3iDIhPqqlaogrlIC2RBxsDg7zrv+q\n    SSEIkebW8BYYgc7K+1hpse4/V/jXJ1b+aFPKC3uvtQX8wU5bgOIctvhxl9agXHqd\n    MLtlbsGav0KGu65DElTLsoyEhaakWVatyGZ4tigc13o3CH6uUJCgaptYPc6J4p6N\n    we6q0s1FnNRYe3+ov+WvJvz+k2Qjr5o4n9HFajlueZcs1rAf6Eehpa/Imcp5NXCT\n    0q453b0atLykK567Xc9v+gRRsJtDXV+rHNV38eAHazfwrEyVapkQ/JGJtAPI1/5n\n    uDgEZCbtBxIKKwYBBAGXVQEFAQEHQLZykGFXbDtodQLzuIclSAK4//NnT6F3kXC5\n    M7flA55EAwEIB4h+BBgWCgAmFiEE+L5trb8HA3v3g248fukWzSJ+wsUFAmQm7QcC\n    GwwFCQPCZwAACgkQfukWzSJ+wsU9HwD+NAsTt8Odq4arxJd1t+bflUFqplvqbBwB\n    eXTsLTAKa2QBAI/ODojRoHtRU/rka6kiQJzFjN4nEINvoNyeem/PMaoE\n    =6uAG\n    -----END PGP PUBLIC KEY BLOCK-----\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucloud%2Fpacker-plugin-ucloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fucloud%2Fpacker-plugin-ucloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fucloud%2Fpacker-plugin-ucloud/lists"}