{"id":20978756,"url":"https://github.com/holmanb/ansible-lxd-public","last_synced_at":"2026-03-19T18:16:55.582Z","repository":{"id":111426879,"uuid":"545783608","full_name":"holmanb/ansible-lxd-public","owner":"holmanb","description":"Fork this repo to test out deploy keys!   (Fork -\u003e Settings -\u003e Deploy Keys)","archived":false,"fork":false,"pushed_at":"2023-03-09T02:20:39.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T09:46:45.483Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holmanb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-10-05T01:07:47.000Z","updated_at":"2023-11-15T19:54:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa04b9d0-f7bd-4633-b028-454872d45119","html_url":"https://github.com/holmanb/ansible-lxd-public","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/holmanb/ansible-lxd-public","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holmanb%2Fansible-lxd-public","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holmanb%2Fansible-lxd-public/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holmanb%2Fansible-lxd-public/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holmanb%2Fansible-lxd-public/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holmanb","download_url":"https://codeload.github.com/holmanb/ansible-lxd-public/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holmanb%2Fansible-lxd-public/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28061258,"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","status":"online","status_checked_at":"2025-12-26T02:00:06.189Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-19T05:07:15.190Z","updated_at":"2025-12-26T21:17:54.338Z","avatar_url":"https://github.com/holmanb.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Ansible LXD Example\n===================\n\nThis repository exists to demonstrate using cloud-init, lxd, and ansible\ntogether. These playbooks may be executed directly, or can be sourced from a\nrepository using cloud-init's ansible module (this repo exist to test that\nfunctionality).\n\nstart.yml\n---------\nThis shows how to start a lxd container using ansible. It shows\nhow to pass a user-data config to cloud-init before starting the container.\nIt also writes out an inventory file for the started container.\n\n\nconfigure.yml\n-------------\n\nThis playbook demonstrates connecting to a started lxd container and\nconfiguring it.\n\n\nExample Usage:\n---------------\n\nThe first playbook adds the new container to /etc/hosts, and therefore\nrequires privilege escalation.\n\n```ansible\n\u003e sudo ansible-playbook start-lxd.yml\n[sudo] password for holmanb: \n[WARNING]: Unable to parse /home/ansible/my-repo/hosts as an inventory source\n[WARNING]: No inventory was parsed, only implicit localhost is available\n[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'\n\nPLAY [localhost] **************************************************************************************************************************************************************************************************\n\nTASK [Create a started lxd container with a user for ansible] *****************************************************************************************************************************************************\nok: [localhost]\n\nTASK [Print container address for debugging] **********************************************************************************************************************************************************************\nok: [localhost] =\u003e {\n    \"addresses.addresses.eth0\": [\n        \"10.161.80.190\"\n    ]\n}\n\nTASK [Add lxd-container-00 to /etc/hosts file] ********************************************************************************************************************************************************************\nok: [localhost]\n\nTASK [Create a new ansible inventory file (yaml format) at [/home/holmanb/workspace/ansible-lxd]] *****************************************************************************************************************\nok: [localhost]\n\nPLAY RECAP ********************************************************************************************************************************************************************************************************\nlocalhost                  : ok=4    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   \n\n\n\n\u003e ansible-playbook -i new_ansible_hosts configure-lxd.yml \n\nPLAY [all] ********************************************************************************************************************************************************************************************************\n\nTASK [Gathering Facts] ********************************************************************************************************************************************************************************************\n[WARNING]: The \"ansible_collections.community.general.plugins.connection.lxd\" connection plugin has an improperly configured remote target value, forcing \"inventory_hostname\" templated value instead of the\nstring\nok: [lxd-container-00]\n\nTASK [get the username running the deploy] ************************************************************************************************************************************************************************\nchanged: [lxd-container-00 -\u003e localhost]\n\nTASK [get the privileged user running the deploy] *****************************************************************************************************************************************************************\nchanged: [lxd-container-00 -\u003e localhost]\n\nTASK [Connect to started lxd container, write a single file as ansible user] **************************************************************************************************************************************\n[WARNING]: The \"ansible_collections.community.general.plugins.connection.lxd\" connection plugin has an improperly configured remote target value, forcing \"inventory_hostname\" templated value instead of the\nstring\nchanged: [lxd-container-00]\n\nTASK [Connect to started lxd container, write a single file as root] **********************************************************************************************************************************************\n[WARNING]: The \"ansible_collections.community.general.plugins.connection.lxd\" connection plugin has an improperly configured remote target value, forcing \"inventory_hostname\" templated value instead of the\nstring\nchanged: [lxd-container-00]\n\nPLAY RECAP ********************************************************************************************************************************************************************************************************\nlxd-container-00           : ok=5    changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholmanb%2Fansible-lxd-public","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholmanb%2Fansible-lxd-public","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholmanb%2Fansible-lxd-public/lists"}