{"id":20331010,"url":"https://github.com/cans/package-install","last_synced_at":"2025-07-29T21:35:11.105Z","repository":{"id":139898268,"uuid":"88016028","full_name":"cans/package-install","owner":"cans","description":"Simple Ansible Role that installs a given list of Debian packages","archived":false,"fork":false,"pushed_at":"2018-06-20T20:39:30.000Z","size":28,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-12T09:40:47.915Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cans.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.rst","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":"2017-04-12T06:10:36.000Z","updated_at":"2018-06-20T20:39:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb9ee8cd-134c-47fe-b737-a5a2c1f02a90","html_url":"https://github.com/cans/package-install","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cans/package-install","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fpackage-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fpackage-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fpackage-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fpackage-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cans","download_url":"https://codeload.github.com/cans/package-install/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fpackage-install/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267763447,"owners_count":24140822,"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-07-29T02:00:12.549Z","response_time":2574,"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-14T20:18:28.217Z","updated_at":"2025-07-29T21:35:11.027Z","avatar_url":"https://github.com/cans.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"cans.package-install\n====================\n\n[![Build Status](https://img.shields.io/travis/marvinpinto/ansible-role-docker/master.svg?style=flat-square)](https://travis-ci.org/cans/package-install)\n[![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-cans.package--install-blue.svg?style=flat-square)](https://galaxy.ansible.com/cans/package-install)\n[![License](https://img.shields.io/badge/license-GPLv2-brightgreen.svg?style=flat-square)](LICENSE)\n\nSimple Ansible Role that installs a given list of Debian packages\n(`.deb`).\n\n\nThe intent of this role is not to come with all the bells and whistles.\nIt is more a minimalistic, but efficient and reusable, package installation\nmethod. It is basically a procedure that, when given a list of packages,\ninstalls them.\n\n\nRequirements\n------------\n\nThis role has no particular pre-requisite. But is assumes the target\nserver(s) use the [Debian distribution](https://www.debian.org) or a\nderivative.\n\n\nRole Variables\n--------------\n\nAll variables in this role are namespaced using the `pkginstall_` prefix.\n\nThis role also defines variables for its internal use. Those are prefixed\nwith `_pkginstall_`. You should not use those variables.\n\n### Input variables\n\nFor this roles to perform any task, you *must* define either or both of the\n`pkginstall_packages_absent` and `pkginstall_packages_present variables.\n\n- `pkginstall_packages`: **DEPRECATED** Use `pkginstall_package_present`\n  instead (default: `[]`);\n- `pkginstall_packages_present`: a list of package names to ensure are\n  installed on the target host(s) (default: `[]`);\n- `pkginstall_packages_absent`: a list of package names to ensure are *not*\n  installed on the target host(s) (default: `[]`);\n\n\n### Defaults\n\n- `pkginstall_apt_package_list_cache_directory`: path to the directory that\n  stores available package lists and packages content lists. This variable\n  is only required if you set `pkginstall_cache_purge` to `true` (see below).\n  It is very unlikely you would ever need to change this. (default:\n  `\"/var/lib/apt/lists\"`)\n- `pkginstall_cache_ttl`: package cache validity duration, in seconds\n  (default: 3600)\n- `pkginstall_cache_update`: whether to update the package cache or not\n  before installing packages (default: `true`)\n- `pkginstall_purge`: when removing packages, also remove their configuration\n  files (default: `true`);\n- `pkginstall_recommended`: whether to install *recommended* packages\n  alongside the packages explicitly listed for installation (default:\n  `false`).\n- `pkginstall_update_cache`: **DEPRECATED** use `pkginstall_cache_update`\n  instead (default: `true`)\n\n\n\nDependencies\n------------\n\nThis role has no formal dependencies. But it requires from you to\noverride the `pkginstall_packages` variable to actually perform\nanything (_cf._ example playbook below).\n\nYou may also be interested in using the `cans.package-source` role in\nconjunction with this one, to add extra package repositories to those\nalready known by APT.\n\n\nExample Playbooks\n-----------------\n\nAssume you have two roles, `first_role` and `second_roles`, each of\nwhich defines a variable that contains a list of packages to install,\nlet say `first_role_packages` and `second_role_packages`, respectively.\nYou can then, to use this role, start by assigning the\n`pkg_install_packages` variable with the concatenation of both list.\nThen just call the role.\n\n```yaml\n- hosts: servers\n  vars:\n    pkginstall_packages: \"{{ first_role_packages + second_role_packages }}\"\n  roles:\n    - role: cans.package-install\n    - role: first_role\n    - role: second_role\n```\n\nIf for some reason you _cannot_ install all the packages at once (_e.g._\nbecause `first_role` installs or configures somethings required before being\nable to install the packages required by `second_role`:\n\n```yaml\n- hosts: servers\n  roles:\n    - role: cans.package-install\n      pkginstall_packages: \"{{ first_role_packages }}\"\n    - role: first_role\n    - role: cans.package-install\n      pkginstall_packages: \"{{ second_role_packages }}\"\n    - role: second_role\n```\n\nThe above examples assume Ansible connects to the target servers with an\nidentity that has sufficient privileges to install packages. If not you\nmay need to use either or both of the `remote_user` and `become` keywords:\n\n```yaml\n- hosts: servers\n  remote_user: \"privileged-user\"\n  vars:\n    pkginstall_packages: \"{{ first_role_packages + second_role_packages }}\"\n  roles:\n    - role: cans.package-install\n      become: yes\n    - role: first_role\n    - role: second_role\n```\n\n\nLicense\n-------\n\nGPLv2\n\n\nAuthor Information\n------------------\n\nCopyright © 2017-2018, Nicolas CANIART.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcans%2Fpackage-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcans%2Fpackage-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcans%2Fpackage-install/lists"}