{"id":15089141,"url":"https://github.com/nomakcooper/pkginfo_facts","last_synced_at":"2026-01-05T02:11:55.899Z","repository":{"id":251531767,"uuid":"837658874","full_name":"NomakCooper/pkginfo_facts","owner":"NomakCooper","description":"Ansible Custom Module pkginfo_facts. Gathers facts about Solaris pkg info attributes for a specific pkg by \"pkginfo\" on Solaris 10 and \"pkg info\" on Solaris 11.","archived":false,"fork":false,"pushed_at":"2025-02-05T07:08:26.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T14:17:29.891Z","etag":null,"topics":["ansible","ansible-module","facts","pkg","pkginfo","python","solaris-10","solaris-11","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NomakCooper.png","metadata":{"files":{"readme":"README.md","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":"2024-08-03T16:18:08.000Z","updated_at":"2025-02-05T07:08:29.000Z","dependencies_parsed_at":"2024-09-29T23:10:43.229Z","dependency_job_id":null,"html_url":"https://github.com/NomakCooper/pkginfo_facts","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"24a9769f94da9c19d385a3905092532eaea4f46b"},"previous_names":["nomakcooper/pkginfo_facts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NomakCooper%2Fpkginfo_facts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NomakCooper%2Fpkginfo_facts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NomakCooper%2Fpkginfo_facts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NomakCooper%2Fpkginfo_facts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NomakCooper","download_url":"https://codeload.github.com/NomakCooper/pkginfo_facts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244811374,"owners_count":20514276,"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-module","facts","pkg","pkginfo","python","solaris-10","solaris-11","yaml"],"created_at":"2024-09-25T08:41:06.617Z","updated_at":"2026-01-05T02:11:55.871Z","avatar_url":"https://github.com/NomakCooper.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cmeta name=\"author\" content=\"Marco Noce\"\u003e\n\u003cmeta name=\"description\" content=\"Gathers facts about Solaris pkg info attributes for a specific pkg by pkginfo on Solaris 10 and pkg info on Solaris 11.\"\u003e\n\u003cmeta name=\"copyright\" content=\"Marco Noce 2024\"\u003e\n\u003cmeta name=\"keywords\" content=\"ansible, module, solaris, pkg, pkginfo, attribute\"\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Ansible Custom Module][ansible-shield]\n![Oracle Solaris][solaris-shield]\n![python][python-shield]\n![license][license-shield]\n\n\u003c/div\u003e\n\n\n### pkginfo_facts ansible custom module\n#### Gathers facts about Solaris pkg info attributes for a specific pkg.\n\n#### Description :\n\n\u003cb\u003epkginfo_facts\u003c/b\u003e is a custom module for ansible that creates an ansible_facts containing the attribute list of specific pkg on a SunOS/Oracle Solaris 10/11 host.\n\n#### Repo files:\n\n```\n├── /library                \n│   └── pkginfo_facts.py     ##\u003c-- python custom module\n├── sol10_pkg.yml            ##\u003c-- ansible playbook example for Solaris 10 release\n└── sol11_pkg.yml            ##\u003c-- ansible playbook example for Solaris 11 release\n```\n\n#### Requirements :\n\n*  This module supports SunOS/Oracle Solaris 10/11 only\n*  The pkg info are gathered from the [pkginfo] \"-l\" command on Solaris 10.x\n*  The pkg info are gathered from the [pkg] command on Solaris 11.x\n\n\n#### Parameters :\n\n|Parameter|Type  |Required|Sample                      |Comment                                                                                                                 |\n|---------|------|--------|----------------------------|------------------------------------------------------------------------------------------------------------------------|\n|pkgname  |string|True    |\"SUNWzoneu\" ( Solaris 10.x ) \"service/network/smtp/sendmail\" ( Solaris 11.x ) | The pkg name                                                         |\n|alias    |string|True    |\"sendmail\"                  |Pkg alias, a name of your choice which will then be automatically assigned to the dict object name ( sendmail_pkg )     |\n\n#### Attributes :\n\n|Attribute |Support|Description                                                                         |\n|----------|-------|------------------------------------------------------------------------------------|\n|check_mode|full   |Can run in check_mode and return changed status prediction without modifying target.|\n|facts     |full   |Action returns an ansible_facts dictionary that will update existing host facts.    |\n\n#### Examples :\n\n#### Solaris 10.x Tasks\n```yaml\n---\n- name: gather facts of SUNWzoneu pkg on Solaris 10\n  pkginfo_facts:\n    pkgname: \"SUNWzoneu\"\n    alias: zone    \n\n- name: set fact for print\n  set_fact:\n    zone_status: \"{{ ansible_facts.zone_pkg| map(attribute='STATUS') | first }}\"\n    zone_version: \"{{ ansible_facts.zone_pkg| map(attribute='VERSION') | first }}\"    \n\n- name: print SUNWzoneu pkg status and version\n  debug:\n    msg: \"zone pkg is {{zone_status}}. Version : {{zone_version}} \"\n```\n#### Solaris 11.x Tasks\n```yaml\n---\n- name: gather facts of sendmail pkg on Solaris 11\n  pkginfo_facts:\n    pkgname: \"service/network/smtp/sendmail\"\n    alias: sendmail\n\n- name: set fact for print\n  set_fact:\n    sendmail_state: \"{{ ansible_facts.sendmail_pkg| map(attribute='State') | first }}\"\n    sendmail_version: \"{{ ansible_facts.sendmail_pkg| map(attribute='Version') | first }}\"\n\n- name: print sendmail pkg state and version\n  debug:\n    msg: \"sendmail pkg is {{sendmail_state}}. Version : {{sendmail_version}} \" \n```\n#### Solaris 10.x 'alias'_pkg facts:\n```json\n  \"ansible_facts\": {\n    \"zone_pkg\": [\n      {\n        \"CATEGORY\": \"system\",\n        \"STATUS\": \"completely installed\",\n        \"VENDOR\": \"Oracle Corporation\",\n        \"NAME\": \"Solaris Zones (Usr)\",\n        \"PKGINST\": \"SUNWzoneu\",\n        \"BASEDIR\": \"/\",\n        \"VERSION\": \"11.10.0,REV=2005.01.21.15.53\",\n        \"HOTLINE\": \"Please contact your local service provider\",\n        \"INSTDATE\": \"Aug 05 2016 18:57\",\n        \"PSTAMP\": \"on10-patch20131219093000\",\n        \"ARCH\": \"sparc\",\n        \"DESC\": \"Solaris Zones Configuration and Administration\"\n      }\n    ]\n  },\n```\n#### Solaris 11.x 'alias'_pkg facts:\n```json\n  \"ansible_facts\": {\n    \"sendmail_pkg\": [\n      {\n        \"Name\": \"service/network/smtp/sendmail\",\n        \"Summary\": \"Sendmail utilities\",\n        \"Category\": \"System/Core\",\n        \"State\": \"Installed\",\n        \"Publisher\": \"solaris\",\n        \"Version\": \"8.15.2\",\n        \"Branch\": \"11.4.42.0.0.111.0\",\n        \"Packaging Date\": \"December  3, 2021 at  8:56:48 PM\",\n        \"Last Install Time\": \"December  4, 2021 at  6:34:57 AM\",\n        \"Size\": \"2.93 MB\",\n        \"FMRI\": \"pkg://solaris/service/network/smtp/sendmail@8.15.2-11.4.42.0.0.111.0:20211203T205648Z\",\n        \"Project Contact\": \"Sendmail community\",\n        \"Project URL\": \"http://www.sendmail.org/\"\n      }\n    ]\n  },\n```\n#### debug output from example :\n```\nTASK [print SUNWzoneu pkg status and version] *****************************************\nok: [sol10host] =\u003e {\n    \"msg\": \"zone pkg is completely installed. Version : 11.10.0,REV=2005.01.21.15.53 \"\n}\n```\n```\nTASK [print sendmail pkg state and version] *****************************************\nok: [sol11host] =\u003e {\n    \"msg\": \"sendmail pkg is Installed. Version : 8.15.2 \"\n}\n```\n#### Returned Facts :\n\n*  Facts returned by this module are added/updated in the hostvars host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.\n*  Attributes change according to the Solaris Major Release and pkg selected.\n\n|Key              |Type                  |Description                        |Returned       |Sample                                                                                 |\n|-----------------|----------------------|-----------------------------------|---------------|---------------------------------------------------------------------------------------|\n|'alias'_pkg      |list / elements=string|Pkg attribute list.                |               |                                                                                       |\n|CATEGORY         |string                |The pkg category.                  |if Solaris 10.x|\"system\"                                                                               |\n|STATUS           |string                |The pkg installation status.       |if Solaris 10.x|\"completely installed\"                                                                 |\n|VENDOR           |string                |The pkg vendor                     |if Solaris 10.x|\"Oracle Corporation\"                                                                   |\n|NAME             |string                |The pkg extended name.             |if Solaris 10.x|\"Solaris Zones (Usr)\"                                                                  |\n|PKGINST          |string                |The installed pkg name             |if Solaris 10.x|\"SUNWzoneu\"                                                                            |\n|BASEDIR          |string                |The pkg base directory.            |if Solaris 10.x|\"/\"                                                                                    |\n|VERSION          |string                |The pkg version.                   |if Solaris 10.x|\"11.10.0,REV=2005.01.21.15.53\"                                                         |\n|HOTLINE          |string                |The pkg hotline.                   |if Solaris 10.x|\"Please contact your local service provider\"                                           |\n|INSTDATE         |string                |The pkg installation date and time.|if Solaris 10.x|\"Aug 05 2016 18:57\"                                                                    |\n|PSTAMP           |string                |The pkg production stamp.          |if Solaris 10.x|\"on10-patch20131219093000\"                                                             |\n|ARCH             |string                |The pkg architecture supported.    |if Solaris 10.x|\"sparc\"                                                                                |\n|DESC             |string                |The pkg short description.         |if Solaris 10.x|\"Solaris Zones Configuration and Administration\"                                       |\n|Name             |string                |The pkg name.                      |if Solaris 11.x|\"service/network/smtp/sendmail\"                                                        |\n|Summary          |string                |The pkg summary.                   |if Solaris 11.x|\"Sendmail utilities\"                                                                   |\n|Category         |string                |The pkg category.                  |if Solaris 11.x|\"System/Core\"                                                                          |\n|State            |string                |The pkg installation state.        |if Solaris 11.x|\"Installed\"                                                                            |\n|Publisher        |string                |The pkg publisher.                 |if Solaris 11.x|\"solaris\"                                                                              |\n|Version          |string                |The pkg version.                   |if Solaris 11.x|\"8.15.2\"                                                                               |\n|Branch           |string                |The pkg branch.                    |if Solaris 11.x|\"11.4.42.0.0.111.0\"                                                                    |\n|Packaging Date   |string                |The pkg Date.                      |if Solaris 11.x|\"December  3, 2021 at  8:56:48 PM\"                                                     |\n|Last Install Time|string                |The pkg last install date and time.|if Solaris 11.x|\"December  4, 2021 at  6:34:57 AM\"                                                     |\n|Size             |string                |The pkg size.                      |if Solaris 11.x|\"2.93 MB\"                                                                              |\n|FMRI             |string                |The pkg FMRI.                      |if Solaris 11.x|\"pkg://solaris/service/network/smtp/sendmail@8.15.2-11.4.42.0.0.111.0:20211203T205648Z\"|\n|Project Contact  |string                |The pkg project contact.           |if Solaris 11.x|\"Sendmail community\"                                                                   |\n|Project URL      |string                |The pkg project url.               |if Solaris 11.x|\"http://www.sendmail.org/\"                                                             |\n\n## SANITY TEST\n\n* Ansible sanity test is available in [SANITY.md] file\n\n## Integration\n\n1. Assuming you are in the root folder of your ansible project.\n\nSpecify a module path in your ansible configuration file.\n\n```shell\n$ vim ansible.cfg\n```\n```ini\n[defaults]\n...\nlibrary = ./library\n...\n```\n\nCreate the directory and copy the python modules into that directory\n\n```shell\n$ mkdir library\n$ cp path/to/module library\n```\n\n2. If you use Ansible AWX and have no way to edit the control node, you can add the /library directory to the same directory as the playbook .yml file\n\n```\n├── root repository\n│   ├── playbooks\n│   │    ├── /library                \n│   │    │   └── pkginfo_facts.py        ##\u003c-- python custom module\n│   │    └── your_playbook.yml           ##\u003c-- you playbook\n```   \n\n[ansible-shield]: https://img.shields.io/badge/Ansible-custom%20module-blue?style=for-the-badge\u0026logo=ansible\u0026logoColor=lightgrey\n[solaris-shield]: https://img.shields.io/badge/oracle-solaris-red?style=for-the-badge\u0026logo=oracle\u0026logoColor=red\n[python-shield]: https://img.shields.io/badge/python-blue?style=for-the-badge\u0026logo=python\u0026logoColor=yellow\n[license-shield]: https://img.shields.io/github/license/nomakcooper/svcs_attr_facts?style=for-the-badge\u0026label=LICENSE\n\n\n[pkginfo]: https://docs.oracle.com/cd/E19455-01/805-6338/ch4verifypkg-36/index.html\n[pkg]: https://docs.oracle.com/cd/E23824_01/html/821-1451/gkunu.html#:~:text=The%20pkg%20info%20command%20displays,installed%20in%20the%20current%20image.\n[SANITY.md]: SANITY.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomakcooper%2Fpkginfo_facts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnomakcooper%2Fpkginfo_facts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomakcooper%2Fpkginfo_facts/lists"}